Animate on Scroll — Demo
Available triggers and effects
There are 3 triggers: in (entrance), out (exit), and scroll (anim-view). Each trigger can use the following effects: fade, scale, slide. You can combine several effects, for example anim-fade + anim-slide-from-bottom + anim-scale.
Available effects:
fade— opacity viaanim-fade(+ optionanim-fade-50...).scale— zoom viaanim-scale, or per axisanim-scale-x-*/anim-scale-y-*.slide— movement viaanim-slide-from-*with distances (anim-slide-8,anim-slide-full...).
Basic examples (JS — anim-in)
Basic JS-side variants: fade-in, anim-slide-from-top/bottom/left/right, scale-in and scale-out.
Fade
Gradual appearance.
scale In
Slight scale in.
scale Out
Slight scale out.
Scroll‑Driven (anim-view)
These elements use anim-view and a scroll-driven CSS timeline. They are synchronized to scrolling: no duration or delay (those values are ignored).
Durations & easing (JS — anim-in)
Control speed and interpolation with the utilities: anim-duration-*, anim-ease-*, anim-delay-*.
Cascading lists (JS — anim-in)
Apply increasing delays to simulate a cascade effect.
Visual parameters — examples
Each effect accepts parameters. Here are concrete previews to tune them visually.
Scale 125%
anim-scale-125
Scale X 150%
anim-scale-x-150
Scale Y 90%
anim-scale-y-90
Fade 50%
anim-fade-50
Tip: combine several effects. Example: anim-fade + anim-slide-from-bottom + anim-scale-105.
Combinations (JS — anim-in)
Combine the variants for richer staging.
scale-out
scale-in
JS entrances (without anim-view)
These elements do not use anim-view. They are triggered in JavaScript via IntersectionObserver by the AnimateOnScroll component and start when they enter the viewport.
JS — scale In
No CSS timeline; JS trigger.
JS exits (anim-out)
These elements use anim-out. They play their animation when you leave their viewing area (by scrolling them out of the viewport). Scroll slowly to see the effect.
JS — Scale Out
Scale-out exit effect.