mirror of
https://github.com/fmhy/edit.git
synced 2025-08-03 09:42:14 +10:00
init
This commit is contained in:
parent
24a1fb0c6e
commit
7bd4a70aca
7 changed files with 92 additions and 121 deletions
|
@ -1,10 +1,28 @@
|
|||
<script setup lang="ts">
|
||||
import { BProgress } from '@bprogress/core'
|
||||
import DefaultTheme from 'vitepress/theme'
|
||||
import Announcement from './components/Announcement.vue'
|
||||
import Sidebar from './components/SidebarCard.vue'
|
||||
|
||||
import '@bprogress/core/css'
|
||||
|
||||
const { isDark } = useData()
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
BProgress.configure({
|
||||
showSpinner: false,
|
||||
easing: 'ease'
|
||||
})
|
||||
|
||||
router.onBeforeRouteChange = () => {
|
||||
BProgress.start()
|
||||
}
|
||||
|
||||
router.onAfterRouteChange = () => {
|
||||
BProgress.done()
|
||||
}
|
||||
|
||||
const enableTransitions = () =>
|
||||
'startViewTransition' in document &&
|
||||
window.matchMedia('(prefers-reduced-motion: no-preference)').matches
|
||||
|
@ -23,7 +41,6 @@ provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => {
|
|||
)}px at ${x}px ${y}px)`
|
||||
]
|
||||
|
||||
// @ts-expect-error
|
||||
await document.startViewTransition(async () => {
|
||||
isDark.value = !isDark.value
|
||||
await nextTick()
|
||||
|
@ -61,6 +78,10 @@ const { Layout } = DefaultTheme
|
|||
</template>
|
||||
|
||||
<style>
|
||||
:root {
|
||||
--bprogress-color: var(--vp-c-brand);
|
||||
}
|
||||
|
||||
::view-transition-old(root),
|
||||
::view-transition-new(root) {
|
||||
animation: none;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue