Momentum Skew Carousel
A draggable card row that skews with velocity, coasts on momentum, and springs onto the nearest card.

A momentum skew carousel is a row you drag. While it is moving fast, the whole row leans. When it slows, a spring pulls the offset onto a card boundary so the row never rests between two cards. The lean is not a CSS hover. It is the velocity of the drag, sprung so the skew eases in and out instead of popping when you grab and let go.
The draggable card carousel is the direct ancestor: it moves with the pointer. This one keeps moving after you release, and the skew tells you the speed. The magnetic button is the same family of “the pointer has mass”, applied to one control.
Offset, velocity, skew
Offset is in pixels and is allowed to run forever. The track is three copies of the same six cards. The painted translation is the offset wrapped into one set, so the row is endless without a jump.
function wrap(value) {
const w = setWidth();
return ((value % w) + w) % w;
}
track.style.transform = `translate3d(${-wrap(offset)}px,0,0) skewX(${skew}deg)`;
During a drag, offset follows the pointer and velocity is the last delta times 60, in pixels per second. On release, if the speed is above 40, offset keeps integrating and velocity decays with exp(-1.7 * dt). Under that speed, the spring targets Math.round(offset / stride) * stride. The handoff is the whole feel. Snap too early and the fling dies. Snap too late and the row drifts past the card you aimed at.
Skew’s target is velocity times 0.012, clamped to ±12 degrees. Its own spring (stiffness 80, damping 18) is why the lean does not tick on the first pixel of a drag. touch-action: none on the viewport keeps the browser from stealing the gesture for a scroll.
The cards
Six original color studies, repeated: clay, ink, sand, moss, paper, dusk. Each card is a number, a name, and one sentence. The type is in the card. The motion is the row. Skewing the track skews every card together, which reads as one object in motion. Skewing each card by a different amount looks like a bug unless you are building a fan.
Until the first pointer down, a small constant velocity plays so the preview is already moving. The first drag sets a flag and the auto drift stops. It does not fight the user.
Reduced motion and a failed gesture
Under reduced motion the skew stays at 0. The row can still be dragged and still settles on a card, because the settle is navigation, not decoration. If you would rather the reduced-motion version be a static row with next and previous buttons, add those buttons and skip the velocity integration. The demo keeps the drag, since that is how you reach the next card.
Clicks on a card are a separate question. This row does not open anything. If a card becomes a link, ignore the click when the pointer moved more than a few pixels. Otherwise every fling is also an accidental visit.
Questions about momentum carousels
How do I add inertia to a drag carousel?
On pointer move, store the drag delta as a velocity in pixels per second. On release, keep adding velocity * dt to the offset and multiply velocity by a decay each frame. When the speed falls under a threshold, spring the offset to the nearest card width.
How do I skew cards based on scroll or drag speed?
Set the skew target from the velocity, clamped to a small angle, and run that target through its own damped spring. Writing skewX from the raw delta makes the row twitch at the start and end of the gesture.
How does an infinite drag row avoid a visible seam?
Repeat the card set two or three times and wrap the translation with modulo of one set’s width. The spring runs in unwrapped pixel space. Only the paint is wrapped. If you wrap the value the spring is chasing, the target jumps by a full set and the row slams.