Commit 9ac24fef3b
Unsigned
Layout: unified · split
docs/.vitepress/theme/components/SidebarCard.vue +30 −1
| @@ -5,10 +5,39 @@ | ||
| 5 | 5 | |
| 6 | 6 | All rights reserved. This code and its associated files may not be copied, modified, distributed, sublicensed, or used in any form, in whole or in part, without prior written permission from the copyright holder. |
| 7 | 7 | --> |
| 8 | <script setup lang="ts"> | |
| 9 | import { computed } from 'vue' | |
| 10 | import { useData } from 'vitepress' | |
| 11 | import { useStorage } from '@vueuse/core' | |
| 12 | import { AccentColorStorageKey } from '../constants' | |
| 13 | ||
| 14 | const { isDark } = useData() | |
| 15 | const accentColor = useStorage(AccentColorStorageKey, 'ayanami') | |
| 16 | ||
| 17 | const accentImageMap: Record<string, string> = { | |
| 18 | ayanami: 'rei', | |
| 19 | asuka: 'asuka', | |
| 20 | miku: 'miku', | |
| 21 | inanis: 'ina', | |
| 22 | watson: 'ame', | |
| 23 | baelz: 'bae', | |
| 24 | irys: 'irys', | |
| 25 | suisei: 'suisei', | |
| 26 | } | |
| 27 | ||
| 28 | const sidebarImage = computed(() => { | |
| 29 | if (accentColor.value === 'fubuki') { | |
| 30 | return isDark.value ? '/sidebar/fubuki.avif' : '/sidebar/kuro.avif' | |
| 31 | } | |
| 32 | const name = accentImageMap[accentColor.value] ?? 'rei' | |
| 33 | return `/sidebar/${name}.avif` | |
| 34 | }) | |
| 35 | </script> | |
| 36 | ||
| 8 | 37 | <template> |
| 9 | 38 | <div class="mt-2 overflow-hidden rounded-xl border-2 border-solid border-[#3d3d3d] relative z-0 max-md:border-2 max-md:border-[#3d3d3d]"> |
| 10 | 39 | <img |
| 11 | src="/soemy.webp" | |
| 40 | :src="sidebarImage" | |
| 12 | 41 | alt="" |
| 13 | 42 | class="w-full h-full object-cover block" |
| 14 | 43 | no-zoomable |
docs/public/sidebar/ame.avif added
Binary file not shown.
docs/public/sidebar/asuka.avif added
Binary file not shown.
docs/public/sidebar/bae.avif added
Binary file not shown.
docs/public/sidebar/fubuki.avif added
Binary file not shown.
docs/public/sidebar/ina.avif added
Binary file not shown.
docs/public/sidebar/irys.avif added
Binary file not shown.
docs/public/sidebar/kuro.avif added
Binary file not shown.
docs/public/sidebar/miku.avif added
Binary file not shown.
docs/public/sidebar/rei.avif added
Binary file not shown.
docs/public/sidebar/suisei.avif added
Binary file not shown.