The row of daily games on the richi.codes home page is a coverflow, and JavaScript doesn't calculate any of the motion. As you scroll it, the cover in the middle faces you with an orange glow, and the others turn away in 3D, shrink and darken. The browser does all of that with scroll-driven animations. The demo above is a standalone copy of the same technique. Scroll it, tick "Show timeline %" to see the number each cover is animating with, and move the tilt slider.
What you see, and what drives it
On the site, the shelf lives in components/Bento/GameShelf.jsx, with its styles in styles/globals.css. Underneath, it's an ordinary horizontal list: overflow-x: auto, scroll-snap-type: x mandatory and scroll-snap-align: center on each slide. That part works on its own, in any browser.
The 3D comes from a view progress timeline. MDN describes it as a timeline that "progresses based on changes to the visibility of an element (the subject) within a scrollable element". For a horizontal row, the axis has to be inline, because the default is block. MDN's guide sets out the scale: 0% is when the subject starts to enter at the end edge of the scrollport, and 100% is when it leaves through the start edge. In a left-to-right row, a cover is at 0% when it peeks in on the right, at 50% in the middle, and at 100% when it disappears on the left. Turn on the percentages in the demo and you'll see the centered cover at 50.
So the whole effect fits in one set of keyframes with a 50% stop:
.slide {
view-timeline: --cover inline; /* a named timeline on each slide */
animation: stack 1ms linear both;
animation-timeline: --cover; /* after the shorthand */
}
.card {
animation: flow 1ms linear both;
animation-timeline: --cover; /* the child reads its parent's timeline */
}
@keyframes flow {
0% { transform: perspective(900px) translateX(-50%) rotateY(-60deg) scale(.74); }
50% { transform: perspective(900px) translateX(0) rotateY(0deg) scale(1); }
100% { transform: perspective(900px) translateX(50%) rotateY(60deg) scale(.74); }
}
@keyframes stack { 0%, 100% { z-index: 1; } 50% { z-index: 30; } }
The real site has more stops: at 38% and 62% the covers are already turned 44 degrees, so the turn happens close to the center. In the demo the angle comes from a --tilt custom property that the slider changes.
Two details come straight from MDN. animation-timeline goes after the animation shorthand, because the shorthand resets it to auto and can't set it. And the duration is 1ms, because Firefox needs a non-zero animation-duration to apply the animation.
Why a named timeline and not view(inline)
The anonymous version, animation-timeline: view(inline), is shorter, and it works when the element you animate is the one being tracked. The shelf needs something else: one timeline per slide that drives five animations. Those are the card's 3D turn, the glow (a ::before), the shade over the image, the opacity of the title and caption, and the z-index of the slide itself, so the centered cover sits on top of its neighbors. MDN notes that the animated element "doesn't have to be" the subject. The spec explains why the children can see the name: when an element looks up a timeline name, it checks itself first and then walks up its ancestors. view-timeline: --cover inline on the li is therefore visible to everything inside it.
The note Dr. Kernel left with this change gave another reason: if you transformed the li itself, you'd move the box being measured. The spec says otherwise: when computing view progress, "Transforms are ignored". The good reason is the one above: one measurement, five consumers.
The effect is optional, the navigation isn't
All of the motion sits behind two conditions:
@media (prefers-reduced-motion: no-preference) {
@supports ((animation-timeline: view()) and (animation-range: entry)) {
/* the rules above */
}
}
Chrome's Modern Web Guidance recommends the second check (animation-range: entry) because it filters out browsers with only partial support. Without the effect you get a flat row with snap, which is just as usable. Untick "3D effect" in the demo to see it.
What does use a little JavaScript is what shouldn't depend on a decorative effect: previous and next buttons that are real <button> elements with a name, a counter, and a role="status" region that announces "Game 3 of 16: Title" once scrolling stops. It listens for scrollend, and falls back to scroll plus a short timeout where that event doesn't exist. Two things came up when the shelf was tested in three browsers:
- An extra tab stop. Firefox made the scrolling row a tab stop of its own, even though each cover is already a link. The list has
tabindex="-1". - Focus fights the centering. When you tab to a cover, the browser scrolls it into view on its own and overrides the centering. Centering it on the next
requestAnimationFramefixes it. The demo uses the same trick.
Browser support and gotchas
- Support: Chrome and Edge 115, Safari 26 and Firefox 159. The Firefox 159 release notes list scroll-driven animations as "now enabled by default", and web-features has marked them Baseline "newly available" since October 27, 2026. Anyone who hasn't updated gets the flat row. In those browsers the demo also shows a notice.
overflowon the track decides everything. MDN warns that if the scroller doesn't overflow on that axis, or its overflow is hidden or clipped, no timeline is created. If the row fits on screen, nothing turns.- The
%readout is a registered integer.@property --p { syntax: "<integer>" }is animated from 0 to 100 on the same timeline and printed withcounter(). In my WebKit test,getComputedStylereturned decimals (84.91) where Chromium returned 85. The centered cover showed 50% in both.
What to keep an eye on
- "Widely available" status. Baseline "newly available" means every engine ships it, not that every user has updated. The flat fallback costs nothing, so keep it.
timeline-scope. If you ever need the timeline from an element that isn't a descendant (a separate indicator outside the list, say), the spec lets you lift the name to a shared ancestor withtimeline-scope.- The spec is still an Editor's Draft. The basics shown here work today in all three engines, but there are still open issues.