mirror of
https://github.com/fmhy/edit.git
synced 2026-01-12 23:11:06 +11:00
Theme Handler (By Land), Christmas & Catppuccin Theme And Feedback Window Revamp (#4386)
* Add files for christmas theme, theme handler, feedback revamp and cattpuccin theme * Add files via upload * update image on home page * add tree logo for faster loading * change link to raw github
This commit is contained in:
parent
d0b9c2079b
commit
d4d4ad0d85
20 changed files with 1657 additions and 129 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