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 {
34 NolebaseEnhancedReadabilitiesScreenMenu 34 NolebaseEnhancedReadabilitiesScreenMenu
35} from './components/settings' 35} from './components/settings'
36import SidebarCard from './components/SidebarCard.vue' 36import SidebarCard from './components/SidebarCard.vue'
37import { LowEndDeviceModeStorageKey, TakodachiStorageKey } from './constants' 37import { AccentColorStorageKey, LowEndDeviceModeStorageKey, TakodachiStorageKey } from './constants'
38import { v2add, v2mag, v2norm, v2smul, v2sub, type Vec2D } from './math' 38import { v2add, v2mag, v2norm, v2smul, v2sub, type Vec2D } from './math'
39 39
40const route = useRoute() 40const route = useRoute()
41const { frontmatter, site, theme } = useData() 41const { frontmatter, isDark, site, theme } = useData()
42const { Layout } = DefaultTheme 42const { Layout } = DefaultTheme
43 43
44// Home sidebar menu 44// Home sidebar menu
@@ -572,6 +572,65 @@ watchEffect(() => {
572 ) 572 )
573}) 573})
574 574
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
575const speed = 2 634const speed = 2
576const snapThreshold = 5 // px 635const snapThreshold = 5 // px
577 636
docs/.vitepress/theme/components/Search.vue +8 −8
@@ -2475,9 +2475,9 @@ function onMouseMove(e: MouseEvent) {
2475} 2475}
2476 2476
2477.page-pill.active { 2477.page-pill.active {
2478 color: #6ab0f5; 2478 color: var(--vp-c-brand-1);
2479 border: 1.5px solid #6ab0f5; 2479 border: 1.5px solid var(--vp-c-brand-1);
2480 background: rgba(60, 120, 210, 0.12); 2480 background: color-mix(in srgb, var(--vp-c-brand-1) 12%, transparent);
2481 box-shadow: none; 2481 box-shadow: none;
2482} 2482}
2483 2483
@@ -2497,7 +2497,7 @@ function onMouseMove(e: MouseEvent) {
2497} 2497}
2498 2498
2499.page-pill.active .page-pill-count { 2499.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);
2501} 2501}
2502 2502
2503@media (max-width: 767px) { 2503@media (max-width: 767px) {
@@ -2872,7 +2872,7 @@ svg {
2872 2872
2873.exact-match-button.exact-match-active { 2873.exact-match-button.exact-match-active {
2874 color: var(--vp-c-brand-1); 2874 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);
2876 border-radius: 4px; 2876 border-radius: 4px;
2877} 2877}
2878 2878
@@ -2921,7 +2921,7 @@ svg {
2921 2921
2922.mode-btn.mode-active { 2922.mode-btn.mode-active {
2923 color: var(--vp-c-brand-1); 2923 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);
2925} 2925}
2926 2926
2927:deep(.url-highlight) { 2927:deep(.url-highlight) {
@@ -2984,7 +2984,7 @@ svg {
2984 2984
2985.url-page-btn.active { 2985.url-page-btn.active {
2986 color: var(--vp-c-brand-1); 2986 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);
2988 font-weight: 500; 2988 font-weight: 500;
2989 cursor: default; 2989 cursor: default;
2990} 2990}
@@ -3090,7 +3090,7 @@ svg {
3090 3090
3091.settings-option.active { 3091.settings-option.active {
3092 color: var(--vp-c-brand-1); 3092 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);
3094} 3094}
3095 3095
3096.settings-popup-enter-active, 3096.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'
3import { inject } from 'vue' 3import { inject } from 'vue'
4 4
5import { InjectionKey, VPFlyout } from '../../constants' 5import { InjectionKey, VPFlyout } from '../../constants'
6import AccentColor from './AccentColor.vue'
6import BlurEffects from './BlurEffects.vue' 7import BlurEffects from './BlurEffects.vue'
7import LayoutSwitch from './LayoutSwitch.vue' 8import LayoutSwitch from './LayoutSwitch.vue'
8import LayoutSwitchContentLayoutWidthInput from './LayoutSwitchContentLayoutMaxWidthSlider.vue' 9import LayoutSwitchContentLayoutWidthInput from './LayoutSwitchContentLayoutMaxWidthSlider.vue'
@@ -34,6 +35,7 @@ const mounted = useMounted()
34 <SpotlightStyles v-if="!options.spotlight?.disabled" /> 35 <SpotlightStyles v-if="!options.spotlight?.disabled" />
35 <BlurEffects /> 36 <BlurEffects />
36 <Takodachi /> 37 <Takodachi />
38 <AccentColor />
37 </div> 39 </div>
38 </VPFlyout> 40 </VPFlyout>
39</template> 41</template>
docs/.vitepress/theme/components/settings/ScreenMenu.vue +2
@@ -1,6 +1,7 @@
1<script setup lang="ts"> 1<script setup lang="ts">
2import { useMounted } from '@vueuse/core' 2import { useMounted } from '@vueuse/core'
3 3
4import AccentColor from './AccentColor.vue'
4import BlurEffects from './BlurEffects.vue' 5import BlurEffects from './BlurEffects.vue'
5import MenuTitle from './MenuTitle.vue' 6import MenuTitle from './MenuTitle.vue'
6import ScreenLayoutSwitch from './ScreenLayoutSwitch.vue' 7import ScreenLayoutSwitch from './ScreenLayoutSwitch.vue'
@@ -20,6 +21,7 @@ const mounted = useMounted()
20 <ScreenLayoutSwitch /> 21 <ScreenLayoutSwitch />
21 <ScreenSpotlight /> 22 <ScreenSpotlight />
22 <BlurEffects /> 23 <BlurEffects />
24 <AccentColor />
23 </div> 25 </div>
24 </div> 26 </div>
25</template> 27</template>
docs/.vitepress/theme/constants.ts +1
@@ -28,6 +28,7 @@ export const SpotlightStylesStorageKey =
28 28
29export const LowEndDeviceModeStorageKey = 'preference-low-end-device-mode' 29export const LowEndDeviceModeStorageKey = 'preference-low-end-device-mode'
30export const TakodachiStorageKey = 'preference-takodachi' 30export const TakodachiStorageKey = 'preference-takodachi'
31export const AccentColorStorageKey = 'preference-accent-color'
31 32
32export enum LayoutMode { 33export enum LayoutMode {
33 FullWidth = 1, 34 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);
67 67
68 /* Colors: Custom Block */ 68 /* Colors: Custom Block */
69 /** Info */ 69 /** Info */
70 --vp-custom-block-info-bg: theme("colors.brand.200"); 70 --vp-custom-block-info-bg: color-mix(in srgb, var(--vp-c-brand-1) 15%, transparent);
71 --vp-custom-block-info-border: theme("colors.brand.800"); 71 --vp-custom-block-info-border: var(--vp-c-brand-3);
72 --vp-custom-block-info-text: theme("colors.brand.800"); 72 --vp-custom-block-info-text: var(--vp-c-brand-3);
73 --vp-custom-block-info-text-deep: theme("colors.brand.900"); 73 --vp-custom-block-info-text-deep: var(--vp-c-brand-3);
74 /** Tip */ 74 /** Tip */
75 --vp-custom-block-tip-bg: theme("colors.meadow.200"); 75 --vp-custom-block-tip-bg: theme("colors.meadow.200");
76 --vp-custom-block-tip-border: theme("colors.meadow.800"); 76 --vp-custom-block-tip-border: theme("colors.meadow.800");
@@ -116,10 +116,10 @@ $ease-in-expo: cubic-bezier(0.7, 0, 0.84, 0);
116 116
117 /* Colors: Custom Block */ 117 /* Colors: Custom Block */
118 /** Info */ 118 /** Info */
119 --vp-custom-block-info-bg: theme("colors.brand.950"); 119 --vp-custom-block-info-bg: color-mix(in srgb, var(--vp-c-brand-1) 10%, transparent);
120 --vp-custom-block-info-border: theme("colors.brand.800"); 120 --vp-custom-block-info-border: var(--vp-c-brand-3);
121 --vp-custom-block-info-text: theme("colors.brand.200"); 121 --vp-custom-block-info-text: var(--vp-c-brand-1);
122 --vp-custom-block-info-text-deep: theme("colors.brand.200"); 122 --vp-custom-block-info-text-deep: var(--vp-c-brand-1);
123 /** Tip */ 123 /** Tip */
124 --vp-custom-block-tip-bg: theme("colors.meadow.950"); 124 --vp-custom-block-tip-bg: theme("colors.meadow.950");
125 --vp-custom-block-tip-border: theme("colors.meadow.800"); 125 --vp-custom-block-tip-border: theme("colors.meadow.800");
@@ -606,11 +606,11 @@ table tr:nth-child(odd) {
606 @apply relative; 606 @apply relative;
607 607
608 .is-link:hover { 608 .is-link:hover {
609 @apply bg-brand-800/15! dark:bg-brand-500/15!; 609 background-color: var(--vp-c-sidebar-active) !important;
610 } 610 }
611 611
612 .is-link.has-active { 612 .is-link.has-active {
613 @apply bg-brand-800/15! dark:bg-brand-500/15!; 613 background-color: var(--vp-c-sidebar-active) !important;
614 } 614 }
615 615
616 &.collapsible { 616 &.collapsible {
@@ -1206,7 +1206,8 @@ table tr:nth-child(odd) {
1206 @apply pl-0 border-l-0; 1206 @apply pl-0 border-l-0;
1207 1207
1208 & > .outline-marker { 1208 & > .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);
1210 transition-timing-function: $ease-out-expo; 1211 transition-timing-function: $ease-out-expo;
1211 transition-duration: 0.3s; 1212 transition-duration: 0.3s;
1212 } 1213 }
@@ -1234,8 +1235,8 @@ table tr:nth-child(odd) {
1234 &:hover, 1235 &:hover,
1235 &:focus, 1236 &:focus,
1236 &.active { 1237 &.active {
1237 @apply font-semibold dark:text-brand-300!; 1238 @apply font-semibold;
1238 color: var(--vp-c-brand-1); 1239 color: var(--vp-c-brand-1) !important;
1239 transition-timing-function: $ease-out-expo; 1240 transition-timing-function: $ease-out-expo;
1240 transition-duration: 0.35s; 1241 transition-duration: 0.35s;
1241 } 1242 }
@@ -1250,8 +1251,8 @@ table tr:nth-child(odd) {
1250 &:hover, 1251 &:hover,
1251 &:focus, 1252 &:focus,
1252 &.active { 1253 &.active {
1253 @apply opacity-100 font-semibold dark:text-brand-300; 1254 @apply opacity-100 font-semibold;
1254 color: var(--vp-c-brand-1); 1255 color: var(--vp-c-brand-1) !important;
1255 transition-timing-function: $ease-out-expo; 1256 transition-timing-function: $ease-out-expo;
1256 transition-duration: 0.35s; 1257 transition-duration: 0.35s;
1257 } 1258 }