Quick Start
1. Add to your HTML <head>:
Code snippet omitted: it ships with the download.
2. Add before closing </body> tag:
Code snippet omitted: it ships with the download.
3. Add the effect HTML anywhere in your <body>:
Code snippet omitted: it ships with the download.
Copy the complete six-card composition from index.html; the abbreviated block above shows the required structure without repeating every card.
Pre-fill the caption and counter with the first card's details so the page reads correctly before the script runs.
Options
All options are data attributes on the .ring-gallery wrapper.
| Attribute | Values | Default | Description |
|---|---|---|---|
data-drag-speed |
Any number | 0.25 |
Degrees of ring rotation per pixel of drag. Higher = faster spin. |
data-snap |
true, false |
true |
Elastic-snap to the nearest card after a throw. false leaves the ring wherever momentum stops it. |
data-tilt |
Number (degrees) | 7 |
Maximum rotationX tilt the ring takes under speed. 0 disables the tilt channel. |
data-blur |
Number (px) | 6 |
Maximum motion blur cards catch under speed. 0 disables the blur channel. |
data-dim |
0 to 1 |
0.55 |
How much cards dim as they face away from the viewer. 0 disables depth dimming. |
data-radius |
Number (px) | auto | Explicit cylinder radius. Leave unset to derive it from the card width and count. |
data-detail |
true, false |
false |
Turn the cards into buttons that open a Flip detail lightbox on click. Requires the Flip plugin. |
Per-card attributes
| Attribute | Description |
|---|---|
data-title |
Caption title shown when this card settles at the front; also the detail panel heading |
data-sub |
Caption subtitle line for this card; also the detail panel edition/meta line |
data-desc |
Description paragraph shown in the detail panel. Detail mode only (data-detail="true"). |
Card and stage sizing
Card size and stage height are CSS variables on .ring-gallery; the script derives the cylinder radius from the card width, so resizing these rescales the whole ring:
Code snippet omitted: it ships with the download.
The stylesheet already reduces these at 640px so the ring fits phone viewports.
Touch Behaviour
Only horizontal-dominant gestures spin the ring. A vertical swipe that starts on the ring scrolls the page, courtesy of Draggable's allowNativeTouchScrolling and delta-based rotation (the script never maps an absolute pointer position to the ring, so a reclaimed scroll gesture can't yank it back to the start).
Accessibility
- Keyboard: the stage is focusable; left and right arrow keys rotate the ring one card at a time with the same caption reveal
- Screen readers: an
aria-liveregion announces the settled card ("Solstice Drift, 1 of 8"); the stage carriesrole="group"andaria-roledescription="carousel" - Reduced motion:
prefers-reduced-motion: reducegets a static ring with the front card and caption fully visible; arrow keys still work with instant jumps and no momentum, blur, or tilt - No JavaScript: the cards render as a flat, scrollable row; nothing on the page is hidden behind a script
Detail view (data-detail="true")
- Keyboard: cards are real
<button>s, so Enter and Space open them; the panel takes focus on open, Escape closes it, and focus returns to the card that was opened - Dialog semantics: the panel carries
role="dialog"andaria-modal="true"and is labelled by the print title; a real close button (aria-label) sits top-right, and clicking the backdrop also closes - Reduced motion / no Flip: the panel still opens and closes, just instantly (no Flip morph, no staggered text); nothing is ever left stuck at
opacity: 0 - Scrolling: the panel has
data-lenis-preventso its internal scroll on small screens stays native under Lenis
Dependencies
Required:
- GSAP 3.12+
- Draggable plugin
- InertiaPlugin
Required for the detail view only (data-detail="true"):
- Flip plugin
All three plugins are on the public GSAP CDN (formerly Club-only; free since GSAP joined Webflow). A gallery without data-detail runs without Flip loaded.
Worked examples, the events and programmatic API, and the class reference ship with the download, alongside the full source.