Skip to content

No.71 · Cards

Depth Card

A destination card that is a little diorama: tilt it and the sky, ridges and foreground slide past each other at different speeds.

The prompt

Written for the variant you picked above: Dusk

Build a destination card (21rem, 4:5, 24px radius, one link) that works like a diorama. The picture is an SVG landscape built in layers — a sky gradient, a sun with a soft glow, far ridges, mid ridges, a near ridge with a small village on the rim, and a foreground of rocks and a palm — each layer in its own group. Pointer position over the card (−1…1 on both axes) is smoothed on a spring (stiffness 0.09, damping 0.78) and written to --px/--py; each layer translates opposite the pointer by its depth (4px for the sun up to 46px for the foreground, 60% as much vertically), the whole card tilts in perspective (±7° Y, ±6° X), a soft-light highlight follows, and the text block drifts a little the other way. Leaving springs it back. The scene is drawn 6% oversize so edges never show. The text sits on a bottom gradient: a frosted badge, an Instrument Serif title and a meta line. The loop sleeps once settled; reduced motion keeps it flat. Selected variant — Dusk: Dusk: a violet-to-apricot sky (#2b1b4a → #f29b6b), pale gold sun, ridges stepping from mauve (#a8607a) through plum to near-black violet, warm white text.

Notes

Interaction
Move across the card to tilt it and open up the layers; leave and it settles.
Motion
Spring stiffness 0.09, damping 0.78; layer travel 4–46px by depth; tilt ±7°.
Accessibility
One link with a real heading; the illustration is aria-hidden. Reduced motion keeps the card still.
Responsive
Fills narrower screens up to 21rem and keeps its 4:5 shape; the SVG crops to cover.
On touch
No tilt on touch; the card is a normal tappable link.

Featured

301 components