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