Skip to content

No.113 · 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

Copy this text

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

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): Dusk scene: base #140c1d behind blurred blobs of coral #ff7a59, violet #8b5cf6, gold #f5c26b and pink #e0457b; default warm gradient artwork. This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. 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: 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 behavior: Up to 22.5rem wide, shrinking to fit; the lens map is rebuilt whenever the size changes. Touch: The rim highlight rests at the top-left; everything else works by tap. 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
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.