Quiet, opacity-only entrances
Best for supporting copy. Nothing moves, so it never distracts. data-reveal="fade"
Faster first read
Visitors scan headings before animated blocks catch their eye.
No dependencies
A single observer replaces scroll listeners and layout reads.
Entrance styles
Fade, three slides and zoom cover most landing-page needs.
Lists that rise into place
A short upward travel signals new content without feeling heavy. data-reveal="slide-up"
- Plan the reading orderHeadings first, then detail
- Keep travel under 48pxLarge jumps feel janky
- Animate only transform and opacityBoth run on the compositor
- Unobserve once revealedLess work while scrolling
Split layouts that meet in the middle
Opposite directions reinforce a comparison. slide-left slide-right
Scroll listeners
Fires dozens of times per second, forces layout reads with getBoundingClientRect and needs manual throttling.
IntersectionObserver
The browser tells you when an element crosses a threshold. No polling, no math, and it pauses off-screen.
Gallery tiles that scale in
Great for imagery and product shots. Start at 82% so the growth stays subtle. data-reveal="zoom"
A nine-item cascade
Items that enter in the same batch are delayed by their order. Drag the stagger slider and press Replay. data-reveal-stagger
When exactly does it fire?
Scroll slowly. Each box triggers at a different share of its height in view. data-reveal-threshold
The attribute pattern
Add these attributes to any markup. The script on this page reads them and does the rest.
<!-- single element --> <h2 data-reveal="slide-up">Pricing</h2> <!-- delayed, fires when half visible --> <p data-reveal="fade" data-reveal-delay="150" data-reveal-threshold="0.5">...</p> <!-- staggered group --> <ul data-reveal-stagger> <li data-reveal="zoom">One</li> <li data-reveal="zoom">Two</li> </ul>