Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 1 | <template> |
| 2 | <div> |
Derick Montague | 75b4832 | 2019-12-06 01:24:41 -0600 | [diff] [blame] | 3 | <header id="page-header"> |
Derick Montague | 8026797 | 2021-02-16 09:47:03 -0600 | [diff] [blame] | 4 | <a |
| 5 | class="link-skip-nav btn btn-light" |
| 6 | href="#main-content" |
| 7 | @click="setFocus" |
| 8 | > |
Derick Montague | 6859203 | 2020-04-04 14:02:34 -0500 | [diff] [blame] | 9 | {{ $t('appHeader.skipToContent') }} |
| 10 | </a> |
| 11 | |
Mateusz Gapski | 21d6de0 | 2020-07-29 14:28:23 +0200 | [diff] [blame] | 12 | <b-navbar type="dark" :aria-label="$t('appHeader.applicationHeader')"> |
Yoshie Muranaka | dc04feb | 2019-12-04 08:41:22 -0800 | [diff] [blame] | 13 | <!-- Left aligned nav items --> |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 14 | <b-button |
Derick Montague | 6859203 | 2020-04-04 14:02:34 -0500 | [diff] [blame] | 15 | id="app-header-trigger" |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 16 | class="nav-trigger" |
| 17 | aria-hidden="true" |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 18 | type="button" |
| 19 | variant="link" |
SurenNeware | 057232b | 2020-06-08 20:53:26 +0530 | [diff] [blame] | 20 | :class="{ open: isNavigationOpen }" |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 21 | @click="toggleNavigation" |
| 22 | > |
SurenNeware | a5cbc44 | 2020-10-12 15:26:39 +0530 | [diff] [blame] | 23 | <icon-close |
| 24 | v-if="isNavigationOpen" |
| 25 | :title="$t('appHeader.titleHideNavigation')" |
| 26 | /> |
| 27 | <icon-menu |
| 28 | v-if="!isNavigationOpen" |
| 29 | :title="$t('appHeader.titleShowNavigation')" |
| 30 | /> |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 31 | </b-button> |
Yoshie Muranaka | dc04feb | 2019-12-04 08:41:22 -0800 | [diff] [blame] | 32 | <b-navbar-nav> |
Sukanya Pandey | c5c2ae9 | 2020-12-09 16:14:19 +0530 | [diff] [blame] | 33 | <b-navbar-brand |
| 34 | class="mr-0" |
| 35 | to="/" |
| 36 | data-test-id="appHeader-container-overview" |
| 37 | > |
Dixsie Wolmers | 76ccbbc | 2020-08-24 21:25:57 -0500 | [diff] [blame] | 38 | <img |
| 39 | class="header-logo" |
| 40 | src="@/assets/images/logo-header.svg" |
| 41 | :alt="altLogo" |
| 42 | /> |
SurenNeware | 1f8117f | 2020-09-22 19:28:56 +0530 | [diff] [blame] | 43 | </b-navbar-brand> |
Sukanya Pandey | c5c2ae9 | 2020-12-09 16:14:19 +0530 | [diff] [blame] | 44 | <div v-if="assetTag" class="asset-tag"> |
| 45 | <span class="pr-2">|</span> |
| 46 | <span>{{ assetTag }}</span> |
| 47 | </div> |
Yoshie Muranaka | b8b6f79 | 2019-12-03 14:47:32 -0800 | [diff] [blame] | 48 | </b-navbar-nav> |
Yoshie Muranaka | dc04feb | 2019-12-04 08:41:22 -0800 | [diff] [blame] | 49 | <!-- Right aligned nav items --> |
SurenNeware | 057232b | 2020-06-08 20:53:26 +0530 | [diff] [blame] | 50 | <b-navbar-nav class="ml-auto helper-menu"> |
Derick Montague | 965cf67 | 2020-07-23 17:24:39 -0500 | [diff] [blame] | 51 | <b-nav-item |
| 52 | to="/health/event-logs" |
| 53 | data-test-id="appHeader-container-health" |
| 54 | > |
Derick Montague | 6859203 | 2020-04-04 14:02:34 -0500 | [diff] [blame] | 55 | <status-icon :status="healthStatusIcon" /> |
SurenNeware | 057232b | 2020-06-08 20:53:26 +0530 | [diff] [blame] | 56 | {{ $t('appHeader.health') }} |
Derick Montague | 6859203 | 2020-04-04 14:02:34 -0500 | [diff] [blame] | 57 | </b-nav-item> |
Derick Montague | 965cf67 | 2020-07-23 17:24:39 -0500 | [diff] [blame] | 58 | <b-nav-item |
| 59 | to="/control/server-power-operations" |
| 60 | data-test-id="appHeader-container-power" |
| 61 | > |
Derick Montague | 71114fe | 2021-05-06 18:17:34 -0500 | [diff] [blame^] | 62 | <status-icon :status="serverStatusIcon" /> |
SurenNeware | 057232b | 2020-06-08 20:53:26 +0530 | [diff] [blame] | 63 | {{ $t('appHeader.power') }} |
Derick Montague | 6859203 | 2020-04-04 14:02:34 -0500 | [diff] [blame] | 64 | </b-nav-item> |
| 65 | <!-- Using LI elements instead of b-nav-item to support semantic button elements --> |
| 66 | <li class="nav-item"> |
Derick Montague | 965cf67 | 2020-07-23 17:24:39 -0500 | [diff] [blame] | 67 | <b-button |
| 68 | id="app-header-refresh" |
| 69 | variant="link" |
| 70 | data-test-id="appHeader-button-refresh" |
| 71 | @click="refresh" |
| 72 | > |
SurenNeware | a5cbc44 | 2020-10-12 15:26:39 +0530 | [diff] [blame] | 73 | <icon-renew :title="$t('appHeader.titleRefresh')" /> |
SurenNeware | 057232b | 2020-06-08 20:53:26 +0530 | [diff] [blame] | 74 | <span class="responsive-text">{{ $t('appHeader.refresh') }}</span> |
Derick Montague | 6859203 | 2020-04-04 14:02:34 -0500 | [diff] [blame] | 75 | </b-button> |
| 76 | </li> |
Sukanya Pandey | b1f559f | 2020-04-28 20:18:28 +0530 | [diff] [blame] | 77 | <li class="nav-item"> |
Derick Montague | 965cf67 | 2020-07-23 17:24:39 -0500 | [diff] [blame] | 78 | <b-dropdown |
| 79 | id="app-header-user" |
| 80 | variant="link" |
| 81 | right |
| 82 | data-test-id="appHeader-container-user" |
| 83 | > |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 84 | <template #button-content> |
SurenNeware | a5cbc44 | 2020-10-12 15:26:39 +0530 | [diff] [blame] | 85 | <icon-avatar :title="$t('appHeader.titleProfile')" /> |
SurenNeware | 057232b | 2020-06-08 20:53:26 +0530 | [diff] [blame] | 86 | <span class="responsive-text">{{ username }}</span> |
Sukanya Pandey | b1f559f | 2020-04-28 20:18:28 +0530 | [diff] [blame] | 87 | </template> |
Derick Montague | 965cf67 | 2020-07-23 17:24:39 -0500 | [diff] [blame] | 88 | <b-dropdown-item |
| 89 | to="/profile-settings" |
| 90 | data-test-id="appHeader-link-profile" |
Sukanya Pandey | b1f559f | 2020-04-28 20:18:28 +0530 | [diff] [blame] | 91 | >{{ $t('appHeader.profileSettings') }} |
| 92 | </b-dropdown-item> |
Derick Montague | 965cf67 | 2020-07-23 17:24:39 -0500 | [diff] [blame] | 93 | <b-dropdown-item |
| 94 | data-test-id="appHeader-link-logout" |
| 95 | @click="logout" |
| 96 | > |
| 97 | {{ $t('appHeader.logOut') }} |
| 98 | </b-dropdown-item> |
Sukanya Pandey | b1f559f | 2020-04-28 20:18:28 +0530 | [diff] [blame] | 99 | </b-dropdown> |
Derick Montague | 6859203 | 2020-04-04 14:02:34 -0500 | [diff] [blame] | 100 | </li> |
Yoshie Muranaka | b8b6f79 | 2019-12-03 14:47:32 -0800 | [diff] [blame] | 101 | </b-navbar-nav> |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 102 | </b-navbar> |
| 103 | </header> |
Yoshie Muranaka | 3be801a | 2020-04-21 11:34:56 -0700 | [diff] [blame] | 104 | <loading-bar /> |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 105 | </div> |
| 106 | </template> |
| 107 | |
| 108 | <script> |
Sukanya Pandey | dd6aa0a | 2020-10-08 20:47:39 +0530 | [diff] [blame] | 109 | import BVToastMixin from '@/components/Mixins/BVToastMixin'; |
Derick Montague | e2fd156 | 2019-12-20 13:26:53 -0600 | [diff] [blame] | 110 | import IconAvatar from '@carbon/icons-vue/es/user--avatar/20'; |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 111 | import IconClose from '@carbon/icons-vue/es/close/20'; |
| 112 | import IconMenu from '@carbon/icons-vue/es/menu/20'; |
Derick Montague | e2fd156 | 2019-12-20 13:26:53 -0600 | [diff] [blame] | 113 | import IconRenew from '@carbon/icons-vue/es/renew/20'; |
SurenNeware | 6185909 | 2020-10-01 09:37:32 +0530 | [diff] [blame] | 114 | import StatusIcon from '@/components/Global/StatusIcon'; |
| 115 | import LoadingBar from '@/components/Global/LoadingBar'; |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 116 | |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 117 | export default { |
Derick Montague | e2fd156 | 2019-12-20 13:26:53 -0600 | [diff] [blame] | 118 | name: 'AppHeader', |
Yoshie Muranaka | 3be801a | 2020-04-21 11:34:56 -0700 | [diff] [blame] | 119 | components: { |
| 120 | IconAvatar, |
| 121 | IconClose, |
| 122 | IconMenu, |
| 123 | IconRenew, |
| 124 | StatusIcon, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 125 | LoadingBar, |
Yoshie Muranaka | 3be801a | 2020-04-21 11:34:56 -0700 | [diff] [blame] | 126 | }, |
Sukanya Pandey | dd6aa0a | 2020-10-08 20:47:39 +0530 | [diff] [blame] | 127 | mixins: [BVToastMixin], |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 128 | data() { |
| 129 | return { |
Mateusz Gapski | 0350591 | 2020-06-25 08:16:51 +0200 | [diff] [blame] | 130 | isNavigationOpen: false, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 131 | altLogo: `${process.env.VUE_APP_COMPANY_NAME} logo`, |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 132 | }; |
| 133 | }, |
Yoshie Muranaka | b8b6f79 | 2019-12-03 14:47:32 -0800 | [diff] [blame] | 134 | computed: { |
Sukanya Pandey | c5c2ae9 | 2020-12-09 16:14:19 +0530 | [diff] [blame] | 135 | assetTag() { |
| 136 | return this.$store.getters['global/assetTag']; |
| 137 | }, |
Sukanya Pandey | dd6aa0a | 2020-10-08 20:47:39 +0530 | [diff] [blame] | 138 | isAuthorized() { |
| 139 | return this.$store.getters['global/isAuthorized']; |
| 140 | }, |
Derick Montague | 71114fe | 2021-05-06 18:17:34 -0500 | [diff] [blame^] | 141 | serverStatus() { |
| 142 | return this.$store.getters['global/serverStatus']; |
Yoshie Muranaka | dc04feb | 2019-12-04 08:41:22 -0800 | [diff] [blame] | 143 | }, |
Yoshie Muranaka | 1ace1d9 | 2020-02-06 13:47:28 -0800 | [diff] [blame] | 144 | healthStatus() { |
| 145 | return this.$store.getters['eventLog/healthStatus']; |
| 146 | }, |
Derick Montague | 71114fe | 2021-05-06 18:17:34 -0500 | [diff] [blame^] | 147 | serverStatusIcon() { |
| 148 | switch (this.serverStatus) { |
Derick Montague | e2fd156 | 2019-12-20 13:26:53 -0600 | [diff] [blame] | 149 | case 'on': |
| 150 | return 'success'; |
| 151 | case 'error': |
| 152 | return 'danger'; |
Yoshie Muranaka | a3cbc65 | 2020-05-13 12:55:48 -0700 | [diff] [blame] | 153 | case 'diagnosticMode': |
| 154 | return 'warning'; |
Derick Montague | e2fd156 | 2019-12-20 13:26:53 -0600 | [diff] [blame] | 155 | case 'off': |
Yoshie Muranaka | dc04feb | 2019-12-04 08:41:22 -0800 | [diff] [blame] | 156 | default: |
Derick Montague | e2fd156 | 2019-12-20 13:26:53 -0600 | [diff] [blame] | 157 | return 'secondary'; |
Yoshie Muranaka | dc04feb | 2019-12-04 08:41:22 -0800 | [diff] [blame] | 158 | } |
Yoshie Muranaka | 1ace1d9 | 2020-02-06 13:47:28 -0800 | [diff] [blame] | 159 | }, |
| 160 | healthStatusIcon() { |
| 161 | switch (this.healthStatus) { |
Yoshie Muranaka | ce9a3ef | 2020-05-06 14:33:22 -0700 | [diff] [blame] | 162 | case 'OK': |
Yoshie Muranaka | 1ace1d9 | 2020-02-06 13:47:28 -0800 | [diff] [blame] | 163 | return 'success'; |
Yoshie Muranaka | ce9a3ef | 2020-05-06 14:33:22 -0700 | [diff] [blame] | 164 | case 'Warning': |
Yoshie Muranaka | 1ace1d9 | 2020-02-06 13:47:28 -0800 | [diff] [blame] | 165 | return 'warning'; |
Yoshie Muranaka | ce9a3ef | 2020-05-06 14:33:22 -0700 | [diff] [blame] | 166 | case 'Critical': |
Yoshie Muranaka | 1ace1d9 | 2020-02-06 13:47:28 -0800 | [diff] [blame] | 167 | return 'danger'; |
| 168 | default: |
| 169 | return 'secondary'; |
| 170 | } |
Sukanya Pandey | b1f559f | 2020-04-28 20:18:28 +0530 | [diff] [blame] | 171 | }, |
| 172 | username() { |
| 173 | return this.$store.getters['global/username']; |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 174 | }, |
Yoshie Muranaka | b8b6f79 | 2019-12-03 14:47:32 -0800 | [diff] [blame] | 175 | }, |
Sukanya Pandey | dd6aa0a | 2020-10-08 20:47:39 +0530 | [diff] [blame] | 176 | watch: { |
| 177 | isAuthorized(value) { |
| 178 | if (value === false) { |
Yoshie Muranaka | f92e296 | 2021-02-09 12:41:53 -0800 | [diff] [blame] | 179 | this.errorToast(this.$t('global.toast.unAuthDescription'), { |
| 180 | title: this.$t('global.toast.unAuthTitle'), |
| 181 | }); |
Sukanya Pandey | dd6aa0a | 2020-10-08 20:47:39 +0530 | [diff] [blame] | 182 | } |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 183 | }, |
Sukanya Pandey | dd6aa0a | 2020-10-08 20:47:39 +0530 | [diff] [blame] | 184 | }, |
Derick Montague | 09e45cd | 2020-01-23 15:45:57 -0600 | [diff] [blame] | 185 | created() { |
Yoshie Muranaka | d624dae | 2020-09-21 14:35:58 -0700 | [diff] [blame] | 186 | // Reset auth state to check if user is authenticated based |
| 187 | // on available browser cookies |
| 188 | this.$store.dispatch('authentication/resetStoreState'); |
Derick Montague | 71114fe | 2021-05-06 18:17:34 -0500 | [diff] [blame^] | 189 | this.getServerInfo(); |
Yoshie Muranaka | 1ace1d9 | 2020-02-06 13:47:28 -0800 | [diff] [blame] | 190 | this.getEvents(); |
Derick Montague | 09e45cd | 2020-01-23 15:45:57 -0600 | [diff] [blame] | 191 | }, |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 192 | mounted() { |
| 193 | this.$root.$on( |
Sukanya Pandey | edb8a77 | 2020-10-29 11:33:42 +0530 | [diff] [blame] | 194 | 'change-is-navigation-open', |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 195 | (isNavigationOpen) => (this.isNavigationOpen = isNavigationOpen) |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 196 | ); |
| 197 | }, |
Yoshie Muranaka | b8b6f79 | 2019-12-03 14:47:32 -0800 | [diff] [blame] | 198 | methods: { |
Derick Montague | 71114fe | 2021-05-06 18:17:34 -0500 | [diff] [blame^] | 199 | getServerInfo() { |
| 200 | this.$store.dispatch('global/getServerStatus'); |
Derick Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame] | 201 | }, |
Yoshie Muranaka | 1ace1d9 | 2020-02-06 13:47:28 -0800 | [diff] [blame] | 202 | getEvents() { |
| 203 | this.$store.dispatch('eventLog/getEventLogData'); |
| 204 | }, |
Yoshie Muranaka | eb154bb | 2020-02-07 12:18:45 -0800 | [diff] [blame] | 205 | refresh() { |
| 206 | this.$emit('refresh'); |
| 207 | }, |
Derick Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame] | 208 | logout() { |
Derick Montague | c031b69 | 2020-02-12 15:55:42 -0600 | [diff] [blame] | 209 | this.$store.dispatch('authentication/logout'); |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 210 | }, |
| 211 | toggleNavigation() { |
Sukanya Pandey | edb8a77 | 2020-10-29 11:33:42 +0530 | [diff] [blame] | 212 | this.$root.$emit('toggle-navigation'); |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 213 | }, |
Derick Montague | 8026797 | 2021-02-16 09:47:03 -0600 | [diff] [blame] | 214 | setFocus(event) { |
| 215 | event.preventDefault(); |
| 216 | this.$root.$emit('skip-navigation'); |
| 217 | }, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 218 | }, |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 219 | }; |
| 220 | </script> |
| 221 | |
Sukanya Pandey | b1f559f | 2020-04-28 20:18:28 +0530 | [diff] [blame] | 222 | <style lang="scss"> |
Derick Montague | 7d4b53b | 2020-10-26 12:14:16 -0500 | [diff] [blame] | 223 | @mixin focus-box-shadow($padding-color: $navbar-color, $outline-color: $white) { |
| 224 | box-shadow: inset 0 0 0 3px $padding-color, inset 0 0 0 5px $outline-color; |
| 225 | } |
Sukanya Pandey | b1f559f | 2020-04-28 20:18:28 +0530 | [diff] [blame] | 226 | .app-header { |
| 227 | .link-skip-nav { |
| 228 | position: absolute; |
| 229 | top: -60px; |
| 230 | left: 0.5rem; |
| 231 | z-index: $zindex-popover; |
| 232 | transition: $duration--moderate-01 $exit-easing--expressive; |
| 233 | &:focus { |
| 234 | top: 0.5rem; |
| 235 | transition-timing-function: $entrance-easing--expressive; |
| 236 | } |
Derick Montague | 75b4832 | 2019-12-06 01:24:41 -0600 | [diff] [blame] | 237 | } |
SurenNeware | 1f8117f | 2020-09-22 19:28:56 +0530 | [diff] [blame] | 238 | .navbar-text, |
| 239 | .nav-link, |
| 240 | .btn-link { |
| 241 | color: color('white') !important; |
| 242 | fill: currentColor; |
| 243 | padding: 0.68rem 1rem !important; |
| 244 | |
| 245 | &:hover { |
| 246 | background-color: theme-color-level(light, 10); |
| 247 | } |
| 248 | &:active { |
| 249 | background-color: theme-color-level(light, 9); |
| 250 | } |
| 251 | &:focus { |
Derick Montague | 7d4b53b | 2020-10-26 12:14:16 -0500 | [diff] [blame] | 252 | @include focus-box-shadow; |
| 253 | outline: 0; |
Sukanya Pandey | b1f559f | 2020-04-28 20:18:28 +0530 | [diff] [blame] | 254 | } |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 255 | } |
| 256 | |
Sukanya Pandey | b1f559f | 2020-04-28 20:18:28 +0530 | [diff] [blame] | 257 | .nav-item { |
Yoshie Muranaka | 01da818 | 2020-07-08 15:46:43 -0700 | [diff] [blame] | 258 | fill: theme-color('light'); |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 259 | } |
| 260 | |
Sukanya Pandey | b1f559f | 2020-04-28 20:18:28 +0530 | [diff] [blame] | 261 | .navbar { |
| 262 | padding: 0; |
Mateusz Gapski | 21d6de0 | 2020-07-29 14:28:23 +0200 | [diff] [blame] | 263 | background-color: $navbar-color; |
SurenNeware | 057232b | 2020-06-08 20:53:26 +0530 | [diff] [blame] | 264 | @include media-breakpoint-up($responsive-layout-bp) { |
| 265 | height: $header-height; |
| 266 | } |
Sukanya Pandey | b1f559f | 2020-04-28 20:18:28 +0530 | [diff] [blame] | 267 | |
SurenNeware | 057232b | 2020-06-08 20:53:26 +0530 | [diff] [blame] | 268 | .helper-menu { |
| 269 | @include media-breakpoint-down(sm) { |
Yoshie Muranaka | 01da818 | 2020-07-08 15:46:43 -0700 | [diff] [blame] | 270 | background-color: gray('800'); |
SurenNeware | 057232b | 2020-06-08 20:53:26 +0530 | [diff] [blame] | 271 | width: 100%; |
| 272 | justify-content: flex-end; |
| 273 | |
| 274 | .nav-link, |
| 275 | .btn { |
| 276 | padding: $spacer / 1.125 $spacer / 2; |
| 277 | } |
Derick Montague | 7d4b53b | 2020-10-26 12:14:16 -0500 | [diff] [blame] | 278 | |
| 279 | .nav-link:focus, |
| 280 | .btn:focus { |
| 281 | @include focus-box-shadow($gray-800); |
| 282 | } |
SurenNeware | 057232b | 2020-06-08 20:53:26 +0530 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | .responsive-text { |
| 286 | @include media-breakpoint-down(xs) { |
| 287 | display: none; |
| 288 | } |
| 289 | } |
| 290 | } |
Sukanya Pandey | b1f559f | 2020-04-28 20:18:28 +0530 | [diff] [blame] | 291 | } |
| 292 | |
| 293 | .navbar-nav { |
| 294 | padding: 0 $spacer; |
SurenNeware | 1f8117f | 2020-09-22 19:28:56 +0530 | [diff] [blame] | 295 | align-items: center; |
| 296 | |
| 297 | .navbar-brand, |
| 298 | .nav-link { |
| 299 | transition: $focus-transition; |
| 300 | } |
Sukanya Pandey | c5c2ae9 | 2020-12-09 16:14:19 +0530 | [diff] [blame] | 301 | .asset-tag { |
| 302 | color: theme-color-level(light, 3); |
| 303 | } |
Sukanya Pandey | b1f559f | 2020-04-28 20:18:28 +0530 | [diff] [blame] | 304 | } |
| 305 | |
| 306 | .nav-trigger { |
Yoshie Muranaka | 01da818 | 2020-07-08 15:46:43 -0700 | [diff] [blame] | 307 | fill: theme-color('light'); |
Sukanya Pandey | b1f559f | 2020-04-28 20:18:28 +0530 | [diff] [blame] | 308 | width: $header-height; |
| 309 | height: $header-height; |
| 310 | transition: none; |
SurenNeware | 1f8117f | 2020-09-22 19:28:56 +0530 | [diff] [blame] | 311 | display: inline-flex; |
| 312 | flex: 0 0 20px; |
| 313 | align-items: center; |
Sukanya Pandey | b1f559f | 2020-04-28 20:18:28 +0530 | [diff] [blame] | 314 | |
| 315 | svg { |
| 316 | margin: 0; |
| 317 | } |
| 318 | |
| 319 | &:hover { |
Yoshie Muranaka | 01da818 | 2020-07-08 15:46:43 -0700 | [diff] [blame] | 320 | fill: theme-color('light'); |
SurenNeware | 1f8117f | 2020-09-22 19:28:56 +0530 | [diff] [blame] | 321 | background-color: theme-color-level(light, 10); |
Sukanya Pandey | b1f559f | 2020-04-28 20:18:28 +0530 | [diff] [blame] | 322 | } |
| 323 | |
SurenNeware | 057232b | 2020-06-08 20:53:26 +0530 | [diff] [blame] | 324 | &.open { |
Yoshie Muranaka | 01da818 | 2020-07-08 15:46:43 -0700 | [diff] [blame] | 325 | background-color: gray('800'); |
SurenNeware | 057232b | 2020-06-08 20:53:26 +0530 | [diff] [blame] | 326 | } |
| 327 | |
Sukanya Pandey | b1f559f | 2020-04-28 20:18:28 +0530 | [diff] [blame] | 328 | @include media-breakpoint-up($responsive-layout-bp) { |
| 329 | display: none; |
| 330 | } |
| 331 | } |
| 332 | |
SurenNeware | 1f8117f | 2020-09-22 19:28:56 +0530 | [diff] [blame] | 333 | .dropdown-menu { |
| 334 | margin-top: 0; |
| 335 | |
| 336 | @include media-breakpoint-only(md) { |
| 337 | margin-top: 4px; |
SurenNeware | 057232b | 2020-06-08 20:53:26 +0530 | [diff] [blame] | 338 | } |
| 339 | } |
| 340 | |
| 341 | .navbar-expand { |
| 342 | @include media-breakpoint-down(sm) { |
| 343 | flex-flow: wrap; |
Sukanya Pandey | b1f559f | 2020-04-28 20:18:28 +0530 | [diff] [blame] | 344 | } |
Yoshie Muranaka | dc04feb | 2019-12-04 08:41:22 -0800 | [diff] [blame] | 345 | } |
| 346 | } |
SurenNeware | 1f8117f | 2020-09-22 19:28:56 +0530 | [diff] [blame] | 347 | |
| 348 | .navbar-brand { |
| 349 | padding: $spacer/2; |
| 350 | height: $header-height; |
| 351 | line-height: 1; |
| 352 | &:focus { |
| 353 | box-shadow: inset 0 0 0 3px $navbar-color, inset 0 0 0 5px color('white'); |
| 354 | outline: 0; |
| 355 | } |
| 356 | } |
Yoshie Muranaka | b8b6f79 | 2019-12-03 14:47:32 -0800 | [diff] [blame] | 357 | </style> |