Animate Nuxt with AnimeJS
Create SSR Safe animations for Nuxt without having to worry about targets and component lifecycle.
<div class="grid grid-cols-10 place-items-center gap-0.5 absolute inset-0 p-5">
<div v-for="i in 40" :key="i" ref="boxes" class="size-9 rounded-sm bg-primary/30 aspect-square" />
</div>
import { stagger } from '#nanime/utils'
const boxes = useTemplateRef('boxes')
useAnimate(boxes, {
scale: [{ to: [0, 1.25] }, { to: 0 }],
boxShadow: [
{ to: '0 0 1rem 0 currentColor' },
{ to: '0 0 0rem 0 currentColor' }
],
delay: stagger(100, {
grid: [10, 4],
from: 'center',
}),
duration: 1500,
playbackEase: 'outQuad',
loop: true,
})
Composables
Wrappers around every AnimeJS utility, built for Vue reactivity.
The rest of the toolkit
Easing curves, re-exported Anime.js utilities and SVG/text proxies. The
pieces that show up inside the composables above rather than standing on
their own.