06.11 · 3D & Advanced

2.5D / Pseudo-3D

Flat layers slide by different amounts, faking depth. Best for hero scenes.

Hover it

Move your pointer across the scene, drag a finger sideways (or Tab to it and use the arrow keys), or press Show me.

Try it

Change a setting, then try it again or press Show me.

Camera movement

How far the nearest layer moves; far ones move less.

Shows how much each layer moves.

Copy the prompt

Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.

Add a 2.5D parallax scene to [the illustration or hero you want to give depth]. Split the picture into flat layers, from a far sky to the near ground, and when the pointer moves, shift every layer the opposite way by an amount that grows with how near it is: the sky barely moves and the ground moves the most, so the flat picture seems deep. Make each layer a little wider than the frame so no edge shows. On touch screens, dragging a finger should move the scene the same way. If the visitor has reduced motion turned on, keep the layers still. Match the settings listed below.

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 GitHub

What it is

The full explanation is in README.md.

Good for

  • Hero scenes
  • Illustrations
  • Game sites
  • Landing pages

Avoid on

  • Photos
  • Content-heavy pages