Skip to content

The pitbubbles that pile, squash and jump.

Experiment · OCT 2026
Canvas 2DPhysicsVerlet

What it is

The physics behind the key pit, the navigation at the bottom of Home, where the place keys sit in a pile of bubbles. Press a key and the bubbles near it jump; a wave recolours them into that place’s flock.

Here it’s just the pit. Push the bubbles around, press L, T or P, or change the gravity and watch everything settle again.

How it's built

  1. 01Verlet integration: position minus last position is the velocity.
  2. 02A spatial hash keeps collisions cheap at 300 bubbles.
  3. 03Keys are static rectangles the bubbles push out of.
  4. 04Stretch follows smoothed speed, never more than 1.3×.
src/lib/motion/pit.tsts
for (const b of this.bubbles) {
  // Verlet: the velocity is where it is minus where it was.
  const vx = (b.x - b.px) * 0.975;
  const vy = (b.y - b.py) * 0.975;
  b.px = b.x;
  b.py = b.y;
  b.x += vx;
  b.y += vy + this.gravity;
}
Next

More from the lab

All experiments
EXP-08 · TypeScript · SVG · Pointer events

Founding Member

TapBill's first-member card. Type your name and it fills in, sign it with a finger or a mouse, and it tilts toward you.

EXP-07 · three.js · Blender · WebGL

The basement

A 90s basement with a closet of jerseys. Open the closet, flip a jersey, watch the play on the TV.

Home