Image FXcssimagelab.com
3D · 51 / 56

Depth Diorama

The photo separates into a shadow-box of depth planes that part ways as the card tilts on hover.

Image
Green natural landscape

Hover the preview to part the depth planes.

Adjust
900px
7deg
-9deg
70px
40px
6px
600ms
Metadata
interaction
Hover · static fallback
browser
Modern evergreen
reduced motion
included
touch fallback
Static on touch
Edit the CSS above — the preview updates live.

About Depth Diorama

Depth Diorama turns a flat photo into a shadow-box: a blurred, dimmed backdrop plane (a ::before duplicate of the image), the sharp photo in the middle, and a rim-light plane in front. All three share the same rotateX/rotateY on hover under one perspective, so their different translateZ depths make them slide apart — real parallax, not a single-plane tilt. A ::before duplicates the image via the --ifx-src custom property — set it on the figure to the SAME url() as the img (the generated HTML/React does this for you). The card keeps its clipped bounds so the planes move within the frame like a real diorama window. Tune --ifx-depth (perspective), --ifx-tx / --ifx-ty (tilt angles), --ifx-back-z / --ifx-front-z (plane separation) and --ifx-blur (backdrop softness). It rests composed and flat on touch and under reduced motion; keep the @media (hover) wrapper and :focus-within selector.

Use cases

  • portfolio
  • gallery
  • hero
  • product

Browser support

Modern evergreen.

Accessibility

  • Essential content is never hidden behind hover.
  • Includes a prefers-reduced-motion fallback.
  • Touch fallback: static on touch.
  • Keyboard accessible — the effect also triggers on focus-within.