CSS 3D Animation

One-Point Perspective
Grid Gallery

CSS Only Animation

Back to all animations

Pure CSS 3D Photo Tunnel in One-Point Perspective

A one-point perspective tunnel built with nothing but CSS 3D transforms. Photos slide along all four walls from the vanishing point toward you, then glide off-screen. No JavaScript — negative animation delays keep the loop seamless.

Built with
  • CSS only
Published

Build this with an AI assistant

A prompt that bundles the reference URL and the key implementation points. Copy it and paste it straight into your AI assistant.

Recreate only the motion, feel, and timing of the reference page in my current project.
Don't copy the site's look, images, copy, or branding, and don't copy the code line for line.

Motion reference URL: https://tane-be.co.jp/animation/en/image/24/
Technology guide: CSS only

Requirements (animation):
In the current project, recreate a one-point perspective tunnel using only CSS 3D. Follow the reference URL for the depth and sliding motion. Use your own photos or placeholders; the center copy is optional. Don't reuse the brand copy. Requirements: 1. Set perspective and preserve-3d on the parent. Stack concentric rectangles with translateZ to build the depth grid. 2. Four walls: top, bottom, left, and right. Each photo shares its wall's rotateX/Y and translates along the wall's local axis (X for the side walls, Y for top and bottom) to slide from back to front. 3. Offset each photo's phase with a negative animation-delay and loop infinitely with no gaps. 4. Lower the opacity near the front and exit off-screen near the camera plane (fade out before the edges turn sideways). 5. Keep the center copy on a 2D layer outside the 3D scene for legibility. A white radial gradient behind it is fine. 6. No JavaScript. Stop the animation under prefers-reduced-motion. 7. Don't use the reference demo's photos.

Implementation notes:
- Don't take or reuse images, text, or logos from the reference page; use your own assets, placeholders, or any copy
- Prefer the existing HTML, CSS, naming, directory structure, and libraries; don't add unnecessary dependencies
- Support both desktop and mobile; respect focus-visible and prefers-reduced-motion where relevant
- Keep motion on transform and opacity; avoid always-on listeners or rAF loops
- Keep changes minimal, and finish with a short report of the changed files and what you checked

Where to use it

  • Hero visuals for corporate sites
  • Key visuals for brand sites
  • Openers for photo galleries
  • Intro sequences for campaign sites

How it works

  • perspective and preserve-3d on the parent create a one-point perspective space with the vanishing point at the center of the screen
  • Concentric rectangles spaced evenly along the Z axis form a depth grid in which nearer frames look larger
  • The grid comes from whole-number divisions of the screen width and height, so the corner edges line up with the wall lines and the frame spacing
  • Each photo matches its wall's rotateX / rotateY and slides along that wall's local axis
  • Negative animation-delay values offset the eight photos so the loop never visibly restarts
  • Opacity drops near the front so photos leave the screen before their edges turn sideways past the camera plane
  • The center copy lives on a separate 2D layer so the lines around the vanishing point never cross the text
  • No JavaScript — just CSS animations on transform and opacity

Make it your own

  • Tunnel perspective (--persp) and grid target (--target)
  • Photo size, count, and wall assignment
  • Loop length (--duration) and fade timing
  • Number of frames (--rings)

Before you ship

Mobile & touch
Viewing distance, photo size, and wall positions adapt to the screen's aspect ratio. Tall screens favor the side walls, while short landscape screens shrink the copy and photos to avoid clipping.
Browser support
Uses CSS 3D transforms, custom properties, and animations. Works in all major modern browsers.
Performance (load: Medium)
Only the photos' transform and opacity animate. The grid is made of static frames and wall background lines, with no blur.
Accessibility
Photos are decorative with empty alt text; the heading and lead are real HTML text that screen readers announce.
Reduced motion
With prefers-reduced-motion, animation-play-state is set to paused, and the negative delays leave a mid-motion composition frozen in place.

FAQ

How do I build a one-point perspective tunnel with only CSS?

Set perspective on the parent and push full-screen rectangles back with translateZ. You get concentric frames that look larger the closer they are. The vanishing point is wherever perspective-origin sits.

How are the radiating grid lines drawn?

Divide the screen width and height by whole numbers and draw lines on the walls at that interval. The corner edges line up where the ends of the top and bottom walls meet the side walls.

How do I move a photo forward while keeping it on the wall?

Rotate the photo's parent to the same angle as its wall, then animate along the wall's local axis — translateX for the side walls, translateY for the top and bottom. Its position in world Z moves from back to front.

When does a photo leave the screen?

The translate ends just in front of the camera plane, and opacity drops to 0 near the end — so the photo exits before it turns edge-on.

How do I make a CSS animation loop without a visible restart?

Set the animation to infinite and give each photo a negative animation-delay equal to its share of the cycle. At any moment, several photos are already inside the tunnel.

How do I keep the center text from getting lost in the grid?

Put the copy on a 2D layer outside the 3D scene and place a soft white radial gradient behind it, so the lines near the vanishing point don't hurt legibility.

“Can you build this?”
is a great place to start.

From coding and animation to WordPress — talk directly with TANE-⁠be engineers.
The TANE to CODE site is in Japanese.

Visit TANE to CODE

Get in touch

Website projects, memorable motion ideas — we'd love to hear about them.
Our contact form is in Japanese.