01.02 · Scroll-Based
Parallax Scrolling
Far layers move slower than near ones as you scroll. Best for hero scenes.
Scroll it
Scroll inside the box, or press Play and it scrolls for you.
With parallax
Inside, the picture is four flat layers, each with a faint outline where it started: the far ones move least and the near grass most. Scroll the box or press Play to watch.
Without parallax (left), every layer moves the same and the picture looks flat; With parallax (right), each moves its own amount and it looks deep. Scroll the box or press Play to watch.
Try it
Change a setting, then scroll again or press Play.
Depth
Deep spreads the layers' speeds; Flat moves them as one.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add a parallax scene to [your hero section or illustration]. Split the scene into layers from far to near, such as sky, hills, trees and ground, and hold it in place while the visitor scrolls through a taller section. As they scroll, move each layer by its own amount, as the settings choose; usually the farthest layer barely moves and the nearest moves most, which makes the flat picture feel deep. Base the movement on how far through the section the visitor has scrolled, so it starts and stops at the same place every time. If the visitor has reduced motion turned on, keep every layer still. Match the settings listed below.
Your settings
Replace the words in brackets with your own element. Your settings are added at the end.
Free and open source. If this helped, a star on GitHub helps other people find it.
Star on GitHubWhat it is
The full explanation is in README.md.