Back to INTERFACE

Pixel Worlds

UI library · Open source · Design · Engineering

Pixel Worlds

Pixel Worlds is six ordinary controls with a small living pixel-art scene inside them. The control's value drives the scene: hold a delete button and a dragon breathes fire across it, and an agent's status line is a wizard doing whatever the agent is doing. Everything is painted in code. There are no image files, no dependencies and no network requests.

6
Controls
8
Agent states for the wizard
0
Image files
0
Dependencies
The Pixel Worlds reel.
Keep, the password field. The typed password has earned a wall and a moat.
Keep, the password field. The typed password has earned a wall and a moat.

The six

  • Keep is a password field where strength is a castle. When you stop typing, a raccoon tests what you built. It scores a password by how guessable it is, not how long it is.
  • Round is a loading bar that is the bar of a tavern. Seven regulars empty their cups in turn as the task loads.
  • Hoard is a hold-to-delete button with a dragon asleep in it. Hold for 1.7 seconds and the fire is the fill. Let go early and he swallows it and blows one smoke ring.
  • Sage is a status chip for an agent, with eight states. Failed is the wizard covered in soot with the end of his beard still alight.
  • Raven is a send button. A raven carries the message to a tower window, and the flight is the progress.
  • Sigil is a loading spinner that is a summoning circle. At 100% something answers.
Hoard, the hold-to-delete button, with the dragon awake.
Hoard, the hold-to-delete button, with the dragon awake.

How it is built

Each control is a single JavaScript file that defines a custom element and paints itself with Canvas2D. You load it with a script tag, or install it with the shadcn CLI.

The repo also ships the workflow as a skill for a coding agent: the painter (layers, light, a palette crush, a pixel font), a starter example, and a script that steps an animation to chosen moments and saves the frames side by side. An agent with the skill gets a reasonable first pass. These took many rounds of looking at frames and fixing them, and yours will too.

Sage, the agent status chip, in its failed state.
Sage, the agent status chip, in its failed state.

What took the rounds

The commit history is mostly a list of things that looked wrong in a frame. The raven had to fly in through the window, not behind the wall. Sigil took six commits in one day. It got darker, lit only by the wisp. Then a stalled value had to look like waiting and not like a hang. Then a failed circle had to not vanish. The last commit went back to the lighter look of the first version and kept every behaviour added since.

Sigil, the loading spinner, after it reaches 100%.
Sigil, the loading spinner, after it reaches 100%.

Where to try it

Pixel Worlds · live galleryOPEN IN NEW TAB ↗

All six are running in the live gallery, and the source is on GitHub under the MIT licence. The images here are frames from the reel, which uses a scripted mouse pointer. Nobody played it live.

  • Web Components
  • Canvas 2D
  • Vanilla JS
  • Pixel art in code
  • shadcn registry
  • Agent skill
JF/OS · INDEX OF WORK14 ENTRIES

Everything in the machine, printed out. For people with eleven seconds and no interest in cartridges.

01 · INTERFACE

02 · SYSTEMS

03 · 3D WORLDS

04 · GAMES

*** END OF LISTING ***