Design engineering · 2026 · personal

Mirror.

A wardrobe that answers back.

Wave, and it follows your hands. Clap, and the world changes. Punch, and the glass breaks.

The kit

Four things,
one cable apart.

  1. iPhone 12 the eye

    On a low stand at the bottom edge of the screen, facing the room. Continuity Camera makes it a webcam in Chrome, with no app to install.

  2. MacBook Air the brain

    One Chrome tab does everything: tracking, listening, and drawing every frame in WebGL.

  3. 1080p projector the light

    Over an HDMI cable. Wireless mirroring added a delay you could see, and a mirror that lags isn’t a mirror.

  4. 100-inch screen the glass

    Hung on the wardrobe. On a real mirror your face is half its real height, so the reflection starts at half life size.

100-inch screencontinuity camerahdmiiPhone 12tracking · audio · webglMacBook Airprojector

How it’s engineered

One frame,
lens to wall.

  1. 01 Capture

    One camera stream, opened once. On first run the picker goes looking for the iPhone.

  2. 02 Shrink and brighten

    Tracking never sees the full frame: a 512-pixel copy, brightened, sees more in a dark room and costs less.

  3. 03 Track

    Hands and the person mask take turns, one per camera frame, so the page stays free. The mask only runs when a world needs it.

  4. 04 Read the body

    Landmarks become gestures: a fist is every fingertip closer to the wrist than its middle joint; a punch is a fist that suddenly grows.

  5. 05 Listen

    Claps are heard on the audio thread, so they still land when tracking keeps the page busy. A clap is noise: loud, sudden, and crossing zero far more often than a voice.

  6. 06 Draw

    WebGL2, two passes. A low-resolution field remembers where hands moved and swirls it with curl noise; the main pass lays the camera, the world, the portal, the wipe and the shatter over each other.

  7. 07 Project

    The picture is flipped so it reads as a reflection, fitted to the screen by four corners, then sent full screen onto the projector itself.

index.htmlgetUserMedia1080p · 60 fps ideal

01 Capture. One camera stream, opened once. On first run the picker goes looking for the iPhone.

const stream = await navigator.mediaDevices.getUserMedia({  audio: false,  video: {    deviceId: deviceId ? { exact: deviceId } : undefined,    width: { ideal: 1920 }, height: { ideal: 1080 }, frameRate: { ideal: 60 },  },});// First run: prefer the iPhone (Continuity Camera) if it's thereconst phone = (await listCameras()).find(c => /iphone/i.test(c.label));if (phone && phone.deviceId !== state.camera) await startCamera(phone.deviceId);
effects.js512 pxlow-light boost

02 Shrink and brighten. Tracking never sees the full frame: a 512-pixel copy, brightened, sees more in a dark room and costs less.

// Tracking looks at a small, brightened copy of the frame: cheaper,// and it sees more in a dark room.const ts = lastTs = Math.max(now, lastTs + 1); // MediaPipe needs strictly rising timestampsdet.width = 512;det.height = Math.round(512 * video.videoHeight / video.videoWidth);detCtx.filter = `brightness(${opts.boost}) contrast(${1 + (opts.boost - 1) * .25})`;detCtx.drawImage(video, 0, 0, det.width, det.height);
effects.jsMediaPipe tasks-vision 1.0.1hands + selfie segmenter

03 Track. Hands and the person mask take turns, one per camera frame, so the page stays free. The mask only runs when a world needs it.

// Hands and the person mask take turns, one per camera frame,// so the page stays responsive.const needMask = scene === AURA || (mix > 0 && next === AURA) || shatter?.to === AURA;if (!needMask) hasMask = 0;turn = needMask ? 1 - turn : 1;if (turn === 0 && segmenter) { segment(ts); return; }if (hands) trackHands(now, ts);
effects.js21 landmarks a handper-hand history · 300 ms

04 Read the body. Landmarks become gestures: a fist is every fingertip closer to the wrist than its middle joint; a punch is a fist that suddenly grows.

const fist = [[8, 6], [12, 10], [16, 14], [20, 18]]  .every(([tip, pip]) => dist(p[tip], p[0]) < dist(p[pip], p[0]) * 1.05); // Punch: a fist that suddenly grows (coming at the camera) or flies fastconst smallest = Math.min(...h.history.map(e => e.size));const growth = h.size / smallest, speed = Math.hypot(h.vel.x, h.vel.y);if (h.fist && cooled(now) &&    ((growth > 1.55 - opts.punchSens * .35 && h.size > .1) || speed > 3.2 - opts.punchSens * 1.4)) {  doShatter([h.palm.x, h.palm.y]);}
effects.jsAudioWorklet128-sample blocks

05 Listen. Claps are heard on the audio thread, so they still land when tracking keeps the page busy. A clap is noise: loud, sudden, and crossing zero far more often than a voice.

