background · WebGL
EmberCore
A three-dimensional sphere of ash filaments with a live fire inside: move to stir a vortex, drag to spin, click to strike, and hold to charge.
3D ash filament sphere with inner ember glow, vortex stir, shockwave strike and hold-to-charge burst
- WebGL
- Reduced motion: still-frame
- 8.19 KB gzip
- 1 WebGL context
- Layout shift 0
Install
pnpm dlx shadcn@4.21.1 add @frictionborn/ember-core
Playground
Move to stir a vortex, drag to spin, click to strike a shockwave, or hold to charge and release to burst.
import { EmberCore } from "@/components/ui/ember-core";
<EmberCore />In a full example
The full example loads as you scroll to it.
Accessibility
- In 'hero' mode (the default), the canvas is aria-hidden and a real <button>Strike</button> is provided alongside any children. In 'full' mode, the canvas is focusable with an aria-label listing all gestures, accompanied by native range inputs, toggle buttons and a polite status live region.
- Keyboard: In 'hero' mode, Tab reaches the real Strike button. In 'full' mode, the canvas has tabIndex=0 (arrow keys spin, Space or Enter strikes or charges when held, + and - zoom, P pauses) and Tab reaches the Controls, Pause and Strike buttons plus native sliders and palette chips.
- Touch: In 'hero' mode, touch-action is pan-y so vertical swipes scroll the page normally; only horizontal touch drags spin the sphere and hold-to-charge is disabled on touch. In 'full' mode, single-finger drag spins, two-finger pinch zooms, tap strikes and hold charges.
- WCAG criteria it is built for: 1.4.3, 2.1.1, 2.2.2
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
interactive | "full" | "hero" | "none" | "hero" | Selects the interaction mode. 'hero' is page-safe (no wheel zoom, touch-action: pan-y, decorative canvas, real Strike button); 'full' adds focusable canvas keyboard controls, wheel/pinch zoom and the Controls panel; 'none' disables pointer and touch handlers. |
heat | number | 1 | Heat intensity multiplier (0 to 2). |
swirl | number | 1 | Pointer vortex swirl multiplier (0 to 2). |
spin | number | 1 | Idle rotation speed multiplier (0 to 2). |
density | number | 1 | Fraction of ash filaments and inner glow points drawn (0.2 to 1). |
bloom | boolean | true | Enables the 2-pass Gaussian bloom (strength 0.75, radius 0.6, threshold 0.18). Falls back automatically on Tier 2 if the frame budget fails. |
sound | boolean | false | Enables synthesized WebAudio crackle and low thump on user gestures (never plays before a user gesture; no audio files). |
palette | "fire" | "ice" | "neon" | "mono" | "custom" | "fire" | Colours of the ash, ember, hot core and inner glow (DESIGN.md A8). 'custom' reads --fb-heat-0..4 via resolveCssColor. |
paused | boolean | false | Universal pause prop: stops idle rotation and auto-strikes while allowing a visitor's direct gesture to play out and settle. |
maxTier | number | 3 | Hard ceiling on the capability tier (0 to 3). |
reducedMotion | boolean | none | Optional override for prefers-reduced-motion (still-frame mode). |
offsetX | number | 0 | Horizontal camera framing offset in world units (for example -0.32 to place the sphere slightly right of centre on wide screens). |
nonce | string | none | Optional CSP nonce forwarded to the scoped <style> element. |
className | string | "" | Additional CSS classes on the root <div>. |
style | React.CSSProperties | none | Inline styles on the root <div>, merged after palette variables. |
ref | React.Ref<HTMLDivElement> | none | Receives the root <div> element. |
children | React.ReactNode | none | Optional foreground content layered above the ember cloud. |
Measured on the bench
Measured by the automated bench at commit 801163e on 2026-10-21. These numbers are written by the bench, never by hand.
| Measure | Result |
|---|---|
| Size, gzip | 8.19 KB at load, 13.77 KB loaded later |
| Layout shift | 0 |
| Frames when nothing should move | off screen 0, hidden tab 0, reduced motion 0 |
| axe accessibility scan | 0 serious, 0 critical |
Browsers it ran in
Automated Playwright runs, some with device emulation. Results from physical phones and tablets are still pending, so none are listed.
| Environment | Tier | Result | Date | Notes |
|---|---|---|---|---|
| Chromium Desktop (SwiftShader) | 3 | pass | 2026-10-21 | 26 passed, 0 failed |
| Chromium Mobile (Pixel 7 emulation) | 2 | pass | 2026-10-21 | 18 passed, 0 failed |
| Firefox Desktop | 3 | pass | 2026-10-21 | 15 passed, 0 failed |
| WebKit Desktop | 3 | pass | 2026-10-21 | 15 passed, 0 failed |
| WebKit Mobile (iPhone 14 emulation) | 2 | pass | 2026-10-21 | 15 passed, 0 failed |
On different devices
Reduced motion (still-frame): Renders one still frame of the 3D ember cloud with no animation loop; activating Strike shows one flared frame and returns to the still frame.
| Tier | What it does |
|---|---|
| T3 Full | WebGL2 at DPR <= 2.0 with 4,600 strands x 62 steps, 2,000 inner glow points and 2-pass Gaussian bloom |
| T2 Standard | WebGL2 at DPR <= 1.5 with 2,200 strands x 48 steps and 1,100 inner glow points; bloom falls back automatically if the frame budget fails |
| T1 Lite | CSS radial-gradient poster only (coarse pointer with low-end hardware hints) |
| T0 Static | CSS radial-gradient poster on dark obsidian ground; under prefers-reduced-motion on a WebGL2 browser, renders one still WebGL frame with 0 loop frames |
Content Security Policy
- Works without
'unsafe-eval'. - Needs no reveal gate.
- Sets inline
styleattributes, so allowstyle-src-attr 'unsafe-inline'.