Platform
VaultVault
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
ButtonsPart of ProButtons
IconsPart of ProIcons
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
SavedPart of ProSaved
Support
DocumentationDocumentation
MCP serverMCP server
SettingsSettings
VaultBackgroundsCard Tunnel Hero
Card Stack TabsBrowse all 182Letter Fade Reveal
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
Sign inSign in

Start free. The code for 15 components, no card needed.

Get 15 free

Card Tunnel Hero

This one is locked. Become a member to open the code for it and the rest of the Vault.

See plansTry the 15 free ones

What you'll need.

Install

  • gsap
  • three

Setup

npm i gsapregisterPlugin(three)

More like this

  • Hero
  • Card
  • Infinite loop
  • 3D
  • Canvas
  • WebGL

Features.

  • A pinched slot grows in the middle of a dark, dotted hero, then picture cards burst out of it
  • Two lanes, left and right, with a new pair every 0.9s, flying to the edges and growing as they go, forever
  • The whole frame bends like the inside of a cylinder, so the strip bulges toward the sides
  • The tunnel starts full: both lanes are spread along their paths at the burst
  • Cards show a brand colour until their picture loads, never the same as their neighbour
  • Heading fades in after the burst, then any sentence or button you add
  • Pauses off screen and in background tabs, and the intro waits until the hero is first on screen
  • Without WebGL, or if the context is lost, it's a finished, static hero: slot and heading. The cards come back when the context does
  • If the scripts arrive late, the heading simply stays and the cards burst around them
  • Respects prefers-reduced-motion: one still frame of the settled tunnel

How to get it right.

Load GSAP and three.js first

The script reads window.gsap and window.THREE. Load both before code.js. Without them, the hero shows its settled slot and heading with no cards.

Use square pictures

Cards are square and show the whole picture, so crop to 1:1 first. Around 640px is plenty. List them as <li data-ctn-image data-src="…">; with fewer than there are cards they repeat, card n showing picture n mod the count. Same-origin paths always work; other hosts need CORS.

Keep the copy short

The heading sits above the slot, with the cards flying through below it. Two lines is the most it should take; longer copy runs into the tunnel.

A sentence and button are optional

It ships with the heading alone. To add them, put <p class="ctn_text"> and <a class="ctn_button"> inside .ctn_copy, or pass text and buttonLabel in React. They sit below the slot and fade in after the heading. Leave .ctn_copy in place when it's empty: it holds the heading above the slot.

Pace the flight

data-au-interval sets how often a pair launches and data-au-travel how long a card takes to reach the edge. Their ratio sets how many cards are in flight: faster launches with a long flight fill the tunnel, slow launches thin it out. The card count grows to match, so a launch is never skipped.

Retheme with variables

--ctn-slot and --ctn-dot colour the slot and dot grid. --ctn-card-1 to --ctn-card-6 are the colours cards show while loading; add --ctn-card-7 and on to extend the list. --ctn-fg, --ctn-muted and --ctn-bg set the text, any button and the page.

Variations.

  • Tunnel — the default: a pair every 0.9s, 9.6s flight, warp 0.7
  • Rush — data-au-interval="0.5", data-au-travel="6" for a fast, dense stream
  • Drift — data-au-interval="1.6", data-au-travel="14" for a slow, sparse gallery
  • Flat — data-au-warp="1": no cylinder bend, a straight strip

Where it fits.

  • Home page hero for a studio, shop or collection with a lot of imagery
  • Launch pages — a stream of product shots behind one line
  • Portfolio intros — every project flying past at once
  • Event pages — speakers, artists or venues on rotation

Frequently asked.

They show a --ctn-card-* colour until their picture loads. If they stay that way, the pictures can't be read: check the data-src paths, and serve cross-origin pictures with CORS.

The canvas couldn't start. Check that gsap and three load before the script (the console says [oomph] Card Tunnel: gsap or three.js not found after 10 seconds) and that the browser has WebGL.

Not as shipped: the cards are square and pictures are stretched to fit, so use square crops.

The intro plays once per init. Call window.au.CardTunnel.refresh(el) to play it again.

It's one WebGL scene of a couple of dozen quads plus one fullscreen pass, and it pauses when off screen. Keep one per page.

Related components.

NewPro

Squashy Bead Rods

Cursor

Pro

3D Image Sphere

Scroll

Pro

Cursor Smoke

Cursor