Skip to content

No.208 · Backgrounds

Dusk Mesh

The soft mesh gradient done properly: five colour points drifting and blended by distance, folded so the blend bends like silk, with crisp film grain and no banding. The colour nearest your pointer leans toward it on a spring.

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: Muscat dusk

Write a WebGL1 mesh-gradient background that holds up at full screen. Five colour points (uniform vec2 and vec3 arrays) drift on slow, unrelated sine paths computed in JS. In the shader, fold the space with two small sine warps of different frequencies so the boundaries between colours bend like cloth, then blend by inverse-distance weighting: each point's weight is 1 / (d² + 0.02)^1.6, plus a small constant weight for a base colour so the gaps never go muddy. Dither by one 8-bit step to remove banding. The colour point nearest the pointer leans toward it — 55% of the way — on a spring (stiffness 26, damping 7) per point, and lets go when the pointer leaves, so the light seems to follow you. Render the smooth field at half resolution, but put the grain in a separate CSS layer above the canvas (a tileable SVG feTurbulence data URL, overlay blend), so it stays crisp at any scale. ~40fps on desktop, ~25 on touch; stop requesting frames offscreen or in hidden tabs; draw one frame under reduced motion; fall back to layered CSS radial gradients without WebGL. Colours are a prop [base, five points]. Selected variant — Muscat dusk (dusk): Colours [#1a1226 base, #e8774f, #f2b880, #7b5ea7, #2e3a87, #f04f6b]: a Muscat sunset — coral, apricot, violet, indigo and pink over plum; grain 0.5; text white. 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 nearest colour leans toward the pointer on a spring, and settles back when it leaves. Motion: Points drift on 35–60s cycles; the fold drifts more slowly; the lean is a damped spring. Accessibility: The canvas and grain are aria-hidden and decorative; content sits above them. Reduced motion draws one still frame. Responsive behavior: Fills its container; the field renders at half resolution and the grain at native resolution. Touch: No lean on touch; the colours still drift. 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 nearest colour leans toward the pointer on a spring, and settles back when it leaves.
Motion
Points drift on 35–60s cycles; the fold drifts more slowly; the lean is a damped spring.
Accessibility
The canvas and grain are aria-hidden and decorative; content sits above them. Reduced motion draws one still frame.
Responsive
Fills its container; the field renders at half resolution and the grain at native resolution.
On touch
No lean on touch; the colours still drift.