Commit 8b56123646

8b56123646fddcd84f5a81d2227bf5d5b38b9ed7

parent: 8f267fde16

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-07-07 09:35 UTC

nav

Layout: unified · split

docs/.vitepress/theme/components/BookmarksPanel.vue +17 −19
@@ -1,6 +1,6 @@
11<script setup lang="ts">
22import { onClickOutside, useEventListener } from '@vueuse/core'
3import { Bookmark, Hash, X } from 'lucide-vue-next'
3import { ArrowLeft, Bookmark, Hash } from 'lucide-vue-next'
44import { inBrowser } from 'vitepress'
55import type { DefaultTheme } from 'vitepress/theme'
66import { computed, nextTick, ref, watch } from 'vue'
@@ -180,10 +180,10 @@ const grouped = computed((): GroupEntry[] => {
180180 <Transition name="bookmarks-panel">
181181 <div v-if="isOpen" ref="panelRef" class="bookmarks-panel" :style="panelStyle" role="dialog" aria-label="Bookmarks">
182182 <div class="bookmarks-mobile-header">
183 <span class="bookmarks-mobile-title">Bookmarks</span>
184 <button type="button" class="bookmarks-mobile-close" aria-label="Close" @click="isOpen = false">
185 <X :size="18" :stroke-width="2" />
183 <button type="button" class="bookmarks-mobile-back" aria-label="Back" @click="isOpen = false">
184 <ArrowLeft :size="18" :stroke-width="2" />
186185 </button>
186 <span class="bookmarks-mobile-title">Bookmarks</span>
187187 </div>
188188 <div
189189 ref="scrollRef"
@@ -285,7 +285,8 @@ const grouped = computed((): GroupEntry[] => {
285285 z-index: 100;
286286 width: 282px;
287287 max-width: calc(100vw - 24px);
288 background-color: var(--vp-c-bg-elv);
288 --bm-panel-bg: var(--vp-c-bg-elv);
289 background-color: var(--bm-panel-bg);
289290 border: 1px solid var(--vp-c-divider);
290291 border-radius: 12px;
291292 box-shadow: var(--vp-shadow-3);
@@ -319,7 +320,7 @@ const grouped = computed((): GroupEntry[] => {
319320 background: linear-gradient(
320321 to bottom,
321322 transparent,
322 var(--vp-c-bg-elv)
323 var(--bm-panel-bg)
323324 );
324325 border-radius: 0 0 12px 12px;
325326}
@@ -524,6 +525,7 @@ const grouped = computed((): GroupEntry[] => {
524525 transform-origin: center top;
525526 display: flex;
526527 flex-direction: column;
528 --bm-panel-bg: var(--vp-c-bg);
527529 }
528530
529531 .bookmarks-scroll {
@@ -542,11 +544,10 @@ const grouped = computed((): GroupEntry[] => {
542544 .bookmarks-mobile-header {
543545 display: flex;
544546 align-items: center;
545 justify-content: space-between;
546 height: 56px;
547 height: 49px;
547548 flex-shrink: 0;
548 padding: 0 20px;
549 border-bottom: 1px solid var(--vp-c-divider);
549 padding: 6px 8px;
550 border-bottom: 1px solid var(--wk-fs-header-divider);
550551 }
551552
552553 .bookmarks-mobile-title {
@@ -555,23 +556,20 @@ const grouped = computed((): GroupEntry[] => {
555556 color: var(--vp-c-text-1);
556557 }
557558
558 .bookmarks-mobile-close {
559 .bookmarks-mobile-back {
559560 display: flex;
560561 align-items: center;
561562 justify-content: center;
562 width: 32px;
563 height: 32px;
564 border-radius: 8px;
563 padding: 8px;
565564 border: none;
566565 background: transparent;
567 color: var(--vp-c-text-2);
566 color: var(--vp-c-text-1);
568567 cursor: pointer;
569 transition: background-color 0.15s, color 0.15s;
568 transition: color 0.15s;
570569 }
571570
572 .bookmarks-mobile-close:hover {
573 background: var(--vp-c-default-soft);
574 color: var(--vp-c-text-1);
571 .bookmarks-mobile-back:hover {
572 color: var(--vp-c-brand-1);
575573 }
576574
577575 .bookmarks-panel-enter-from,
docs/.vitepress/theme/components/HomeFeatures.vue +40
@@ -1,4 +1,5 @@
11<script setup lang="ts">
2import { ArrowLeft } from 'lucide-vue-next'
23import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
34import type { HomeCard } from '../../configs/constants'
45
@@ -293,6 +294,9 @@ function onHandlePointerUp() {
293294 <Transition name="slide-up" appear>
294295 <div v-if="panelOpen" class="panel" role="dialog" aria-modal="true" aria-label="Customize cards">
295296 <div class="panel-head">
297 <button class="panel-back" aria-label="Back" @click="panelOpen = false">
298 <ArrowLeft :size="18" :stroke-width="2" />
299 </button>
296300 <span class="panel-title">Customize Cards</span>
297301 <button class="close-btn" aria-label="Close" @click="panelOpen = false">
298302 <span class="i-lucide-x" />
@@ -748,6 +752,24 @@ function onHandlePointerUp() {
748752 color: var(--vp-c-text-1);
749753}
750754
755/* Phone-only back button. */
756.panel-back {
757 display: none;
758 align-items: center;
759 justify-content: center;
760 padding: 8px;
761 border: none;
762 background: transparent;
763 color: var(--vp-c-text-1);
764 font-size: 18px;
765 cursor: pointer;
766 transition: color 0.15s;
767}
768
769.panel-back:hover {
770 color: var(--vp-c-brand-1);
771}
772
751773.close-btn {
752774 position: relative;
753775 display: flex;
@@ -796,6 +818,24 @@ function onHandlePointerUp() {
796818 }
797819}
798820
821/* Phone: full-screen header (back arrow, no X). */
822@media (max-width: 767px) {
823 .panel-head {
824 height: 49px;
825 padding: 6px 8px;
826 justify-content: flex-start;
827 border-bottom-color: var(--wk-fs-header-divider);
828 }
829
830 .panel-back {
831 display: flex;
832 }
833
834 .close-btn {
835 display: none;
836 }
837}
838
799839/* ── Card List ── */
800840.card-sections {
801841 overflow-y: auto;
docs/.vitepress/theme/components/NavActions.vue +4 −6
@@ -7,8 +7,10 @@ import { inject } from 'vue'
77
88import { navActions } from '../navActions'
99import { openSearch } from '../searchState'
10import { openSettings } from '../settingsState'
1011import NolebaseEnhancedReadabilitiesMenu from './settings/Menu.vue'
1112import BookmarksPanel from './BookmarksPanel.vue'
13import SettingsPanel from './SettingsPanel.vue'
1214
1315const ICON_SIZE = 18
1416const ICON_STROKE = 2
@@ -17,11 +19,6 @@ const { isDark } = useData()
1719const toggleAppearance = inject<() => void>('toggle-appearance', () => {
1820 isDark.value = !isDark.value
1921})
20
21// Opens the full-screen nav menu (the flyout's phone equivalent).
22function openScreenMenu() {
23 document.querySelector<HTMLElement>('.VPNavBarHamburger')?.click()
24}
2522</script>
2623
2724<template>
@@ -65,7 +62,7 @@ function openScreenMenu() {
6562 type="button"
6663 class="nav-action-btn nav-settings-mobile"
6764 aria-label="Settings"
68 @click="openScreenMenu()"
65 @click="openSettings()"
6966 >
7067 <Settings :size="ICON_SIZE" :stroke-width="ICON_STROKE" />
7168 </button>
@@ -74,6 +71,7 @@ function openScreenMenu() {
7471 </div>
7572 </template>
7673 </div>
74 <SettingsPanel />
7775 </div>
7876</template>
7977
docs/.vitepress/theme/components/SettingsPanel.vue added +107
@@ -0,0 +1,107 @@
1<script setup lang="ts">
2import { ArrowLeft } from 'lucide-vue-next'
3import { settingsOpen } from '../settingsState'
4import { NolebaseEnhancedReadabilitiesScreenMenu } from './settings'
5</script>
6
7<template>
8 <Teleport to="body">
9 <Transition name="settings-panel">
10 <div
11 v-if="settingsOpen"
12 class="settings-panel"
13 role="dialog"
14 aria-label="Settings"
15 >
16 <div class="settings-header">
17 <button
18 type="button"
19 class="settings-back"
20 aria-label="Back"
21 @click="settingsOpen = false"
22 >
23 <ArrowLeft :size="18" :stroke-width="2" />
24 </button>
25 <span class="settings-title">Settings</span>
26 </div>
27 <div class="settings-body">
28 <NolebaseEnhancedReadabilitiesScreenMenu />
29 </div>
30 </div>
31 </Transition>
32 </Teleport>
33</template>
34
35<style scoped>
36.settings-panel {
37 position: fixed;
38 inset: 0;
39 z-index: 9999;
40 display: flex;
41 flex-direction: column;
42 background-color: var(--vp-c-bg);
43}
44
45.settings-header {
46 display: flex;
47 align-items: center;
48 height: 49px;
49 flex-shrink: 0;
50 padding: 6px 8px;
51 border-bottom: 1px solid var(--wk-fs-header-divider);
52}
53
54.settings-back {
55 display: flex;
56 align-items: center;
57 justify-content: center;
58 padding: 8px;
59 border: none;
60 background: transparent;
61 color: var(--vp-c-text-1);
62 cursor: pointer;
63 transition: color 0.15s;
64}
65
66.settings-back:hover {
67 color: var(--vp-c-brand-1);
68}
69
70.settings-title {
71 font-size: 16px;
72 font-weight: 600;
73 color: var(--vp-c-text-1);
74}
75
76.settings-body {
77 flex: 1;
78 min-height: 0;
79 overflow-y: auto;
80 overscroll-behavior: contain;
81 padding: 20px;
82}
83
84/* Centered column, matching the old nav-screen settings layout (288px). */
85.settings-body :deep(.VPNolebaseEnhancedReadabilitiesMenu) {
86 max-width: 288px;
87 margin-inline: auto;
88}
89
90/* Only ever opened from the phone gear; never show on desktop. */
91@media (min-width: 768px) {
92 .settings-panel {
93 display: none;
94 }
95}
96
97.settings-panel-enter-active,
98.settings-panel-leave-active {
99 transition: opacity 0.2s, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
100}
101
102.settings-panel-enter-from,
103.settings-panel-leave-to {
104 opacity: 0;
105 transform: translateY(8px);
106}
107</style>
docs/.vitepress/theme/components/settings/MenuHelp.vue +1 −1
@@ -114,7 +114,7 @@ watch(
114114 border="1 solid $vp-c-divider"
115115 pointer-events-none
116116 fixed
117 z-100
117 z-10000
118118 rounded-xl
119119 p-4
120120 shadow-xl
docs/.vitepress/theme/settingsState.ts added +7
@@ -0,0 +1,7 @@
1import { ref } from 'vue'
2
3export const settingsOpen = ref(false)
4
5export function openSettings() {
6 settingsOpen.value = true
7}
docs/.vitepress/theme/styles/style.scss +5 −1
@@ -20,6 +20,8 @@ $ease-in-expo: cubic-bezier(0.7, 0, 0.84, 0);
2020 --vp-c-text-1: #1b1b1f;
2121 --vp-c-text-2: #2f3033;
2222 --vp-c-text-3: #46464a;
23 /* Divider under the mobile full-screen header bars. */
24 --wk-fs-header-divider: rgba(163, 163, 163, 0.25);
2325}
2426
2527.dark {
@@ -33,6 +35,7 @@ $ease-in-expo: cubic-bezier(0.7, 0, 0.84, 0);
3335 --vp-c-text-1: #e3e2e6;
3436 --vp-c-text-2: #ababaf;
3537 --vp-c-text-3: #919094;
38 --wk-fs-header-divider: rgba(82, 82, 82, 0.65);
3639}
3740
3841:root {
@@ -1355,7 +1358,8 @@ table tr:nth-child(odd) {
13551358 @apply hidden!;
13561359}
13571360
1358// Hidden but kept in the DOM; the pill's settings gear clicks it to open the menu.
1361// Nav list is empty and settings live in the pill's gear (which opens its own
1362// panel), so the hamburger is unused on phones.
13591363.VPNavBarHamburger {
13601364 display: none !important;
13611365}