Create captivating web experiences with the svelte-aoe
package.
svelte-aoe
utilizes the Intersection Observer API to detect when an element enters the viewport. When the element is detected as being in the viewport, svelte-aoe
applies a class that triggers a CSS animation.
npm i svelte-aoe --save-dev
import AnimateOnEnter from 'svelte-aoe';
<AnimateOnEnter />
data-aoe
attribute to the element that you want to animate and define an animation.<img data-aoe="fade-up" src="https://dummyimage.com/500x300"/>
File: src/routes/+layout.svelte
<script>
import AnimateOnEnter from 'svelte-aoe';
</script>
<AppShell>
<AnimateOnEnter />
<slot />
</AppShell>
up
right
left
down
fade
fade-up
fade-right
fade-left
fade-down
ā¤ļø Inspired by Animate on Scroll