Hero Templates
Depth Stage
A DOM hero stage where any children become parallax layers in real 3D. Pointer-tracked tilt, spring physics, a following spotlight, depth of field, staggered entrance, zero canvas.
Install
bun add motionProps
| Prop | Type | Default | Description |
|---|---|---|---|
| accentColor | string (hex) | "#a855f7" | Accent wash behind the layers. |
| depth | number | 40 | Full-stack parallax travel at the deepest layer. |
| tiltMax | number | 3.5 | Stage tilt at the pointer extremes. |
| entrance | boolean | true | Stagger the layers up on mount. |
| float | boolean | true | Slow CSS drift on every layer while idle. |
| spotlight | boolean | true | A pointer-following light across the stage. |
| depthOfField | boolean | true | Blur the far layers the way a lens would. |
What It Demonstrates
- Parallax
- Background and foreground move at different speeds while scrolling, creating depth.
- Spring
- Motion driven by physics (tension, mass, damping) rather than a set duration.
- Stagger
- Animate several items one after another with a small delay between each, creating a cascade.
- Reduced motion
- Respecting the user's prefers-reduced-motion setting by toning down or removing motion.
- Hover effect
- Visual change when the cursor moves over an element.
Related Components
Grid Horizon
A synthwave horizon in one fragment shader. A glowing grid floor, a banded sun, parallax ridges and a pulse rolling out of the vanishing point.
Eclipse Flare
A total eclipse under liquid-glass copy: a streamered corona, a diamond-ring flare on the breath, god-rays marched through drifting cirrus in one jittered pass.
Shard Orbit
A giant crystal monolith turning on its axis in a glitter field, or a halo or helix of instanced shards lit by the pulsing core, drag-orbited beside left-aligned copy, fully GPU-driven.
Tidal
A dusk ocean under flat, left-aligned copy: noise-warped swells with wind ripple, sunlit crests, a sun path and breaking foam, raymarched in one bounded pass.
Liquid Chrome
A liquid-chrome form of fused spheres over a black mirror floor: rectangular studio softboxes, one mirror bounce and soft occlusion, sphere-traced in one pass beside left-aligned copy.
Silvergrass
A field of silver grass under the moon, beside left-aligned copy. Wind rolls across thousands of blades drawn on the GPU. The grass parts around the pointer, a click sends a ring of wind through it, and a drag turns the view.