Feature Library

Theme studio: scheduled, readable, living backdrops

3.63 GPU · <0.01 CPU ms
A still of the Theme studio: scheduled, readable, living backdrops demo
Still
The live demo starts when it’s in view.Pick a preset and tune it; Schedule plans the year

A site’s admin designs living backdrops and schedules them.

A site’s admin designs living backdrops and schedules them: Christmas snow through December, shamrocks on St Patrick’s Day, an evening mood after seven, a launch theme for one week, Easter and Midsummer worked out for every year. A theme is one JSON recipe: a stack of layers (colour fields and mesh gradients, flowing noise in seven styles, aurora, light rays, glows, suns and caustics, particles in eleven shapes from snow to hearts, patterns, effects shaped by the page’s own heading, an image or video) with masks, blends, motion and pointer and scroll answers, a finish (grain, vignette, bloom, a grade, a distortion from bend and twirl to kaleidoscope, and a look from halftone and dither to duotone, glitch and CRT), and the site’s colour tokens for light and dark, so the whole site changes with it. Readability is guaranteed: on save the backdrop is drawn at a dozen moments in both schemes and every text, link, accent and focus colour measured where the content sits; a theme that fails AA is refused with the nearest fixes, and on the page the backdrop calms itself under the text, in the shader, only while it needs to. Visitors get WebGPU, then WebGL2 drawn lighter, then the still saved with the theme, then a CSS gradient, chosen by device; it shows the still at once and fades to the live scene, rests off screen, holds one frame under reduced motion and keeps to about half a millisecond a frame on a laptop. The studio has 23 presets, a Simple mode and an Advanced one, undo that names each step, before and after, a performance meter per device tier with one-click recommendations, and a year timeline with “preview as of”. No three.js and no dependencies.

What it costs a frame

3.63 ms
<0.01 ms
GPU
3.63 ms
CPU, median
<0.01 ms
CPU, 95th pct
<0.01 ms
Draw calls
0
Weight
Heavy

Measured 28 November 2026 on RTX 4060 Laptop, 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 158, 1920×1080 at 1×. 600 frames × 3 rounds, median kept (rounds ranged GPU 3.46–3.73, CPU <0.01–<0.01 ms). What ran: First snow alone at 1920×1080, as a visitor’s page sees it: four layers (a gradient, mist, a glow, snow in three depths) drawn at 0.66 of the canvas, then the finish (grain, vignette) at full size. Phones: tiers are being measured next.

On every machine it was measured on
MachineGPU msCPU msCPU p95
RTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring tool3.63<0.01<0.01
NVIDIA GeForce RTX 4060 Laptop GPU · 13th Gen Intel(R) Core(TM) i9-13900Hmeasuring tool · 24 November 20260.69<0.01<0.01

Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.

How steadily it runs on RTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900H · reference

Typical frame ?
16.70 ms
1% low ?
54 fps
Varies by ?
±0.53 ms
All metricsRTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900H · reference
p50p95p9916.03 ms18.38 ms +
How long each frame took. Most frames sit in the tall bars; a long tail to the right is hitching.

Frames run on a 60 Hz timer (a page demo), so most frames take about one tick, 16.7 ms: the spread around it is what matters.

Frames

Median (p50) ?
16.70 ms
p95 ?
17.82 ms
p99 ?
18.16 ms
Slowest ?
19.23 ms
Mean ?
16.79 ms
Standard deviation ?
0.53 ms
1% low ?
54 fps
0.1% low ?
52 fps
Hitches ?
0 of 600
Over budget ?
0 of 600

Main thread

Long tasks ?
0
Long frames ?
0
Event-loop delay ?
0.1 / 1.0 / 1.1 ms

Input

No input during this run.

Memory

JavaScript heap ?
36.5 → 36.2 MB
Growth ?
-0.34 MB

Browser

JavaScript a frame ?
0.36 ms
All tasks a frame ?
1.21 ms
Layout / style ?
0.00 / 0.00 ms
Main thread busy ?
7%

Garbage collection

Collections ?
1 (1 minor, 0 major)
Pauses ?
0.6 ms in all, longest 0.6

What it needs

Renders with
WebGPU or WebGLWebGPU where there is one, WebGL2 where there is not.
Your browser
Runs hereNo WebGPU needed
Depends on
NothingNo other packages
With an agent
install("theme-studio")Your coding agent reads its pitfalls and installs it through the library’s MCP server. Set it up

What it’s for

  1. A site whose look changes with the seasons and holidays without anyone touching it on the day
  2. An evening or night mood after a set hour, in the site’s or the visitor’s time zone
  3. A launch, sale or event theme booked for one week ahead of time
  4. A living hero backdrop that an admin tunes without code and that can never make the text unreadable
  5. Brand colour tokens for light and dark that switch with the backdrop, so buttons, links and focus follow
  6. One theme document a CDN caches, with a still for phones and weak devices
  7. Previewing what visitors will see on any date (“Christmas in October”) before it goes live

Pitfalls, in brief

  1. A layer kind is written once in a small GLSL subset (module/shader-lang.ts) that becomes WGSL and GLSL: no ternary, no mod(), atan2(y, x) not atan(y, x), braces on every if and for, one declaration per line, and a builtin mixing a vector with a scalar takes the scalar as a vector (max(v, vec3(0.0))). registerKind() refuses a source that breaks the subset, naming the line, before a GPU sees it; WGSL keywords as names (type, ref, ptr, filter, sample…) are refused too.
  2. Programs are built for the kinds a theme uses, so a theme with a new kind compiles once (about 0.2 s warm, two to six seconds the very first time on a cold browser).
  3. The layers draw at a lower resolution than the screen (0.66 by default) and the finish scales them up, which flatters soft layers and blurs edged ones: turn Crisp on for shaped particles (hearts, shamrocks, confetti).
  4. Readability is measured where the content sits.
  5. The guard calms the backdrop itself (in the shader, toward the theme’s page colour or the check’s calm tone) once a second from a small frame read back; it never paints shades over the page.
5 more in brief
  1. Tier costs in the meter are estimates: costs measured per layer kind on the reference laptop (module/cost-table.ts, from npm run measure views), scaled by measured ratios of other entries on a mid laptop’s GPU and a phone.
  2. Stills are drawn at save time, one per scheme and shape (1280×720 and 540×1170 WebP), and kept by the storage adapter.
  3. The schedule’s time zone is the site’s unless a rule says the visitor’s.
  4. One image layer per theme is drawn (the first).
  5. Forced colours (Windows high contrast) hide the backdrop entirely and the reader’s own colours apply; prefers-contrast: more raises the calm under the text.
10 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

Written for the library. Fully custom code.

Hannes Andersson: Feature Library studio, runtime and presets.

Mark Jarzynski and Marc Olano: The PCG integer hash the noise and particles are seeded with (“Hash Functions for GPU Rendering”, JCGT 2020), written out from the paper.

Pedro Felzenszwalb and Daniel Huttenlocher: The distance transform behind the heading’s field (hero-family’s field.ts, copied).

Björn Ottosson: OKLab and OKLCH, through the colour picker’s colour.ts.

themethemingbackdropseasonalscheduleholidayseastertime zonesdesign tokenslight and darkreadabilitycontrastwcaglegibility guardsave checklayer stackmesh gradientnoiseauroralight rayscausticsparticlessnowconfetti

Near it in the frame