All work

Canvas

A lightweight design tool that runs in the browser

Canvas editor with a rounded purple rectangle rotated on the canvas, its handles showing, next to a phone screen mock-up and the properties panel

What I was exploring

Design tools for interface work tend to be heavy: large installs, updates and a lot of features you don't use day to day. I wanted to see how far a lean tool could go when it opens in a browser tab and starts drawing straight away.

Canvas was a research project at UserBin: a place to try out drawing, snapping and property editing for UI design, with keyframe controls for animation planned in from the start.

What I built

  1. Plain JavaScript classes and the browser's Canvas API, no frameworks or drawing libraries.
  2. Two stacked canvases: one for the artwork, one for selection handles and guides, so moving the cursor redraws only the overlay.
  3. Every shape is an object that keeps its own path commands and render queue, so the whole scene redraws with a single loop.
  4. A properties panel bound to the selected shape, where scrolling over a field changes the value and the shape updates as you scroll.
  5. Snapping rules written down before the code: snap within a threshold, release when the user drags past it, and detect matching gaps between three or more objects.

What it does

Built with JavaScript, HTML Canvas API, CSS, Express (static server), 2023.