Backgrounds · Component Template
Fluted Glass
A pane of reeded glass slides over a drifting mesh of color and a huge headline, breaking it into mirrored ribs. Drag the pane, tilt the flutes, or frost it.
Live demo
Drag the pane across the headline, then change the flutes, angle, frost, or colors.
The Prompt
Build a hero seen through reeded glass. A pane of fluted glass slides in from the right and stops just short of the middle. To its left the scene is plain: four soft fields of color drifting into one another, and a headline in letters as tall as the screen allows, "Hidden in plain sight." To its right the same scene comes through the glass, and the glass does what the real material does: every flute is a rod that shows a squeezed, mirrored strip of whatever lies behind its own axis, so the letters break into repeating ribs, colors slip apart at the edges, and a hard line of light runs down one shoulder of each flute. The visitor can drag the pane across the headline, tilt the flutes, change how many there are, frost the glass, and change the colors. It is one fragment shader with no images. The brand is fictional: Reed Glassworks. Match my project's existing stack, conventions, and design tokens. If there are none, output a single HTML file with inline CSS and JavaScript and zero dependencies. LOOK Full-bleed canvas. Top left the name at weight 600; top right "Drag the pane." Bottom left a dark glass dock (#0d0b14 at 70%, backdrop blur, hairline, radius 22px) with four labeled range sliders, each showing its value in tabular figures (Pane 44%, Flutes 34, Angle 0°, Frost 15%), and three round swatches for the colorways. Slider tracks are 3px hairlines with white 18px thumbs. Three colorways, each a background, four field colors and an ink for the type: - Dusk: #1a0f33; #ff5a36, #ff2e7e, #6a3df0, #ffc247; ink #fff7ea. - Pool: #04283a; #19d3c5, #2f6bff, #c8ff5a, #0a8f6f; ink #f4fffb. - Paper: #efe9df; #ff7a59, #ffd166, #7fb7ff, #f3a6c8; ink #17130f. Switching eases every color over about half a second. THE SCENE A function of screen position, so the glass can ask for it anywhere. - Color: four points drift on slow sines (periods of 25 to 60 seconds); the fourth leans 35% toward the pointer. Each contributes its color with weight 1 / (distance² + 0.03)^1.5, the background contributes with a constant weight of 5.5, and the result is the weighted mean. That gives fields that blend like a mesh gradient, with no banding and no texture. - Type: paint the headline white on black into a canvas the size of the drawing buffer (weight 800, letter-spacing -0.045em, two lines on wide screens, three on tall ones, fitted to the width with 3% margins) and mix toward the ink color by its value. Outside the canvas the type is absent. THE GLASS For pixels right of the pane's edge: - Turn the flute direction by the angle. With pitch = viewport width / flute count, s is the position across the flutes in pitches, i = floor(s) is which flute, t = fract(s) × 2 − 1 is where across it, from −1 to 1. - The strip a flute shows is centered on its own axis and mirrored: sample the scene at across-position i + 0.5 + 0.5 × bend × t with bend = −1.5. Do it three times with bend × 0.93, 1 and 1.07 and keep red, green and blue respectively: dispersion. - Frost: do all of that six times with t offset by a stratified random amount (one sixth of the range each, jittered per pixel) scaled by the frost setting, and a smaller random offset along the flute; average. Stratifying is what makes it read as blur and not as static. - Shade the glass itself: darken by 30% where |t| passes 0.7, tint by (0.965, 0.99, 0.985), lift by 0.035, add a gaussian streak of light 0.055 wide at t = −0.55 (its strength wavering slowly down the flute) and a broad faint one 0.95 to its right. Move both with the pointer by up to a quarter of a flute, so the light seems to come from where the visitor is. - The polished edge: a near-white line in the first 3px of the pane, a 22% shadow fading over the next 26px, and a 16% shadow on the clear side in the 30px before it. - Finish with a vignette and a little grain. BEHAVIOR - On load the pane starts just off the right edge and slides to 44% on a spring (stiffness 60, damping 11). - Dragging anywhere on the canvas moves the pane, keeping the offset between pointer and edge, between 6% and 94%. The Pane slider does the same from the keyboard and stays in step. - Flutes 8 to 72, angle −30° to 30°, frost 0 to 100%. Every control acts on the next frame. - Vertical touch pans scroll the page; horizontal ones move the pane. - Render at min(devicePixelRatio, 1.75) × a quality factor that drops by 0.1 after sixteen slow frames (to 0.5) and recovers after 240 fast ones. Pause off screen and when hidden. ACCESSIBILITY The canvas is hidden from assistive technology and a visually hidden h1 carries the headline. Every setting is a native range input with a visible label and value; the colorways are a labeled radio group named Dusk, Pool and Paper. With prefers-reduced-motion the colors stand still, the pane is already in place, and the picture is redrawn only when a control or the pointer changes it. If WebGL is unavailable, set the headline as real type over three radial gradients and cover the right 56% with a pseudo-element that has a backdrop blur, a white hairline on its left and a repeating linear gradient of light and dark stripes. NEVER - Never fake the glass with stripes over a blurred copy. The mirrored strip per flute is the whole effect. - Never leave out the clear side: the glass only reads as glass next to the thing it is hiding. - Never use per-pixel random blur without stratifying it. - Never animate the pane on its own after it has arrived. - No images, no fonts, no libraries, no network requests.
- CopyThe full prompt, one click.
- PasteInto Cursor, Claude Code, or any agent.
- CompareAgainst the live demo above.