A silky Apple/Aesop-grade horizontal 3D Coverflow carousel where side cards rotate inward along Y-axis perspective as you swipe — replacing heavy Swiper/GSAP 3D sliders with ~25 lines of native CSS view(inline) and scroll-snap.
/* 1) Paste once in globals.css (works standalone or inside shadcn/ui Carousel / Embla — 0 KB scroll JS)
@keyframes cf-turn {
0% { opacity: 0.42; z-index: 1; transform: perspective(900px) translateX(-22px) rotateY(-46deg) scale(0.82); }
32% { opacity: 0.90; z-index: 4; transform: perspective(900px) translateX(-4px) rotateY(-24deg) scale(0.92); }
50% { opacity: 1; z-index: 12; transform: perspective(900px) translateX(0) rotateY(0deg) scale(1.04); }
68% { opacity: 0.90; z-index: 4; transform: perspective(900px) translateX(4px) rotateY(24deg) scale(0.92); }
100% { opacity: 0.42; z-index: 1; transform: perspective(900px) translateX(22px) rotateY(46deg) scale(0.82); }
}
@supports (animation-timeline: view()) {
@media (prefers-reduced-motion: no-preference) {
.cf-slide { view-timeline-name: --cf-slide; view-timeline-axis: inline; }
.cf-card {
animation: cf-turn linear both;
animation-timeline: --cf-slide;
animation-range: cover 0% cover 100%;
}
}
}
*/
// 2) Drop-in React + Tailwind 3D Coverflow Carousel (replaces Swiper 3D JS)
'use client'
import { useRef } from 'react'
export interface CoverflowItem {
id: string
tag: string
title: string
subtitle: string
meta: string
imageSrc?: string
}
const DEMO_ITEMS: CoverflowItem[] = [
{ id: '1', tag: 'TITANIUM', title: 'Chrono Field 38mm', subtitle: 'Brushed Grade-5 Titanium', meta: '$680' },
{ id: '2', tag: 'PARFUM', title: 'Cedar & Fig N°09', subtitle: 'Hand-blown Amber Glass', meta: '$240' },
{ id: '3', tag: 'FLAGSHIP', title: 'Atelier Acoustic One', subtitle: 'Anodized Spatial Speaker', meta: '$420' },
{ id: '4', tag: 'STUDIO', title: 'Reference Air Pro', subtitle: 'Lambskin · 42h Battery', meta: '$540' },
{ id: '5', tag: 'LIGHTING', title: 'Solstice Desk Lamp', subtitle: '2700K Opal Glass · Brass', meta: '$310' },
]
export function CoverflowCarousel({ items = DEMO_ITEMS }: { items?: CoverflowItem[] }) {
const trackRef = useRef<HTMLDivElement>(null)
const scrollToSlide = (idx: number) => {
const slides = trackRef.current?.querySelectorAll<HTMLElement>('[data-cf-slide]')
slides?.[idx]?.scrollIntoView({ inline: 'center', block: 'nearest', behavior: 'smooth' })
}
return (
<div className="relative w-full overflow-hidden rounded-3xl border border-stone-200 bg-[#f4efe7] py-8 dark:border-white/10 dark:bg-[#080b12]">
<div
ref={trackRef}
className="flex snap-x snap-mandatory gap-4 overflow-x-auto scroll-smooth px-[calc(50%-118px)] py-4 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
>
{items.map((item, idx) => (
<div key={item.id} data-cf-slide className="cf-slide w-[236px] shrink-0 snap-center">
<article
onClick={() => scrollToSlide(idx)}
className="cf-card relative flex h-[316px] cursor-pointer flex-col overflow-hidden rounded-2xl border border-stone-200/80 bg-white shadow-xl dark:border-white/10 dark:bg-[#121724]"
>
<div
className="relative m-2.5 h-44 rounded-xl"
style={{ background: `linear-gradient(135deg, #c87d3233, #0f766e33)` }}
>
{item.imageSrc && (
<img src={item.imageSrc} alt={item.title} className="h-full w-full rounded-xl object-cover" />
)}
<span className="absolute left-2.5 top-2.5 rounded-full bg-slate-950/65 px-2.5 py-1 font-mono text-[10px] font-semibold text-white backdrop-blur">
{item.tag}
</span>
</div>
<div className="flex flex-1 flex-col justify-between px-3.5 pb-3.5 pt-1">
<div>
<h3 className="truncate text-sm font-semibold text-stone-900 dark:text-white">{item.title}</h3>
<p className="truncate text-xs text-stone-500 dark:text-slate-400">{item.subtitle}</p>
</div>
<div className="flex items-center justify-between border-t border-stone-200/70 pt-2.5 dark:border-white/10">
<span className="font-mono text-xs font-semibold text-stone-900 dark:text-white">{item.meta}</span>
<span
className="rounded-full px-2.5 py-1 font-mono text-[10px] font-semibold text-white"
style={{ background: `linear-gradient(135deg, #c87d32, #0f766e)` }}
>
Inspect →
</span>
</div>
</div>
</article>
</div>
))}
</div>
</div>
)
}Loading single-file HTML…
Build a single-file interactive 3D Coverflow Horizontal Carousel powered by Pure CSS Scroll-Driven Animations (view-timeline-axis: inline + animation-timeline, Baseline Oct 2026) and CSS scroll-snap-type: x mandatory with zero JavaScript scroll listeners on a warm daylight editorial surface (#f4efe7) with a Dark Studio toggle. - Pure CSS Inline 3D Coverflow: Give each snapped slide wrapper view-timeline-name: --cf-slide and view-timeline-axis: inline, then animate its inner card with @supports (animation-timeline: view()) across perspective(920px) rotateY(-46deg → 0deg → +46deg), scale(0.84 → 1.04 → 0.84), z-index elevation, and brightness/opacity feathering so flanking cards angle cleanly toward the centered hero card. - Multi-Vertical Real-World Showcase: Include a live switcher across 3 practical decks — E-Commerce Lookbook (products with prices & edition badges), Travel Destinations (sunlit horizons & flight durations), and Portfolio Case Studies — plus Curve Angle presets (28° / 46° / 64°), click-to-center side cards, Prev/Next buttons, ←/→ keyboard navigation, and an Auto-Glide demo toggle. - Library Drop-In & A11y: Zero CDN dependencies, clean @supports + prefers-reduced-motion fallback, and a copy-paste React + Tailwind / shadcn Carousel (Embla) drop-in snippet.
WHY THIS WORKS IN PRODUCTION
- Pure CSS view-timeline-axis: inline + scroll-snap — replaces heavy 40 KB Swiper 3D JS bundles
- Live multi-vertical preview: E-Commerce Lookbook, Travel Destinations & Portfolio Case Studies
- Click any angled side card, swipe on mobile touch, press ←/→, or adjust 28°/46°/64° curve angle
- Drop-in CSS utility works standalone or layered onto shadcn/ui Carousel (Embla) with @supports fallback
DROP-IN SPECS // WEB & MOBILE FIT








