| @@ -1,5 +1,5 @@ |
| 1 | <script setup lang="ts"> |
1 | <script setup lang="ts"> |
| 2 | import { Moon, Search, Sun } from 'lucide-vue-next' |
2 | import { Moon, Search, Settings, Sun } from 'lucide-vue-next' |
| 3 | import { useData } from 'vitepress' |
3 | import { useData } from 'vitepress' |
| 4 | // @ts-ignore |
4 | // @ts-ignore |
| 5 | import VPSocialLink from 'vitepress/dist/client/theme-default/components/VPSocialLink.vue' |
5 | import VPSocialLink from 'vitepress/dist/client/theme-default/components/VPSocialLink.vue' |
| @@ -17,13 +17,15 @@ const { isDark } = useData() |
| 17 | const toggleAppearance = inject<() => void>('toggle-appearance', () => { |
17 | const toggleAppearance = inject<() => void>('toggle-appearance', () => { |
| 18 | isDark.value = !isDark.value |
18 | isDark.value = !isDark.value |
| 19 | }) |
19 | }) |
| |
20 | |
| |
21 | // Opens the full-screen nav menu (the flyout's phone equivalent). |
| |
22 | function openScreenMenu() { |
| |
23 | document.querySelector<HTMLElement>('.VPNavBarHamburger')?.click() |
| |
24 | } |
| 20 | </script> |
25 | </script> |
| 21 | |
26 | |
| 22 | <template> |
27 | <template> |
| 23 | <div class="nav-actions-container"> |
28 | <div class="nav-actions-container"> |
| 24 | <div class="nav-bookmark-mobile"> |
| |
| 25 | <BookmarksPanel /> |
| |
| 26 | </div> |
| |
| 27 | <div class="nav-actions" role="group" aria-label="Site actions"> |
29 | <div class="nav-actions" role="group" aria-label="Site actions"> |
| 28 | <template v-for="(action, i) in navActions" :key="i"> |
30 | <template v-for="(action, i) in navActions" :key="i"> |
| 29 | <div class="nav-action" :class="`nav-action--${action.type}`"> |
31 | <div class="nav-action" :class="`nav-action--${action.type}`"> |
| @@ -57,7 +59,17 @@ const toggleAppearance = inject<() => void>('toggle-appearance', () => { |
| 57 | :me="false" |
59 | :me="false" |
| 58 | /> |
60 | /> |
| 59 | |
61 | |
| 60 | <NolebaseEnhancedReadabilitiesMenu v-else-if="action.type === 'settings'" /> |
62 | <template v-else-if="action.type === 'settings'"> |
| |
63 | <NolebaseEnhancedReadabilitiesMenu /> |
| |
64 | <button |
| |
65 | type="button" |
| |
66 | class="nav-action-btn nav-settings-mobile" |
| |
67 | aria-label="Settings" |
| |
68 | @click="openScreenMenu()" |
| |
69 | > |
| |
70 | <Settings :size="ICON_SIZE" :stroke-width="ICON_STROKE" /> |
| |
71 | </button> |
| |
72 | </template> |
| 61 | <BookmarksPanel v-else-if="action.type === 'bookmarks'" /> |
73 | <BookmarksPanel v-else-if="action.type === 'bookmarks'" /> |
| 62 | </div> |
74 | </div> |
| 63 | </template> |
75 | </template> |
| @@ -71,31 +83,8 @@ const toggleAppearance = inject<() => void>('toggle-appearance', () => { |
| 71 | align-items: center; |
83 | align-items: center; |
| 72 | } |
84 | } |
| 73 | |
85 | |
| 74 | .nav-bookmark-mobile { |
| |
| 75 | display: flex; |
| |
| 76 | align-items: center; |
| |
| 77 | justify-content: center; |
| |
| 78 | width: 36px; |
| |
| 79 | height: var(--vp-nav-height); |
| |
| 80 | } |
| |
| 81 | |
| |
| 82 | .nav-bookmark-mobile :deep(.bookmarks-btn) { |
| |
| 83 | color: var(--vp-c-text-2); |
| |
| 84 | opacity: 1; |
| |
| 85 | } |
| |
| 86 | |
| |
| 87 | .nav-bookmark-mobile :deep(.bookmarks-btn svg) { |
| |
| 88 | stroke-width: 1.5; |
| |
| 89 | } |
| |
| 90 | |
| |
| 91 | @media (min-width: 768px) { |
| |
| 92 | .nav-bookmark-mobile { |
| |
| 93 | display: none; |
| |
| 94 | } |
| |
| 95 | } |
| |
| 96 | |
| |
| 97 | .nav-actions { |
86 | .nav-actions { |
| 98 | display: none; |
87 | display: flex; |
| 99 | align-items: center; |
88 | align-items: center; |
| 100 | gap: var(--nav-pill-gap); |
89 | gap: var(--nav-pill-gap); |
| 101 | height: var(--nav-pill-height); |
90 | height: var(--nav-pill-height); |
| @@ -108,12 +97,6 @@ const toggleAppearance = inject<() => void>('toggle-appearance', () => { |
| 108 | transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1); |
97 | transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1); |
| 109 | } |
98 | } |
| 110 | |
99 | |
| 111 | @media (min-width: 768px) { |
| |
| 112 | .nav-actions { |
| |
| 113 | display: flex; |
| |
| 114 | } |
| |
| 115 | } |
| |
| 116 | |
| |
| 117 | .nav-action { |
100 | .nav-action { |
| 118 | flex: none; |
101 | flex: none; |
| 119 | width: var(--nav-pill-item-size); |
102 | width: var(--nav-pill-item-size); |
| @@ -123,6 +106,24 @@ const toggleAppearance = inject<() => void>('toggle-appearance', () => { |
| 123 | justify-content: center; |
106 | justify-content: center; |
| 124 | } |
107 | } |
| 125 | |
108 | |
| |
109 | /* Social links move to the full-screen menu on phones. */ |
| |
110 | .nav-action--link { |
| |
111 | display: none; |
| |
112 | } |
| |
113 | |
| |
114 | @media (min-width: 768px) { |
| |
115 | .nav-action--link { |
| |
116 | display: flex; |
| |
117 | } |
| |
118 | } |
| |
119 | |
| |
120 | /* Doubled class outranks the later `.nav-action-btn { display: flex }`. */ |
| |
121 | @media (min-width: 768px) { |
| |
122 | .nav-action-btn.nav-settings-mobile { |
| |
123 | display: none; |
| |
124 | } |
| |
125 | } |
| |
126 | |
| 126 | .nav-action-btn { |
127 | .nav-action-btn { |
| 127 | display: flex; |
128 | display: flex; |
| 128 | align-items: center; |
129 | align-items: center; |
| @@ -170,6 +171,13 @@ const toggleAppearance = inject<() => void>('toggle-appearance', () => { |
| 170 | -webkit-backdrop-filter: none !important; |
171 | -webkit-backdrop-filter: none !important; |
| 171 | } |
172 | } |
| 172 | |
173 | |
| |
174 | /* Phones use the full-screen gear instead of the flyout. */ |
| |
175 | @media (max-width: 767.9px) { |
| |
176 | .nav-action--settings :deep(.VPNolebaseEnhancedReadabilitiesMenuFlyout) { |
| |
177 | display: none !important; |
| |
178 | } |
| |
179 | } |
| |
180 | |
| 173 | .nav-action--settings :deep(.VPNolebaseEnhancedReadabilitiesMenuFlyout .button) { |
181 | .nav-action--settings :deep(.VPNolebaseEnhancedReadabilitiesMenuFlyout .button) { |
| 174 | width: 100% !important; |
182 | width: 100% !important; |
| 175 | height: 100% !important; |
183 | height: 100% !important; |