crucıble

Filings

An iron-filing field: a grid of short segments aligning to a slow magnetic-dipole field when idle and bending toward the cursor, brightening from silver to white. Original OGL fragment shader, one draw call, offscreen-paused and reduced-motion-safe; the field idles on its own when untouched.

oglfree

Installation

CLI

npx shadcn@latest add @crucible/filings

Manual — install dependencies, then copy the source

npm install ogl

Props

PropTypeDefaultDescription
colors[string, string]Two tones: [cool, warm]. cool is the resting silver of aligned filings; warm is the brighter white they glow near the cursor. Any hex string.
densitynumber22Grid density (square cells stacked across the container height), clamped 8–40.
speednumber1Idle-field animation speed multiplier. 1 = default.
intensitynumber1Stroke brightness / glow. 1 = default.
pausedbooleanFreeze the animation, holding the current frame.
idlebooleantrueIdle autoplay: after ~1.5s with no pointer present, a seeded ghost drifts slowly across the field and bends the filings, so thumbnails and heroes never look still; a real pointer takes over instantly. Never runs under reduced motion.
classNamestringExtra classes for the wrapper. Positioned absolute inset-0 -z-10.

Honors prefers-reduced-motion with a designed static fallback, pauses offscreen and on hidden tabs, and passes className through.