Prompt(4/4)
9. The settings panel
- One row per number: its name, a slider and its value with the unit. Moving a slider updates the picture at once. Each pattern keeps its own values (the tab on show sets the panel); double-clicking a row puts it back to the pattern's default, and a Reset button, shown only once something has moved, puts the whole pattern back.
- Rows and defaults: Breathing 100% (0–300), Reveal time 1400ms (400–3000), Dot pitch 20px (12–36), Dot size 15% (5–30), Noise scale 180px (80–360), Zoom in 10% (0–30), Blur in 50% (0–100), Dispersion 30% (0–100), Edge bend 6px (0–20), Edge glow 30% (0–100, dark only), Dot glow 40% (0–100, dark only), and the theme (Auto, Dark, Light).
- Per-pattern defaults on top of those: fBm breath reveal 1600, zoom 8, blur 30, bend 8; Domain warp scale 220, breathing 120, reveal 1600, blur 70; Snowflakes pitch 15, dot 14, reveal 1800, dispersion 35, bend 8; Ripple breathing 90, reveal 1600, zoom 6, dispersion 35; Light band breathing 110, reveal 1300, zoom 8, bend 8; Sine plasma scale 200, reveal 1600; Double helix pitch 18, breathing 110, dispersion 25; Static grain pitch 16, dot 13, reveal 1800, zoom 12, blur 30, dispersion 25, bend 8; Spiral arms breathing 120, reveal 1500, dispersion 35.
- Use my slider component if I have one; otherwise a plain range input with a filled track, an upright handle and a number box beside it.
10. How to build it, by platform
These are suggestions; check them against my stack and versions.
- Web (as in the demo): one WebGL 2 canvas over the image boxes. Pass 1 draws the pattern into a texture of one texel per dot; pass 2 draws each box with its viewport set to the box, reading that texture, the picture (with mipmaps, for the blur and the halftone colours) and the masks. One requestAnimationFrame loop for every box on the page. Keep the status line in the DOM.
- iOS: Metal (MTKView) with the same two passes, or SwiftUI on iOS 17+: a colorEffect for the dots and a layerEffect for the reveal, bend and dispersion.
- Android: on API 33+, AGSL RuntimeShader in Compose (graphicsLayer with RenderEffect); otherwise OpenGL ES 3.
- Flutter: FragmentProgram shaders, the dot texture drawn with a CustomPainter. React Native: react-native-skia RuntimeEffect.
- Without a GPU path: draw the dots on a 2D canvas (one arc per dot), and reveal the image with CSS: a mask-image for the shape, transform: scale for the zoom and filter: blur for the softness; leave out the bend, dispersion and shockwave.
11. Check
- Each pattern reads as itself on a small box as well as a large one (the snowflakes as six-armed flakes, the helix as two strands).
- The image starts to come in only once decoded; a fast image skips the dots; a failure stops them and says why.
- On arrival the picture is enlarged and soft and settles sharp; its edges bend and split colour only where they move; the white front line is plain, never coloured.
- The shockwave's glow stays faint and never lights the dots.
- Every slider changes the picture at once; each pattern keeps its own values; Reset restores them.
- 60 fps on a mid-range phone with several boxes loading; no GPU work once the images are in; light and dark, reduced motion and keyboard use of the panel all checked.