Add files for christmas theme, theme handler, feedback revamp and cattpuccin theme

This commit is contained in:
Samidy 2025-12-05 18:07:32 +03:00 committed by GitHub
parent c3cea020b3
commit 12d6af83cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 1655 additions and 127 deletions

View file

@ -1,9 +1,12 @@
<script setup lang="ts">
import { useData } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import Announcement from './components/Announcement.vue'
import Sidebar from './components/SidebarCard.vue'
import { useTheme } from './themes/themeHandler'
const { isDark } = useData()
const { setMode } = useTheme()
const enableTransitions = () =>
'startViewTransition' in document &&
@ -12,6 +15,8 @@ const enableTransitions = () =>
provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => {
if (!enableTransitions()) {
isDark.value = !isDark.value
// Sync with theme handler
setMode(isDark.value ? 'dark' : 'light')
return
}
@ -26,6 +31,8 @@ provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => {
// @ts-expect-error
await document.startViewTransition(async () => {
isDark.value = !isDark.value
// Sync with theme handler
setMode(isDark.value ? 'dark' : 'light')
await nextTick()
}).ready