class Clap extends AudioWorkletProcessor {  process(inputs) {    const x = inputs[0][0];    let e = 0, zc = 0;    for (let i = 0; i < x.length; i++) {      e += x[i] * x[i];      if (i && (x[i] > 0) !== (x[i - 1] > 0)) zc++;    }    e /= x.length;    if (e > this.floor * this.ratio && e > this.minE && zc >= 18 && currentTime - this.last > .3)      this.port.postMessage({ type: 'clap', level: Math.sqrt(e) });    // the room's level adapts slowly between claps    if (currentTime - this.last > .25) this.floor = Math.max(this.floor * .995 + e * .005, 1e-7);    return true;  }}
effects.js · TRAIL shaderWebGL22 passesGLSL 300 es

06 Draw. WebGL2, two passes. A low-resolution field remembers where hands moved and swirls it with curl noise; the main pass lays the camera, the world, the portal, the wipe and the shatter over each other.

void main() {  vec2 flow = fbo(vUv).rg * .012    + curl(vUv * vec2(uAspect, 1.) * 3. + uTime * .15) * .0018 * (.3 + fbo(vUv).b);  vec3 v = fbo(vUv - flow);  v *= vec3(.955, .955, .978); // motion fades fast, the opening lingers  for (int i = 0; i < 4; i++) {    if (i >= uN) break;    // Stretched along the stroke, so a swipe leaves a long ribbon of liquid    float sp = length(uP[i].zw);    vec2 d = (vUv - uP[i].xy) * vec2(uAspect, 1.), dir = uP[i].zw / sp;    float along = dot(d, dir), across = dot(d, vec2(-dir.y, dir.x));    float g = exp(-(along * along / (1. + sp * 40.) + across * across) / .004);    v.rg += uP[i].zw * g;    v.b += g * smoothstep(.003, .025, sp) * .55;  }}
index.htmlwindow-management4-corner fit

07 Project. The picture is flipped so it reads as a reflection, fitted to the screen by four corners, then sent full screen onto the projector itself.

const perm = await navigator.permissions?.query({ name: 'window-management' });if (perm?.state !== 'denied' && window.getScreenDetails) {  const details = await window.getScreenDetails();  screenChoice = details.screens.find(sc => sc !== details.currentScreen) || undefined;}await document.documentElement.requestFullscreen(screenChoice ? { screen: screenChoice } : {});

Now you try

Drag across the glass.

A small sketch of the real thing, with your cursor or finger standing in for a hand. Drag to open the portal, then clap or punch.

drag here
the real one uses your camera and mic at the end

Three gestures

Wave. Clap. Punch.

Wave opens a liquid portal

Palm speed paints a low-res field that swirls on its own, lingers, then fades.

Clap changes the world

Heard: far above the room’s level, ≥ 18 zero crossings in 128 samples. Seen: palms 2.2 hand-widths apart, then together, within 450 ms.

Punch shatters the glass

A fist that grows by about 40% within 300 ms, or flies fast. Shards fall away into a random world.

The worlds

Ten worlds, ten powers.

01 / 12

The wall in the Kaleidoscope worldThe wall in the Almighty Push worldThe wall in the Liquid portal worldThe wall in the Domain Expansion worldThe wall in the Shatter worldThe wall in the Golden aura worldThe wall in the Pop art worldThe wall in the Kamehameha worldThe wall in the Sky worldThe wall in the Neon lines worldThe wall in the ASCII worldThe wall in the Kon world

Kaleidoscope

real footage, on the wall

Built in the room

It worked on my desk.
Then I tried the wall.

Before the projector came on, a photo stood in for the camera, so every world, the portal and the shatter could be checked at the desk. Hands, punches and real claps needed the real room.

  1. try 1

    broke Claps not caught. The projector window stopped responding. Tracking struggled in the dark.

    fixed Low-light boost on the tracking copy. Claps moved to the audio thread. Hands and mask take turns.

    Step one, obviously: the projector showing no signal
  2. try 2

    broke Full screen froze the picture: Chrome pauses a window it thinks is hidden.

    fixed The effects moved into the window that shows them.

  3. try 3

    broke I said “Bankai”. Chrome heard “Bangkok”. The separate projector window kept failing.

    fixed Voice fixed on the third try. One window that puts itself full screen.

    Meanwhile, in Chrome: you said Bankai, Chrome heard Bangkok. Fixed on try three

The damage

One Saturday.

test videos
7
of a man waving at a wardrobe
2.1GB
commits
15
prompts
25

The film

86 seconds, made with Aki.

The setup, how it works, the tests, the worlds. Cut as a vertical reel.

Your turn

Step into
the Mirror.

Open the Mirror
  • Chrome on a laptop. Allow the camera, and the mic for claps.
  • A projector is optional: full screen works on any display.
  • F full screen · C next world · X shatter
← More design engineering