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