Skip to content

No.04 · Buttons

Liquid Glass

A capsule of glass that bends what's behind it, carries a specular highlight around its rim toward your pointer, and squashes like a drop of liquid when pressed.

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: Pills

Make a glass button meant to sit over imagery. The capsule has a 10% white body and a backdrop filter of blur(10px) saturate(1.8) brightness(1.08); where SVG backdrop filters are supported, a second declaration prepends url(#lens) — an feTurbulence (0.008/0.012) → feDisplacementMap (scale 16) — so the scene behind bends softly like liquid glass (browsers that don't understand it keep the plain blur). Depth comes from stacked inset shadows: a bright 1px top edge, a faint lower edge, a hairline ring, a low inner glow, and a soft drop shadow. A specular highlight rides the rim: a pseudo layer with 1.25px padding, masked to just the ring (content-box xor), filled with a radial gradient centred on the pointer's --mx/--my, so the brightest point of the edge travels toward your finger. A faint internal caustic follows the same point. Pressing plays a 620ms jelly squash — scale(1.06, 0.9) → (0.97, 1.04) → (1.015, 0.99) → 1 — on a springy curve. Place it over a slowly drifting colourful scene (blurred radial blobs, 14s alternate drift, still under reduced motion) so there is something for the glass to bend. Selected variant — Pills (pill): Pills: two capsule buttons, "Get started" and a frost-tinted "Watch the film ↗" (tint "185 204 228"), over a blue/green/magenta scene on #0b1220. 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 it to steer the rim highlight; press to squash it. Motion: Specular follows the pointer via CSS variables; 620ms spring squash on press; 300ms hover tint. Accessibility: Real buttons with labels (icon buttons have aria-label, play toggles aria-pressed); text has a subtle shadow for contrast on busy backgrounds. Reduced motion removes the squash. Responsive behavior: Intrinsic width; round buttons are 52px square. Touch: Press squash works on touch; the rim rests at the top edge. 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 it to steer the rim highlight; press to squash it.
Motion
Specular follows the pointer via CSS variables; 620ms spring squash on press; 300ms hover tint.
Accessibility
Real buttons with labels (icon buttons have aria-label, play toggles aria-pressed); text has a subtle shadow for contrast on busy backgrounds. Reduced motion removes the squash.
Responsive
Intrinsic width; round buttons are 52px square.
On touch
Press squash works on touch; the rim rests at the top edge.