crucıble

Blast

An audio-reactive furnace: a horizon coal bed whose glow and flame-lick height follow amplitude, with bass strikes hurling ember volleys upward and treble adding spark flicker. Degrades to a gently breathing coal bed without audio — never black. Mic capture only behind an explicit user gesture, with full AudioContext and GL teardown on unmount.

oglpro

Installation

CLI

npx shadcn@latest add @crucible/blast

Manual — install dependencies, then copy the source

npm install ogl

Props

PropTypeDefaultDescription
sourceBlastSourcenullAudio source driving the furnace. **"mic" must only be set in response to an explicit user gesture** (e.g. an "Enable microphone" button) — the component requests getUserMedia as soon as it sees the value. A media element is analysed and routed on to the speakers; note the platform restriction that an element can only ever feed one MediaElementSourceNode, so keep the same element instance across renders. Without a source the furnace degrades to a gentle breathing idle.
sensitivitynumber1Input gain applied to the analysed signal.
smoothingnumber0.65Analyser smoothing (0–0.95): higher values make the coals swell and relax lazily, lower values track the signal nervously.
colors[string, string, string]Forge triplet: [molten, ember, deep]. Molten paints the hottest coals and ember tips, ember the body of the glow, deep the cold smoke above.
idleIntensitynumber0.6Brightness of the no-audio "breathing coal bed" fallback (0–1). 0 still leaves a faint floor — the furnace is never black.
speednumber1Idle-breathing and flicker speed multiplier.
intensitynumber1Overall brightness multiplier.
heatnumber1Forge heat (0–1): scales glow, ember energy, and spark brightness together.
pausedbooleanFreeze the render loop, holding the current frame.
onAudioError(error: unknown) => voidCalled when an audio source fails (mic denied, unsupported element, …). The furnace has already fallen back to its idle breathing by then.
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.