Skip to content

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
View the source Spec sheet as Markdown

Install

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.

Palette
Your code
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

PropTypeDefaultWhat 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.
heatnumber1Heat intensity multiplier (0 to 2).
swirlnumber1Pointer vortex swirl multiplier (0 to 2).
spinnumber1Idle rotation speed multiplier (0 to 2).
densitynumber1Fraction of ash filaments and inner glow points drawn (0.2 to 1).
bloombooleantrueEnables 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.
soundbooleanfalseEnables 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.
pausedbooleanfalseUniversal pause prop: stops idle rotation and auto-strikes while allowing a visitor's direct gesture to play out and settle.
maxTiernumber3Hard ceiling on the capability tier (0 to 3).
reducedMotionbooleannoneOptional override for prefers-reduced-motion (still-frame mode).
offsetXnumber0Horizontal camera framing offset in world units (for example -0.32 to place the sphere slightly right of centre on wide screens).
noncestringnoneOptional CSP nonce forwarded to the scoped <style> element.
classNamestring""Additional CSS classes on the root <div>.
styleReact.CSSPropertiesnoneInline styles on the root <div>, merged after palette variables.
refReact.Ref<HTMLDivElement>noneReceives the root <div> element.
childrenReact.ReactNodenoneOptional 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.

MeasureResult
Size, gzip8.19 KB at load, 13.77 KB loaded later
Layout shift0
Frames when nothing should moveoff screen 0, hidden tab 0, reduced motion 0
axe accessibility scan0 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.

EnvironmentTierResultDateNotes
Chromium Desktop (SwiftShader)3pass2026-10-2126 passed, 0 failed
Chromium Mobile (Pixel 7 emulation)2pass2026-10-2118 passed, 0 failed
Firefox Desktop3pass2026-10-2115 passed, 0 failed
WebKit Desktop3pass2026-10-2115 passed, 0 failed
WebKit Mobile (iPhone 14 emulation)2pass2026-10-2115 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.

TierWhat it does
T3 FullWebGL2 at DPR <= 2.0 with 4,600 strands x 62 steps, 2,000 inner glow points and 2-pass Gaussian bloom
T2 StandardWebGL2 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 LiteCSS radial-gradient poster only (coarse pointer with low-end hardware hints)
T0 StaticCSS 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 style attributes, so allow style-src-attr 'unsafe-inline'.

Goes well with