No.182 · Backgrounds
Glass Blinds
Horizontal slats of glass with light behind them: each slat squeezes the glow into a bright band along its middle; the pointer moves a lamp behind them.
The prompt
Written for the variant you picked above: Indigo
Write a WebGL1 full-screen fragment shader background (no libraries): horizontal glass slats (8 rows, 4 on phones) with light behind them. Behind the glass: two broad, horizontally stretched glows drifting slowly across on unrelated sines, plus a lamp under the pointer (eased in and out). Within each slat let s run from −0.5 to 0.5 top to bottom: the slat is a long cylindrical lens, so the light is looked up at a squeezed, mirrored slice (y = centre − s·height·1.7). Shade each slat by cos(πs)^0.7, so it is brightest along its middle and falls into shadow toward the seams, mix the deep colour into the body and the glow colour where the light is strongest (less toward the edges), push the hottest values toward white, and darken a thin seam between slats. Moving the pointer slides a bright patch along the slats it is behind. 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 — Indigo (indigo): Palette { glow #8f9bff, deep #3a3fd6, ground #020208 }: electric indigo light through dark glass. 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 moves a lamp behind the slats; its light spreads along the slats it's behind. 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 moves a lamp behind the slats; its light spreads along the slats it's behind.
- 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.