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