Halftone Waves
A rotated halftone screen whose dot sizes ride interfering waves. Hovering swells a lens of bigger dots; clicking sends a ring across the grid.
webglpointerclickprint6 files · 637 locdeps: clsx, tailwind-merge
Installation
With the shadcn CLI, pointing at this platform’s registry:
npx shadcn@latest add https://opusui.131199999.xyz/r/halftone-waves.jsonOr offline, straight from your opus55 checkout (copies every file it needs):
node ../tailwind_component/opus55/scripts/add.mjs halftone-wavesUsage
import { HalftoneWaves } from "@/components/opus/backgrounds/halftone-waves";
<HalftoneWaves cell={14} shape="circle" className="absolute inset-0" />API
| Prop | Type | Default | Description |
|---|---|---|---|
| colorA / colorB | string | — | Ink gradient across the screen. |
| background | string | — | Paper colour. |
| cell | number | 14 | Dot pitch in CSS px (resolution independent). |
| angle | number | 20 | Screen angle in degrees. |
| shape | "circle" | "square" | "diamond" | "circle" | Dot shape. |
| speed | number | 1 | Time multiplier. 0 freezes the animation; the pointer stays live. |
| interactive | boolean | true | React to the pointer (tracked on window, so overlaid content never blocks it). |
| className | string | — | Classes for the wrapper. Use `absolute inset-0` to fill a relative parent. |
| children | ReactNode | — | Optional content rendered above the canvas. |
Notes
- Renders with WebGL2 into a single full-screen triangle — no three.js, no textures, no dependencies.
- Pauses automatically when scrolled off-screen or when the tab is hidden; resumes on return.
prefers-reduced-motion: reducerenders one still frame and ignores the pointer.- A CSS gradient fallback paints instantly and stays if WebGL2 is unavailable.