Pointer parallax layers
A small layered scene shifts with the pointer, the near hills moving more than the far ones, so it reads as depth.
The React code for this component comes with Pro.
Unlock with ProUse it for
- Illustrated heroes and empty states
- Destination or product scenes built from a few flat layers
Avoid
- Photos, which break when sliced into layers
- Layouts where shifting layers could cover text or controls
How it works
Each layer carries a data-depth between 0.15 and 1. The pointer offset from the stage centre is normalised to -1 to 1 and eased with a 0.08 lerp in a requestAnimationFrame loop, and each layer translates against it by depth times 4 percent of the stage width. Layers overhang the stage on every side so their edges never show. Leaving the stage eases the scene back to centre.
Accessibility
The scene is decorative and aria-hidden, the caption is real text. Touch input is ignored so scrolling stays free; with no pointer input the scene drifts slowly, which covers phones. Reduced motion shows the still scene and runs no loop, and the loop pauses off screen.
Get the source with Pro
The demo above is free to play with. Pro unlocks the source of this and every other Pro component, with copy-ready code and a zip download.
Already bought? Sign in- Pay once
Lifetime
Pay once, keep it forever.
$39once
- Every Pro component, with full source
- Lifetime updates: every future Pro component included
- One zip download, ready to drop into a React app
- Commercial use in unlimited client and personal projects