No.163 · Backgrounds
Glass Orbs
A honeycomb of glass marbles with light moving behind them; each orb flips the beam it looks through into a bright curl and a hot rim.
The prompt
Written for the variant you picked above: Violet
Write a WebGL1 full-screen fragment shader background (one triangle, no libraries): a honeycomb wall of glass marbles (9 across, about half that on phones) with light moving behind it. Behind the glass: three slow beams — Gaussian lines whose height is a sum of two sines across x, drifting at different speeds — three soft pools on slow Lissajous paths, and a lamp that follows the pointer (eased, fading in and out). Lay the orbs on a hex grid (the nearer centre of two offset square lattices), radius 47% of the spacing, with dark gaps between. Each orb is a ball lens: with r the normalised distance from its centre and z = √(1 − r²), the light is looked up at centre − offset·(1.9 − 0.9z) — flipped and gathered, as through a real marble — so a beam passing behind becomes a bright curl inside the ball. Brighten that light strongly toward the rim (pow(1 − z, 2.2)), push the hottest values toward white, add a faint glow from the light directly behind the centre, a tight specular highlight from the upper left and a slight shade toward the bottom so each orb sits on the wall. 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 — Violet (violet): Palette { glow #c25cff, deep #3a1a8a, ground #07040e }: neon violet light through dark violet 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 carries a lamp behind the wall; its light curls inside the nearest orbs. 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 carries a lamp behind the wall; its light curls inside the nearest orbs.
- 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.