Skip to content
Image Effects

DepthParallax

One flat picture plus a grey depth map looks like a small window into a scene. Near parts travel further than far parts as the pointer moves. WebGL, no three.js.

Download
  • React
  • Tailwind CSS v4
  • motion

Props

NameTypeDefaultWhat it does
srcstringโ€”Picture address. From another site it needs CORS headers, or the plain picture shows with no effect.
depthstringโ€”Grey picture of the same shape. White is near, black is far. Blur it a little.
altstringโ€”Text for screen readers.
strengthnumber0.04How far near parts travel, as a part of the picture width.
classNamestring"aspect-video"Set the size here.