Skip to content

No.69 · Cards

Liquid Glass Card

A now-playing card of thick glass: clear in the middle, bending the scene behind it more and more toward its edges, with a highlight that rides the rim toward your pointer.

The prompt

Written for the variant you picked above: Dusk

Build a now-playing card (22.5rem, 28px radius) made of thick glass over a colourful scene. Base glass: 8% white, backdrop blur and saturation, an inner top highlight, a faint inner ring and a soft lower inner glow. In Chromium, add real edge refraction. Measure the card with a ResizeObserver and build a displacement map as an SVG data URL at exactly that size: black, a left→right red gradient, a top→bottom blue gradient blended with difference, and a neutral grey rounded rect inset 22px and blurred, so the middle maps to 'no shift' and the offsets ramp up only across the bezel. Feed it through feImage into feDisplacementMap (scale −64, R for x, B for y) and apply it with backdrop-filter: url(#lens) blur(5px) saturate(1.7). Other browsers keep the plain blur. A 1.25px rim, made with a content-box mask, carries a radial highlight placed at the pointer, with a matching soft caustic inside. Content: a gradient artwork tile, 'Now playing' in mono caps, title and artist, a slim range scrubber whose filled part is a gradient stop at --p, elapsed and remaining times, back 15 / play-pause / forward 30, and an 'Up next' line. The play button is a smaller drop of glass that squashes (1.12 × 0.86, springing back) when pressed. Selected variant — Dusk: Dusk scene: base #140c1d behind blurred blobs of coral #ff7a59, violet #8b5cf6, gold #f5c26b and pink #e0457b; default warm gradient artwork.

Notes

Interaction
Move over the card and the rim's highlight follows you. Play and pause, skip, or drag the scrubber.
Motion
Rim highlight tracks the pointer directly; play squish 620ms spring.
Accessibility
An article named 'Now playing: title by artist'. The scrubber is a native range with a spoken value like '1:12 of 3:48'; every control is a labelled button. Reduced motion removes the squish.
Responsive
Up to 22.5rem wide, shrinking to fit; the lens map is rebuilt whenever the size changes.
On touch
The rim highlight rests at the top-left; everything else works by tap.

Featured

301 components