Op Art & Moire
Dot Grid Shift
Offset dot lattice with rows staggered half a cell; dot sizes swell in phase waves producing illusory diagonal moire bands that travel slowly across the field.
canvasmedium complexitymoderate motion
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
Worth keeping?
Votes steer what gets built next — sign in to cast one, free to read
When to use it
Dark-mode hero backgrounds, op-art or generative-art showcases, ambient looping screensavers needing a hypnotic geometric pattern.
When not to
Light-background UIs (background hardcoded near-black). Contexts with legible text overlays — shifting bands compete with reading.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change the travel speed from 0.6 to 0.3 for a slower drift, swap dot color to warm amber by setting ctx.fillStyle to '#f5c842', and increase MAXCELLS to 3600 for a denser grid. Theme: dark tokens live in :root, the light variant in :root[data-theme="light"]; ?theme=light or a {type:'forever:theme'} postMessage switches at runtime.
Safe to edit
- travel speed (t*0.6)
- primary dot color (#f2f2f2)
- secondary lattice opacity (0.10)
- diagonal band slope k (0.55)
- cell size range (11..22 logical px)
- phase frequency multipliers (0.9 and 1.18)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- MAXCELLS budget + auto-coarsen loop (critical for perf)
- typed Float32Array px/py/ph pre-computation
- visibility pause/resume guards
- prefers-reduced-motion single-frame fallback
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
Known limitations
- Background hardcoded near-black — must edit CSS to change
- No pointer interactivity; purely passive
- MAXCELLS cap (2400) limits density on large viewports to avoid arc overdraw
More Op Art & Moire components
- Moire DriftTwo concentric ring grids drift apart with opposed phase, producing slow-shifting moire interference fringes via canvas lighter/difference compositing.
- Bulge GridA 22x22 white line grid on black warps radially outward as an invisible lens drifts on a slow lissajous path; a faint offset twin grid creates moire shimmer.
- Concentric Pulse26 white rings march outward from center in a ~6s loop; a second scaled field produces slow moire interference fringes on a dark background.
- Wave ColumnsVertical B&W stripe columns undulate via detuned sine waves, creating a woven fabric ripple with a central bulge illusion and moire interference.
- Checker WarpA black-and-white checkerboard bends around a breathing lens at the center, slowly rotating and drifting for a hypnotic op-art illusion.
- Line Illusion64 horizontal lines kink at a center crease with differential shading, creating a breathing 3D fold illusion of two angled sheets.