StealThis .dev

Scroll-Linked 3D Scene

A sticky 3D exploded-view scene built with CSS 3D transforms that scrubs its assembly, rotation and layer separation directly from scroll progress, with a live progress rail and a reduced-motion crossfade fallback.

Open in Lab
vanilla-js css
Targets: JS HTML

Code

The Scroll-Linked 3D Scene pins a perspective viewport while a tall scroll track underneath it drives the animation. As you scroll, a normalized progress value (0 → 1) is mapped onto every layer of a stacked device card: the cluster rotates in X and Y, the panels explode apart along Z, and captions fade in at staged thresholds. The whole thing is driven by CSS transform-style: preserve-3d — no WebGL, no libraries — so it stays crisp at any DPR and animates on the compositor.

Interaction is entirely scroll-native: scrub up and down to assemble or disassemble the stack, and a fixed rail on the right reports the exact progress percentage and active stage. A control strip lets you toggle auto-rotate idle drift, flip between explode and rotate-only choreographies, and snap to the fully-assembled frame. Scroll updates are batched through requestAnimationFrame and read via a single IntersectionObserver + scroll listener, so there is no layout thrash per frame.

The component demonstrates the core technique behind scroll-scrubbed product reveals: decouple scroll position from animation state by computing a clamped progress ratio for a sticky element, then interpolate transforms from it. When prefers-reduced-motion: reduce is set, the 3D scrub is replaced by a simple staged opacity crossfade, keeping the narrative intact without vestibular motion.