Commit 99cf79b400

99cf79b4006961fe4b81cdf30b32dd7f6be1324e

parent: e5984ab986

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-06-21 16:19 UTC

update

Layout: unified · split

docs/.vitepress/theme/Layout.vue +61 −2
@@ -34,11 +34,11 @@ import {
3434 NolebaseEnhancedReadabilitiesScreenMenu
3535} from './components/settings'
3636import SidebarCard from './components/SidebarCard.vue'
37import { LowEndDeviceModeStorageKey, TakodachiStorageKey } from './constants'
37import { AccentColorStorageKey, LowEndDeviceModeStorageKey, TakodachiStorageKey } from './constants'
3838import { v2add, v2mag, v2norm, v2smul, v2sub, type Vec2D } from './math'
3939
4040const route = useRoute()
41const { frontmatter, site, theme } = useData()
41const { frontmatter, isDark, site, theme } = useData()
4242const { Layout } = DefaultTheme
4343
4444// Home sidebar menu
@@ -572,6 +572,65 @@ watchEffect(() => {
572572 )
573573})
574574
575const accentPalettes: Record<string, Record<string, string>> = {
576 ayanami: {
577 400: 'oklch(0.722 0.105 247.48)',
578 500: 'oklch(0.626 0.098 247.46)',
579 600: 'oklch(0.523 0.081 246.86)',
580 700: 'oklch(0.43 0.066 246.75)',
581 800: 'oklch(0.335 0.052 246.76)',
582 },
583 asuka: {
584 400: '#FB7F6E',
585 500: '#F35640',
586 600: '#E2432D',
587 700: '#BD2C18',
588 800: '#9C2818',
589 },
590 rebecca: {
591 400: '#41E799',
592 500: '#18CF7A',
593 600: '#0DAC62',
594 700: '#0E874F',
595 800: '#116A42',
596 },
597 okayu: {
598 400: '#CDA4D5',
599 500: '#BC87C5',
600 600: '#A86BB2',
601 700: '#915799',
602 800: '#794A7F',
603 },
604 inanis: {
605 400: '#A39AC0',
606 500: '#8F81B0',
607 600: '#816FA1',
608 700: '#766392',
609 800: '#645479',
610 },
611}
612
613const accentColor = useStorage(AccentColorStorageKey, 'ayanami')
614
615watchEffect(() => {
616 if (import.meta.env.SSR) return
617 const shades = accentPalettes[accentColor.value] ?? accentPalettes.ayanami
618 const el = document.documentElement
619 if (isDark.value) {
620 el.style.setProperty('--vp-c-brand-1', shades['400'])
621 el.style.setProperty('--vp-c-brand-2', shades['500'])
622 el.style.setProperty('--vp-c-brand-3', shades['700'])
623 el.style.setProperty('--vp-c-brand-soft', `color-mix(in srgb, ${shades['500']} 20%, transparent)`)
624 el.style.setProperty('--vp-c-sidebar-active', `color-mix(in srgb, ${shades['500']} 15%, transparent)`)
625 } else {
626 el.style.setProperty('--vp-c-brand-1', shades['500'])
627 el.style.setProperty('--vp-c-brand-2', shades['600'])
628 el.style.setProperty('--vp-c-brand-3', shades['800'])
629 el.style.setProperty('--vp-c-brand-soft', `color-mix(in srgb, ${shades['400']} 40%, transparent)`)
630 el.style.setProperty('--vp-c-sidebar-active', `color-mix(in srgb, ${shades['800']} 15%, transparent)`)
631 }
632})
633
575634const speed = 2
576635const snapThreshold = 5 // px
577636
docs/.vitepress/theme/components/Search.vue +8 −8
@@ -2475,9 +2475,9 @@ function onMouseMove(e: MouseEvent) {
24752475}
24762476
24772477.page-pill.active {
2478 color: #6ab0f5;
2479 border: 1.5px solid #6ab0f5;
2480 background: rgba(60, 120, 210, 0.12);
2478 color: var(--vp-c-brand-1);
2479 border: 1.5px solid var(--vp-c-brand-1);
2480 background: color-mix(in srgb, var(--vp-c-brand-1) 12%, transparent);
24812481 box-shadow: none;
24822482}
24832483
@@ -2497,7 +2497,7 @@ function onMouseMove(e: MouseEvent) {
24972497}
24982498
24992499.page-pill.active .page-pill-count {
2500 background: rgba(100, 160, 240, 0.18);
2500 background: color-mix(in srgb, var(--vp-c-brand-1) 18%, transparent);
25012501}
25022502
25032503@media (max-width: 767px) {
@@ -2872,7 +2872,7 @@ svg {
28722872
28732873.exact-match-button.exact-match-active {
28742874 color: var(--vp-c-brand-1);
2875 background-color: rgba(var(--vp-c-brand-1), 0.1);
2875 background-color: color-mix(in srgb, var(--vp-c-brand-1) 10%, transparent);
28762876 border-radius: 4px;
28772877}
28782878
@@ -2921,7 +2921,7 @@ svg {
29212921
29222922.mode-btn.mode-active {
29232923 color: var(--vp-c-brand-1);
2924 background: rgba(60, 120, 210, 0.10);
2924 background: color-mix(in srgb, var(--vp-c-brand-1) 10%, transparent);
29252925}
29262926
29272927:deep(.url-highlight) {
@@ -2984,7 +2984,7 @@ svg {
29842984
29852985.url-page-btn.active {
29862986 color: var(--vp-c-brand-1);
2987 background: rgba(60, 120, 210, 0.10);
2987 background: color-mix(in srgb, var(--vp-c-brand-1) 10%, transparent);
29882988 font-weight: 500;
29892989 cursor: default;
29902990}
@@ -3090,7 +3090,7 @@ svg {
30903090
30913091.settings-option.active {
30923092 color: var(--vp-c-brand-1);
3093 background: rgba(60, 120, 210, 0.1);
3093 background: color-mix(in srgb, var(--vp-c-brand-1) 10%, transparent);
30943094}
30953095
30963096.settings-popup-enter-active,
docs/.vitepress/theme/components/settings/AccentColor.vue added +79
@@ -0,0 +1,79 @@
1<script setup lang="ts">
2import { useStorage } from '@vueuse/core'
3
4import { AccentColorStorageKey } from '../../constants'
5import MenuTitle from './MenuTitle.vue'
6
7const accentOptions = [
8 { key: 'ayanami', label: 'Ayanami', color: 'oklch(0.626 0.098 247.46)' },
9 { key: 'asuka', label: 'Asuka', color: '#F35640' },
10 { key: 'rebecca', label: 'Rebecca', color: '#18CF7A' },
11 { key: 'okayu', label: 'Okayu', color: '#BC87C5' },
12 { key: 'inanis', label: "Ina'nis", color: '#8F81B0' },
13] as const
14
15const accentColor = useStorage(AccentColorStorageKey, 'ayanami')
16</script>
17
18<template>
19 <div>
20 <MenuTitle title="Accent Color" aria-label="Accent Color" mb-2>
21 <template #icon>
22 <span i-lucide:palette mr-1 aria-hidden="true" />
23 </template>
24 </MenuTitle>
25 <div class="accent-grid">
26 <button
27 v-for="option in accentOptions"
28 :key="option.key"
29 class="accent-btn"
30 :aria-pressed="accentColor === option.key"
31 :aria-label="option.label"
32 @click="accentColor = option.key"
33 >
34 <span class="accent-swatch" :style="{ backgroundColor: option.color }" />
35 <span class="accent-label">{{ option.label }}</span>
36 <span v-if="accentColor === option.key" i-lucide:check text-xs ml-auto />
37 </button>
38 </div>
39 </div>
40</template>
41
42<style scoped>
43.accent-grid {
44 display: grid;
45 grid-template-columns: 1fr 1fr;
46 gap: 2px;
47}
48
49.accent-btn {
50 display: flex;
51 align-items: center;
52 gap: 6px;
53 padding: 5px 8px;
54 border-radius: 8px;
55 border: none;
56 background: transparent;
57 cursor: pointer;
58 color: var(--vp-c-text-1);
59 font-size: 13px;
60 width: 100%;
61 transition: background-color 0.15s;
62}
63
64.accent-btn:hover {
65 background-color: var(--vp-c-bg-soft);
66}
67
68.accent-swatch {
69 width: 16px;
70 height: 16px;
71 border-radius: 50%;
72 flex-shrink: 0;
73}
74
75.accent-label {
76 flex: 1;
77 text-align: left;
78}
79</style>
docs/.vitepress/theme/components/settings/Menu.vue +2
@@ -3,6 +3,7 @@ import { useMounted } from '@vueuse/core'
33import { inject } from 'vue'
44
55import { InjectionKey, VPFlyout } from '../../constants'
6import AccentColor from './AccentColor.vue'
67import BlurEffects from './BlurEffects.vue'
78import LayoutSwitch from './LayoutSwitch.vue'
89import LayoutSwitchContentLayoutWidthInput from './LayoutSwitchContentLayoutMaxWidthSlider.vue'
@@ -34,6 +35,7 @@ const mounted = useMounted()
3435 <SpotlightStyles v-if="!options.spotlight?.disabled" />
3536 <BlurEffects />
3637 <Takodachi />
38 <AccentColor />
3739 </div>
3840 </VPFlyout>
3941</template>
docs/.vitepress/theme/components/settings/ScreenMenu.vue +2
@@ -1,6 +1,7 @@
11<script setup lang="ts">
22import { useMounted } from '@vueuse/core'
33
4import AccentColor from './AccentColor.vue'
45import BlurEffects from './BlurEffects.vue'
56import MenuTitle from './MenuTitle.vue'
67import ScreenLayoutSwitch from './ScreenLayoutSwitch.vue'
@@ -20,6 +21,7 @@ const mounted = useMounted()
2021 <ScreenLayoutSwitch />
2122 <ScreenSpotlight />
2223 <BlurEffects />
24 <AccentColor />
2325 </div>
2426 </div>
2527</template>
docs/.vitepress/theme/constants.ts +1
@@ -28,6 +28,7 @@ export const SpotlightStylesStorageKey =
2828
2929export const LowEndDeviceModeStorageKey = 'preference-low-end-device-mode'
3030export const TakodachiStorageKey = 'preference-takodachi'
31export const AccentColorStorageKey = 'preference-accent-color'
3132
3233export enum LayoutMode {
3334 FullWidth = 1,
docs/.vitepress/theme/styles/style.scss +16 −15
@@ -67,10 +67,10 @@ $ease-in-expo: cubic-bezier(0.7, 0, 0.84, 0);
6767
6868 /* Colors: Custom Block */
6969 /** Info */
70 --vp-custom-block-info-bg: theme("colors.brand.200");
71 --vp-custom-block-info-border: theme("colors.brand.800");
72 --vp-custom-block-info-text: theme("colors.brand.800");
73 --vp-custom-block-info-text-deep: theme("colors.brand.900");
70 --vp-custom-block-info-bg: color-mix(in srgb, var(--vp-c-brand-1) 15%, transparent);
71 --vp-custom-block-info-border: var(--vp-c-brand-3);
72 --vp-custom-block-info-text: var(--vp-c-brand-3);
73 --vp-custom-block-info-text-deep: var(--vp-c-brand-3);
7474 /** Tip */
7575 --vp-custom-block-tip-bg: theme("colors.meadow.200");
7676 --vp-custom-block-tip-border: theme("colors.meadow.800");
@@ -116,10 +116,10 @@ $ease-in-expo: cubic-bezier(0.7, 0, 0.84, 0);
116116
117117 /* Colors: Custom Block */
118118 /** Info */
119 --vp-custom-block-info-bg: theme("colors.brand.950");
120 --vp-custom-block-info-border: theme("colors.brand.800");
121 --vp-custom-block-info-text: theme("colors.brand.200");
122 --vp-custom-block-info-text-deep: theme("colors.brand.200");
119 --vp-custom-block-info-bg: color-mix(in srgb, var(--vp-c-brand-1) 10%, transparent);
120 --vp-custom-block-info-border: var(--vp-c-brand-3);
121 --vp-custom-block-info-text: var(--vp-c-brand-1);
122 --vp-custom-block-info-text-deep: var(--vp-c-brand-1);
123123 /** Tip */
124124 --vp-custom-block-tip-bg: theme("colors.meadow.950");
125125 --vp-custom-block-tip-border: theme("colors.meadow.800");
@@ -606,11 +606,11 @@ table tr:nth-child(odd) {
606606 @apply relative;
607607
608608 .is-link:hover {
609 @apply bg-brand-800/15! dark:bg-brand-500/15!;
609 background-color: var(--vp-c-sidebar-active) !important;
610610 }
611611
612612 .is-link.has-active {
613 @apply bg-brand-800/15! dark:bg-brand-500/15!;
613 background-color: var(--vp-c-sidebar-active) !important;
614614 }
615615
616616 &.collapsible {
@@ -1206,7 +1206,8 @@ table tr:nth-child(odd) {
12061206 @apply pl-0 border-l-0;
12071207
12081208 & > .outline-marker {
1209 @apply z-10 w-0.75 dark:bg-brand-300;
1209 @apply z-10 w-0.75;
1210 background-color: var(--vp-c-brand-1);
12101211 transition-timing-function: $ease-out-expo;
12111212 transition-duration: 0.3s;
12121213 }
@@ -1234,8 +1235,8 @@ table tr:nth-child(odd) {
12341235 &:hover,
12351236 &:focus,
12361237 &.active {
1237 @apply font-semibold dark:text-brand-300!;
1238 color: var(--vp-c-brand-1);
1238 @apply font-semibold;
1239 color: var(--vp-c-brand-1) !important;
12391240 transition-timing-function: $ease-out-expo;
12401241 transition-duration: 0.35s;
12411242 }
@@ -1250,8 +1251,8 @@ table tr:nth-child(odd) {
12501251 &:hover,
12511252 &:focus,
12521253 &.active {
1253 @apply opacity-100 font-semibold dark:text-brand-300;
1254 color: var(--vp-c-brand-1);
1254 @apply opacity-100 font-semibold;
1255 color: var(--vp-c-brand-1) !important;
12551256 transition-timing-function: $ease-out-expo;
12561257 transition-duration: 0.35s;
12571258 }