mirror of
https://github.com/fmhy/edit.git
synced 2026-01-13 23:41:06 +11:00
Add files for christmas theme, theme handler, feedback revamp and cattpuccin theme
This commit is contained in:
parent
c3cea020b3
commit
12d6af83cf
17 changed files with 1655 additions and 127 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue