Take the carousel and make the slides glide. Same single index, same wrap — but instead of swapping the visible slide, lay all slides in a row inside a clipped viewport and shift that row with transform: translateX(-index * 100%). A CSS transition on the transform animates the move.
// A self-contained component. No props.
function App(): JSX.Element;
A clipped viewport with a sliding track of all slides.
index 1 -> track shifts to translateX(-100%), animating from 0%
index 2 -> translateX(-200%); the transition eases between them
viewport: overflow hidden; track: flex row, each slide flex 0 0 100%
transform: translateX(-index * 100%) on the track; the index math is unchanged.transition: transform … makes the shift glide — no JS animation loop.