Skip to content

No.118 · Cards

Lenticular Card

Two images interleaved behind ribbed plastic, like a lenticular print — tilt it and the stripes hand over from one to the other.

The prompt

Copy this text

Automatic copying is unavailable. Copy the selected text using your device’s copy command.

The design brief behind this component — reuse it to regenerate, remix, or explain it.

Design a two-state card that behaves like a lenticular print instead of a flip card. Stack two full-bleed faces (e.g. a poster at dawn and the same poster at night) in a 3:4 card with 18px radius and a deep shadow. Mask both faces with the same fine vertical stripe pattern (6px pitch) using repeating-linear-gradient masks driven by one CSS variable --t: in every stripe, the front owns the first (1 − t) of the pitch and the back owns the rest. At t = 0 you see only the front, at t = 1 only the back, and in between the two images interleave in thin slivers — exactly the ghosted handover of a real lenticular. Over the top, add ribbed plastic: a repeating highlight-and-shadow gradient per stripe in overlay blend, and a broad band of sheen that slides across the ribs as the card tilts. Map the pointer's x position to --t through a smoothstep across the middle third, so the handover happens as you "turn" the card past centre; tilt the card ±9° with the pointer and shift the two faces a few pixels in opposite directions for parallax. On touch, drag horizontally to turn it and it settles to the nearest side on release; on keyboard, arrow keys or Enter/Space turn it with a 500ms settle. Screen readers are told which side is showing. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Pointer x (or horizontal drag, or ←/→/Enter) turns the card; the stripes hand over between the two faces across the middle band. Motion: Continuous while tracking; 500ms ease-out-expo settle on leave, release or key press. Accessibility: Focusable group with a descriptive label that states the visible side; the hidden face is aria-hidden. Arrow keys and Enter/Space work. Reduced motion removes tilt and sheen (the stripe handover itself is the content, so it stays). Responsive behavior: Fluid up to 20rem at a fixed 3:4 ratio; stripe pitch is a prop. Touch: Horizontal drag turns the card and snaps to the nearest side; vertical scrolling still works (touch-action: pan-y). Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.

Notes

Interaction
Pointer x (or horizontal drag, or ←/→/Enter) turns the card; the stripes hand over between the two faces across the middle band.
Motion
Continuous while tracking; 500ms ease-out-expo settle on leave, release or key press.
Accessibility
Focusable group with a descriptive label that states the visible side; the hidden face is aria-hidden. Arrow keys and Enter/Space work. Reduced motion removes tilt and sheen (the stripe handover itself is the content, so it stays).
Responsive
Fluid up to 20rem at a fixed 3:4 ratio; stripe pitch is a prop.
On touch
Horizontal drag turns the card and snaps to the nearest side; vertical scrolling still works (touch-action: pan-y).