Cards are placed by computing each one's offset (= card index − active index) from a single active index. The card at offset 0 faces forward — rotateY(0), scale(1) — while cards farther out (±1, ±2…) tilt via rotateY(±45–60°), shift sideways with translateX, and shrink and fade with distance. Perspective on the parent is non-negotiable — without it, rotateY just squashes a card into a flat rectangle.
The trick is stacking order — a card closer to center must always render on top for the overlap to read correctly. Adding depth with translateZ(−|offset| × k) actually moves each card farther from the camera, so the browser's own depth sorting handles the order for you.
When the active index changes, updating every card's transform at once inside a single CSS transition produces the "flip through" animation automatically — no need to animate each card individually.
When to use
Use it for galleries where one item is the focus while the next/previous peek in — albums, portfolios. If there are many items and users need to scan fast, a grid works better; coverflow only shows one item seriously at a time.