docs/.vitepress/theme/composables/animation.ts

2ca018e2040155a889e9819182255f56b41600cb
wotaku/docs/.vitepress/theme/composables/animation.ts
taskylizard wotaku 2bea9706e6c 1 year ago

23 lines · 602 bytes

 1import { useDebounceFn, useMounted } from '@vueuse/core'
 2
 3export function useLayoutAppearanceChangeAnimation() {
 4  const mounted = useMounted()
 5
 6  return {
 7    trigger: (animateElement: HTMLElement) => {
 8      animateElement.classList.add(
 9        'VPNolebaseEnhancedReadabilitiesLayoutSwitchAnimated'
10      )
11
12      const removeAnimatedClassName = useDebounceFn(() => {
13        if (!(mounted.value && animateElement)) return
14
15        animateElement.classList.remove(
16          'VPNolebaseEnhancedReadabilitiesLayoutSwitchAnimated'
17        )
18      }, 5000)
19
20      removeAnimatedClassName()
21    }
22  }
23}
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form