No.164 · Backgrounds
Liquid Chrome
A pool of molten metal that folds over itself and mirrors a studio of soft coloured light; the pointer drops a ripple into it.
The prompt
Written for the variant you picked above: Lilac
Write a WebGL1 full-screen fragment shader background (no libraries): molten chrome that slowly folds over itself. The surface is a height field — four-octave value-noise fBm, domain-warped once and drifting slowly in time. Take finite differences for a normal, reflect the view ray off it, and look the reflection up in a soft studio: a dark floor below, a wall that fades from the deep colour into the glow colour across one side, a bright horizontal strip light overhead and a thinner vertical strip at the left. Because every point reflects the room, the colour bands slide, pinch and stretch as the metal flows. Add a little Fresnel whitening at grazing angles and darken the low parts of the folds. The pointer drops a ripple: a decaying sine ring (30–35 per unit, travelling outward over time, falling off with distance) added to the height, eased in and out as the pointer enters and leaves, so the reflections shiver around it. Render at 0.85× (0.6× and ~30fps on touch), pause offscreen and in hidden tabs, draw one still frame under reduced motion, and fall back to CSS gradients without WebGL. Children sit above the canvas. Selected variant — Lilac (lilac): Palette { glow #b9a6ff, deep #2b2f45, ground #0b0c10 }: silver chrome reflecting a lilac-lit studio. 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: The pointer drops a ripple into the metal; the reflections shiver around it. Motion: Continuous slow drift in the shader; the pointer effect eases in at 0.06 and follows with a 0.12 lerp. Accessibility: Decorative and aria-hidden. Reduced motion renders one still frame. Use a scrim for text; highlights can be bright. Responsive behavior: Fills its container; the density drops to about half on screens under 640px; DPR capped at 2. Touch: No pointer effect on touch; the light keeps moving on its own. 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
- The pointer drops a ripple into the metal; the reflections shiver around it.
- Motion
- Continuous slow drift in the shader; the pointer effect eases in at 0.06 and follows with a 0.12 lerp.
- Accessibility
- Decorative and aria-hidden. Reduced motion renders one still frame. Use a scrim for text; highlights can be bright.
- Responsive
- Fills its container; the density drops to about half on screens under 640px; DPR capped at 2.
- On touch
- No pointer effect on touch; the light keeps moving on its own.