StealThis .dev

Scroll-Driven Reveal

A pure-CSS scroll choreography kit — elements fade, slide, and scale into view with animation-timeline view(), a top progress bar wired to scroll(), and a layered parallax band, all with a graceful IntersectionObserver fallback.

Open in Lab
css vanilla-js
Targets: JS HTML

Code

Scroll-Driven Reveal is a self-contained showcase of CSS scroll-driven animations — the animation-timeline property with view() and scroll() timelines. Instead of running on the document clock, each keyframe animation is driven by the geometry of scrolling: cards fade and lift as they cross into the viewport, a fixed progress bar tracks how far you are through the page using a scroll() timeline, and a parallax band moves foreground and background layers at different rates from a single view() range. Everything is declared in CSS, so it stays buttery even while the main thread is busy.

The demo is organized into labeled blocks — Reveal, Progress, Stagger, and Parallax — each with a short caption explaining exactly which timeline and range is at work. A control strip lets you switch the reveal effect (fade, slide, scale, blur), tune the animation range, and replay the sequence, updating CSS custom properties live. A support badge feature-detects the API with CSS.supports("animation-timeline: view()").

When scroll-driven timelines are unavailable, an @supports not block plus a tiny IntersectionObserver polyfill take over: the same reveal classes are toggled on intersection so content never stays hidden. The result works everywhere while demonstrating the modern web platform API where it is supported.