Commit 8b56123646
Unsigned
Layout: unified · split
docs/.vitepress/theme/components/BookmarksPanel.vue +17 −19
| @@ -1,6 +1,6 @@ | |||
| 1 | <script setup lang="ts"> | 1 | <script setup lang="ts"> |
| 2 | import { onClickOutside, useEventListener } from '@vueuse/core' | 2 | import { onClickOutside, useEventListener } from '@vueuse/core' |
| 3 | import { Bookmark, Hash, X } from 'lucide-vue-next' | 3 | import { ArrowLeft, Bookmark, Hash } from 'lucide-vue-next' |
| 4 | import { inBrowser } from 'vitepress' | 4 | import { inBrowser } from 'vitepress' |
| 5 | import type { DefaultTheme } from 'vitepress/theme' | 5 | import type { DefaultTheme } from 'vitepress/theme' |
| 6 | import { computed, nextTick, ref, watch } from 'vue' | 6 | import { computed, nextTick, ref, watch } from 'vue' |
| @@ -180,10 +180,10 @@ const grouped = computed((): GroupEntry[] => { | |||
| 180 | <Transition name="bookmarks-panel"> | 180 | <Transition name="bookmarks-panel"> |
| 181 | <div v-if="isOpen" ref="panelRef" class="bookmarks-panel" :style="panelStyle" role="dialog" aria-label="Bookmarks"> | 181 | <div v-if="isOpen" ref="panelRef" class="bookmarks-panel" :style="panelStyle" role="dialog" aria-label="Bookmarks"> |
| 182 | <div class="bookmarks-mobile-header"> | 182 | <div class="bookmarks-mobile-header"> |
| 183 | <span class="bookmarks-mobile-title">Bookmarks</span> | 183 | <button type="button" class="bookmarks-mobile-back" aria-label="Back" @click="isOpen = false"> |
| 184 | <button type="button" class="bookmarks-mobile-close" aria-label="Close" @click="isOpen = false"> | 184 | <ArrowLeft :size="18" :stroke-width="2" /> |
| 185 | <X :size="18" :stroke-width="2" /> | ||
| 186 | </button> | 185 | </button> |
| 186 | <span class="bookmarks-mobile-title">Bookmarks</span> | ||
| 187 | </div> | 187 | </div> |
| 188 | <div | 188 | <div |
| 189 | ref="scrollRef" | 189 | ref="scrollRef" |
| @@ -285,7 +285,8 @@ const grouped = computed((): GroupEntry[] => { | |||
| 285 | z-index: 100; | 285 | z-index: 100; |
| 286 | width: 282px; | 286 | width: 282px; |
| 287 | max-width: calc(100vw - 24px); | 287 | 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); | ||
| 289 | border: 1px solid var(--vp-c-divider); | 290 | border: 1px solid var(--vp-c-divider); |
| 290 | border-radius: 12px; | 291 | border-radius: 12px; |
| 291 | box-shadow: var(--vp-shadow-3); | 292 | box-shadow: var(--vp-shadow-3); |
| @@ -319,7 +320,7 @@ const grouped = computed((): GroupEntry[] => { | |||
| 319 | background: linear-gradient( | 320 | background: linear-gradient( |
| 320 | to bottom, | 321 | to bottom, |
| 321 | transparent, | 322 | transparent, |
| 322 | var(--vp-c-bg-elv) | 323 | var(--bm-panel-bg) |
| 323 | ); | 324 | ); |
| 324 | border-radius: 0 0 12px 12px; | 325 | border-radius: 0 0 12px 12px; |
| 325 | } | 326 | } |
| @@ -524,6 +525,7 @@ const grouped = computed((): GroupEntry[] => { | |||
| 524 | transform-origin: center top; | 525 | transform-origin: center top; |
| 525 | display: flex; | 526 | display: flex; |
| 526 | flex-direction: column; | 527 | flex-direction: column; |
| 528 | --bm-panel-bg: var(--vp-c-bg); | ||
| 527 | } | 529 | } |
| 528 | 530 | ||
| 529 | .bookmarks-scroll { | 531 | .bookmarks-scroll { |
| @@ -542,11 +544,10 @@ const grouped = computed((): GroupEntry[] => { | |||
| 542 | .bookmarks-mobile-header { | 544 | .bookmarks-mobile-header { |
| 543 | display: flex; | 545 | display: flex; |
| 544 | align-items: center; | 546 | align-items: center; |
| 545 | justify-content: space-between; | 547 | height: 49px; |
| 546 | height: 56px; | ||
| 547 | flex-shrink: 0; | 548 | flex-shrink: 0; |
| 548 | padding: 0 20px; | 549 | padding: 6px 8px; |
| 549 | border-bottom: 1px solid var(--vp-c-divider); | 550 | border-bottom: 1px solid var(--wk-fs-header-divider); |
| 550 | } | 551 | } |
| 551 | 552 | ||
| 552 | .bookmarks-mobile-title { | 553 | .bookmarks-mobile-title { |
| @@ -555,23 +556,20 @@ const grouped = computed((): GroupEntry[] => { | |||
| 555 | color: var(--vp-c-text-1); | 556 | color: var(--vp-c-text-1); |
| 556 | } | 557 | } |
| 557 | 558 | ||
| 558 | .bookmarks-mobile-close { | 559 | .bookmarks-mobile-back { |
| 559 | display: flex; | 560 | display: flex; |
| 560 | align-items: center; | 561 | align-items: center; |
| 561 | justify-content: center; | 562 | justify-content: center; |
| 562 | width: 32px; | 563 | padding: 8px; |
| 563 | height: 32px; | ||
| 564 | border-radius: 8px; | ||
| 565 | border: none; | 564 | border: none; |
| 566 | background: transparent; | 565 | background: transparent; |
| 567 | color: var(--vp-c-text-2); | 566 | color: var(--vp-c-text-1); |
| 568 | cursor: pointer; | 567 | cursor: pointer; |
| 569 | transition: background-color 0.15s, color 0.15s; | 568 | transition: color 0.15s; |
| 570 | } | 569 | } |
| 571 | 570 | ||
| 572 | .bookmarks-mobile-close:hover { | 571 | .bookmarks-mobile-back:hover { |
| 573 | background: var(--vp-c-default-soft); | 572 | color: var(--vp-c-brand-1); |
| 574 | color: var(--vp-c-text-1); | ||
| 575 | } | 573 | } |
| 576 | 574 | ||
| 577 | .bookmarks-panel-enter-from, | 575 | .bookmarks-panel-enter-from, |
docs/.vitepress/theme/components/HomeFeatures.vue +40
| @@ -1,4 +1,5 @@ | |||
| 1 | <script setup lang="ts"> | 1 | <script setup lang="ts"> |
| 2 | import { ArrowLeft } from 'lucide-vue-next' | ||
| 2 | import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue' | 3 | import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue' |
| 3 | import type { HomeCard } from '../../configs/constants' | 4 | import type { HomeCard } from '../../configs/constants' |
| 4 | 5 | ||
| @@ -293,6 +294,9 @@ function onHandlePointerUp() { | |||
| 293 | <Transition name="slide-up" appear> | 294 | <Transition name="slide-up" appear> |
| 294 | <div v-if="panelOpen" class="panel" role="dialog" aria-modal="true" aria-label="Customize cards"> | 295 | <div v-if="panelOpen" class="panel" role="dialog" aria-modal="true" aria-label="Customize cards"> |
| 295 | <div class="panel-head"> | 296 | <div class="panel-head"> |
| 297 | <button class="panel-back" aria-label="Back" @click="panelOpen = false"> | ||
| 298 | <ArrowLeft :size="18" :stroke-width="2" /> | ||
| 299 | </button> | ||
| 296 | <span class="panel-title">Customize Cards</span> | 300 | <span class="panel-title">Customize Cards</span> |
| 297 | <button class="close-btn" aria-label="Close" @click="panelOpen = false"> | 301 | <button class="close-btn" aria-label="Close" @click="panelOpen = false"> |
| 298 | <span class="i-lucide-x" /> | 302 | <span class="i-lucide-x" /> |
| @@ -748,6 +752,24 @@ function onHandlePointerUp() { | |||
| 748 | color: var(--vp-c-text-1); | 752 | color: var(--vp-c-text-1); |
| 749 | } | 753 | } |
| 750 | 754 | ||
| 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 | |||
| 751 | .close-btn { | 773 | .close-btn { |
| 752 | position: relative; | 774 | position: relative; |
| 753 | display: flex; | 775 | display: flex; |
| @@ -796,6 +818,24 @@ function onHandlePointerUp() { | |||
| 796 | } | 818 | } |
| 797 | } | 819 | } |
| 798 | 820 | ||
| 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 | |||
| 799 | /* ── Card List ── */ | 839 | /* ── Card List ── */ |
| 800 | .card-sections { | 840 | .card-sections { |
| 801 | overflow-y: auto; | 841 | overflow-y: auto; |
docs/.vitepress/theme/components/NavActions.vue +4 −6
| @@ -7,8 +7,10 @@ import { inject } from 'vue' | |||
| 7 | 7 | ||
| 8 | import { navActions } from '../navActions' | 8 | import { navActions } from '../navActions' |
| 9 | import { openSearch } from '../searchState' | 9 | import { openSearch } from '../searchState' |
| 10 | import { openSettings } from '../settingsState' | ||
| 10 | import NolebaseEnhancedReadabilitiesMenu from './settings/Menu.vue' | 11 | import NolebaseEnhancedReadabilitiesMenu from './settings/Menu.vue' |
| 11 | import BookmarksPanel from './BookmarksPanel.vue' | 12 | import BookmarksPanel from './BookmarksPanel.vue' |
| 13 | import SettingsPanel from './SettingsPanel.vue' | ||
| 12 | 14 | ||
| 13 | const ICON_SIZE = 18 | 15 | const ICON_SIZE = 18 |
| 14 | const ICON_STROKE = 2 | 16 | const ICON_STROKE = 2 |
| @@ -17,11 +19,6 @@ const { isDark } = useData() | |||
| 17 | const toggleAppearance = inject<() => void>('toggle-appearance', () => { | 19 | const toggleAppearance = inject<() => void>('toggle-appearance', () => { |
| 18 | isDark.value = !isDark.value | 20 | isDark.value = !isDark.value |
| 19 | }) | 21 | }) |
| 20 | |||
| 21 | // Opens the full-screen nav menu (the flyout's phone equivalent). | ||
| 22 | function openScreenMenu() { | ||
| 23 | document.querySelector<HTMLElement>('.VPNavBarHamburger')?.click() | ||
| 24 | } | ||
| 25 | </script> | 22 | </script> |
| 26 | 23 | ||
| 27 | <template> | 24 | <template> |
| @@ -65,7 +62,7 @@ function openScreenMenu() { | |||
| 65 | type="button" | 62 | type="button" |
| 66 | class="nav-action-btn nav-settings-mobile" | 63 | class="nav-action-btn nav-settings-mobile" |
| 67 | aria-label="Settings" | 64 | aria-label="Settings" |
| 68 | @click="openScreenMenu()" | 65 | @click="openSettings()" |
| 69 | > | 66 | > |
| 70 | <Settings :size="ICON_SIZE" :stroke-width="ICON_STROKE" /> | 67 | <Settings :size="ICON_SIZE" :stroke-width="ICON_STROKE" /> |
| 71 | </button> | 68 | </button> |
| @@ -74,6 +71,7 @@ function openScreenMenu() { | |||
| 74 | </div> | 71 | </div> |
| 75 | </template> | 72 | </template> |
| 76 | </div> | 73 | </div> |
| 74 | <SettingsPanel /> | ||
| 77 | </div> | 75 | </div> |
| 78 | </template> | 76 | </template> |
| 79 | 77 | ||
docs/.vitepress/theme/components/SettingsPanel.vue added +107
| @@ -0,0 +1,107 @@ | |||
| 1 | <script setup lang="ts"> | ||
| 2 | import { ArrowLeft } from 'lucide-vue-next' | ||
| 3 | import { settingsOpen } from '../settingsState' | ||
| 4 | import { 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( | |||
| 114 | border="1 solid $vp-c-divider" | 114 | border="1 solid $vp-c-divider" |
| 115 | pointer-events-none | 115 | pointer-events-none |
| 116 | fixed | 116 | fixed |
| 117 | z-100 | 117 | z-10000 |
| 118 | rounded-xl | 118 | rounded-xl |
| 119 | p-4 | 119 | p-4 |
| 120 | shadow-xl | 120 | shadow-xl |
docs/.vitepress/theme/settingsState.ts added +7
| @@ -0,0 +1,7 @@ | |||
| 1 | import { ref } from 'vue' | ||
| 2 | |||
| 3 | export const settingsOpen = ref(false) | ||
| 4 | |||
| 5 | export 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); | |||
| 20 | --vp-c-text-1: #1b1b1f; | 20 | --vp-c-text-1: #1b1b1f; |
| 21 | --vp-c-text-2: #2f3033; | 21 | --vp-c-text-2: #2f3033; |
| 22 | --vp-c-text-3: #46464a; | 22 | --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); | ||
| 23 | } | 25 | } |
| 24 | 26 | ||
| 25 | .dark { | 27 | .dark { |
| @@ -33,6 +35,7 @@ $ease-in-expo: cubic-bezier(0.7, 0, 0.84, 0); | |||
| 33 | --vp-c-text-1: #e3e2e6; | 35 | --vp-c-text-1: #e3e2e6; |
| 34 | --vp-c-text-2: #ababaf; | 36 | --vp-c-text-2: #ababaf; |
| 35 | --vp-c-text-3: #919094; | 37 | --vp-c-text-3: #919094; |
| 38 | --wk-fs-header-divider: rgba(82, 82, 82, 0.65); | ||
| 36 | } | 39 | } |
| 37 | 40 | ||
| 38 | :root { | 41 | :root { |
| @@ -1355,7 +1358,8 @@ table tr:nth-child(odd) { | |||
| 1355 | @apply hidden!; | 1358 | @apply hidden!; |
| 1356 | } | 1359 | } |
| 1357 | 1360 | ||
| 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. | ||
| 1359 | .VPNavBarHamburger { | 1363 | .VPNavBarHamburger { |
| 1360 | display: none !important; | 1364 | display: none !important; |
| 1361 | } | 1365 | } |