Design.dev design.dev
Backgrounds · Component Template

Dither Shader Background

A living risograph print in two spot inks, every tone made of ordered-dither dots and moving at twelve frames a second. The sun rises from behind the hills as it loads.

Live demo

Output of this prompt · Claude Fable 5.2 · WebGL

Move across the print to ink it, click to send a ring, or change the inks.

The Prompt 1,095 words

Build a hero whose background is a living risograph print: a sun and four ridges of hills, drawn in exactly two spot inks on warm paper, every tone made of ordered-dither dots, the whole thing moving at twelve frames a second like cel animation. The sun rises from behind the hills on load, the ridges drift past each other, the pointer inks the sheet in the second color, and changing inks wipes across the print with a dithered edge. The studio is fictional: Second Shift Press, a risograph shop in Glasgow. It should look printed, not rendered, and it should be obvious the print is alive.

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
Paper #EAE6DC. Two inks at a time, held in two registered color custom properties so the type can change ink with the print: ink A (drawing and type) #2A4BD7, ink B (sun and accents) #FF4FA0. Alternate pairs: teal #00766E with sunflower #FFAE0D, and black #1D1D1B with bright red #F2493D. Headline "Two inks. No undo." in the heaviest grotesque available (Arial Black fallback), clamp(42px, min(8vw, 12.5vh), 112px), line-height 0.9, letter-spacing -0.045em, in ink A, top left. Everything is square-cornered with 2px ink A borders: a filled button, an outline button, a small slip bottom left with three two-color chips for choosing the ink pair, and a slip bottom right with a registration mark and a sheet counter ("Sheet 142 of 500") that ticks up every 1.4s. No shadows, no gradients, no rounded corners anywhere in the HTML.

THE PRINT (one fragment shader, raw WebGL)
Render to a deliberately small canvas: one canvas pixel per printed cell, 3 CSS pixels per cell (2 below 700px wide), scaled up with image-rendering: pixelated. Draw one oversized triangle.
1. Work in cell coordinates: c = floor(gl_FragCoord.xy), uv = (c - res/2) / res.y. Quantize time: t = floor(time x 12) / 12.
2. Ink A, the hills: four ridges, i = 0 (far) to 3 (near). Crest height = horizon - 0.13 - 0.105i - 0.2 x smoothstep(0.15, -0.75, x), which drops the land away under the headline, plus (0.2 + 0.05i) x (fbm - 0.5), where fbm is four octaves of value noise sampled at x x (1.7 - 0.28i) + 7.3i + t x (0.014 + 0.024i). Near ridges drift faster than far ones. Below a crest the ink amount runs from top = 0.32 + 0.225i at the crest down to 20% of that over 0.15 + 0.05i of height, so each ridge fades into mist before the next one starts.
3. Ink B, the sun: a solid disc of radius 0.17 at 22% right of center and 0.07 above it; around it a halo that fades to nothing at 2.7 radii, with amount 0.52 modulated by plus or minus 0.1 in 16 rays that turn slowly (cos(angle x 16 + t x 0.22)). Shift ink B by about (0.004, -0.003) with a 0.0016 wobble so the two plates are never quite in register.
4. Dither: each ink is on where its amount exceeds an 8x8 Bayer threshold built by nesting the 2x2 pattern (use a different offset per ink, e.g. +(3, 5) for B). Multiply each cell's ink by 0.93 to 1.0 from a hash so solids look slightly starved, and darken the paper by up to 3% per cell for tooth.
5. Overprint by multiplying: color = paper; color = mix(color, color x inkA, A); the same for B. Where both inks land you get the third color for free.
On a portrait screen move the sun to 34% right and 0.12 below center, radius 0.13, halo 2 radii.

MOTION
Load: over 2.4s each ridge slides up 0.9 into place, far ridges first (staggered by 0.13 of the duration), while the sun climbs 0.78 from below the frame on a cubic ease-out starting slightly later, so it rises from behind the hills. Copy, buttons and slips rise in afterwards, staggered by 70ms. The halo's reach breathes by 5%. The headline carries a second copy of itself in ink B, absolutely positioned on top with mix-blend-mode: multiply and offset 5px right and 4px down: a misregistered second plate. That offset arrives with the load and then drifts up to 7px with the pointer.

BEHAVIOR
Pointer: inks a soft disc of ink B (radius 0.17, 90% strength) under the cursor, eased, and raises a swell in the ridges beneath it (0.035 + 0.014i high, Gaussian 0.22 wide) which also shifts the ridges sideways by depth for parallax. After three seconds without movement the swell wanders by itself along a slow sine so an embedded preview never sits still. Press anywhere on the print and a ring of ink B expands from that point at 0.62 per second, fading as exp(-1.5t). Choosing another ink pair starts a wipe: keep the old and new colors as uniforms and switch per cell where a Bayer threshold is below clamp((progress x 1.45 - x) / 0.45, 0, 1), which sweeps left to right over 900ms with a ragged dithered edge. The type and borders transition to the new inks over 800ms at the same time. An output element names the pair ("Teal + sunflower"). Buttons shift up-left by 3px on hover and reveal a 5px ink B block behind them, on a spring.

ACCESSIBILITY
The canvas and the duplicate headline are aria-hidden; there is one h1. The ink picker is a fieldset of real radio inputs with text labels for screen readers and a dashed focus outline; the pair name is announced politely. With prefers-reduced-motion, draw one still frame with everything arrived, keep the headline offset fixed, switch inks instantly and stop the counter. Without WebGL the paper, copy and controls still work. Pause the loop when the tab is hidden. Check ink A on paper for contrast (blue, teal and black all pass for large and body text).

NEVER
- Never antialias, blur or smooth the dots. One cell is one decision: ink or paper.
- Never use a third color, a gradient or opacity in the print; the only extra color is where the two inks overlap.
- Never run the print at full frame rate; twelves are the look. Pointer effects may ease between frames.
- Never use random noise for the dither; ordered patterns are what make it read as print.
- Never round a corner or add a drop shadow in the interface.
- No libraries, no images, no fonts from a network.
  1. CopyThe full prompt, one click.
  2. PasteInto Cursor, Claude Code, or any agent.
  3. CompareAgainst the live demo above.
Dither Shader Background
Copied to clipboard