Skip to content
romankhadkaPublic

About

A clock with no clock in it: tens of thousands of squares roam a canvas, and each minute a few cross the screen to settle into the digits.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

clk

A clock made of tens of thousands of wandering blocks.

Live at clk.romn.dev.

Every block is an autonomous square agent with a lifelong speed property and its own direction, pauses, brightness, and twinkle. When the minute changes, a handful of free blocks are summoned — each cruises to its constellation point at its own pace (a block may only run within ±25% of its assigned speed), so a slow block picked far away genuinely takes its time crossing the canvas and the new time assembles gradually. Blocks already sitting on a summoned position politely slide out of the way. The timezone at the bottom never moves.

Vanilla TypeScript + WebGL2, zero runtime dependencies. All blocks render in a single gl.POINTS draw call; an adaptive governor scales the field between 12k and 60k blocks to hold 60fps on whatever hardware it lands on.

Run

npm install
npm run dev

How it works

  • src/sim/ — structure-of-arrays agent pool (400k capacity), per-agent xorshift32 streams, wander decision events, summoning with time-parameterized easing and decaying meander noise, an occupancy grid for the make-way rule.
  • src/layout/ — hand-drawn single-stroke glyph skeletons, rasterized once and stratified-sampled into deterministic constellations; timezone text sampled into static squares.
  • src/render/ — one instanceless point pass into an offscreen target, GPU-side twinkle, dual-Kawase bloom, gradient/vignette/nebula composite with dither.
  • src/quality.ts — p75 frame-time governor with hysteresis; degrades bloom first, then star count, and recovers the same way.

About

A clock with no clock in it: tens of thousands of squares roam a canvas, and each minute a few cross the screen to settle into the digits.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages