Sitepeel

img-auto-parallax

img-auto-parallax.vercel.app · Visual effects · Open source

Visit site

Swap an img tag for this web component and a photo gains a 3D parallax effect, with depth worked out on the visitor's device.

  1. What it is

    A web component by Anthony Fu. It runs a small depth model in the browser on WebGPU to guess which parts of a photo are near or far, then moves the layers as the pointer, scroll or phone tilt changes. The playground lets you try your own photo, choose a model and resolution, and set strength, smoothing and focus blur, and you can also precompute depth maps at build time.

  2. Is it for you?

    Made for
    Front-end developers who want photos on a site to feel more alive without making 3D assets.
    You need
    Any web page (works with Vue, React or plain HTML). WebGPU for live depth, or a precomputed depth map for WebGL
    Price
    Open source (MIT)
  3. What you can do with it

    • Hero photos that move with the mouse
    • Gallery images that react to phone tilt
    • Adding depth to travel or portfolio photos
    • Precomputing depth maps for faster pages

    Good to know: Running the depth model in the browser downloads 5 to 67 MB depending on the model.

More like this

See all 227 resources