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
VaultGallery & imagesWebGL Card Carousel
Self-Drawing RouteBrowse all 182Pluckable Divider List
  • 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

WebGL Card Carousel

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
  • Draggable
  • InertiaPlugin
  • three

Setup

npm i gsapregisterPlugin(Draggable, InertiaPlugin, three)

More like this

  • Card
  • Carousel
  • Velocity
  • Marquee
  • Infinite loop
  • 3D
  • Draggable
  • Canvas
  • WebGL

Features.

  • An endless row of picture cards along the bottom of a full-screen section, drawn in three.js
  • Drifts sideways on its own and pauses while the pointer is over it
  • Grab and throw it: the row coasts and settles with inertia
  • The hovered card lifts, grows and brightens; its neighbours part around the pointer and spring back with a little overshoot
  • Fast throws pull the colour apart into an RGB split; a fine grain sits over the row
  • A panel mirrors the hovered card (or the one in the centre on touch), with its picture and title
  • Motion runs in fixed 60Hz steps, so it feels the same on any refresh rate, and pauses off screen
  • Without WebGL the cards show as a plain strip that scrolls sideways
  • Respects prefers-reduced-motion: one still frame, no drift or throw

How to get it right.

Load GSAP, Draggable, InertiaPlugin and three.js first

The script reads window.gsap, window.Draggable, window.InertiaPlugin and window.THREE. Load all four before code.js; until they arrive the plain strip shows.

Use 3:4 pictures

Cards are 3:4 and cover-fit the centre of each picture. Pre-crop tall or wide pictures so the subject sits in the middle. Around 600 × 800px is plenty. Same-origin paths always work; other hosts need CORS.

Six to thirteen cards

The row has 26 slots and repeats your cards to fill them, so 13 cards appear twice. Fewer cards repeat more often; keep at least six so repeats aren't side by side.

Write a title for every card

Each [data-dgl-card] carries data-title; the panel shows it. Without it the picture's alt text is used.

Adding the extras

It ships with pictures and titles only. For a meta line and the card's number, put data-meta on each card and [data-dgl-panel-meta] and [data-dgl-panel-idx] spans in the panel text. For a heading, sentence and button, add a .dgl_head holding .dgl_title, .dgl_text and .dgl_button; for the faint word, a .dgl_ghost (React: meta on the cards, title, text, buttonLabel, ghost).

Retheme with variables

--dgl-accent and --dgl-on-accent colour the optional button, --dgl-fg, --dgl-muted and --dgl-faint the text, --dgl-bg the page. The optional faint word is --dgl-fg at 4%.

Variations.

  • Drift — the default: drift 0.007, part 2.4, split 0.9, grain 0.04
  • Still shelf — data-au-drift="0": the row only moves when thrown
  • Clean — data-au-split="0", data-au-grain="0" for crisp cards with no post effects
  • Crowd — data-au-part="4.8" so neighbours leap well clear of the hovered card
  • Busy — data-au-drift="0.016" for a faster conveyor

Where it fits.

  • Archive or portfolio landing — every project in one throwable row
  • Shop collections — products drifting past, with the panel as a quick look
  • Editorial index — stories or issues with a title and date per card
  • Studio home page — a playful second section under the hero

Frequently asked.

That's the fallback. Check that gsap, Draggable, InertiaPlugin and three load before the script (after 10 seconds the console says [oomph] Drift Gallery: gsap, Draggable, InertiaPlugin or three.js not found) and that the browser has WebGL.

Not as shipped: a drag and a click share the band. Put the link on the panel or the button instead.

Yes. A finger drag throws the row sideways and vertical swipes still scroll the page (touch-action: pan-y). The panel follows the card nearest the centre.

It's 26 quads, one render target and a post pass, drawn every frame while on screen and paused off screen. Keep one per page.

Related components.

Pro

File Drawer Cards

Hover

Pro

Capsule Image Hero

Click

Pro

Depth Fly-Through Hero

Load