Per-element themes

The form below is ordinary HTML. A script puts each heading, paragraph, image, field, checkbox, slider, table and button inside a <canvas-skin> element, which holds a small drawable canvas that draws that one element. No canvas covers the page. Choose a skin in the bar at the bottom of the form: every wrapper changes, starting with the ones nearest to your finger. The skins are in four groups, and Options opens the settings of the skin that is showing. The controls are the real ones. Type in the fields, tick the boxes and drag the slider in any skin.

Ferry to the island

The crossing takes 40 minutes. Boats leave from pier 3.

Drawing of a ferry in a harbour with hills behind it
2
62%
SailsArrivesSeats left
08:1008:5046
09:4010:2012
12:1512:5580
Fare rules

A ticket can be changed up to one hour before the boat leaves. Bicycles travel free.

Nothing booked yet.
No change of skin has been measured yet. Choose a skin.

The glass skin is a fragment shader. It models each element as a slab of glass with a flat middle and a rounded rim, bends the line of sight into the glass with Snell's law, once each for red, green and blue, and reads the page background where each ray lands. The sliders under Options are the shader's inputs and apply to every glass element at once. The five buttons above them are sets of slider values: Regular and Clear are named after the two variants Apple documents for Liquid Glass, and the values are this page's own, not Apple's. A refractive index of 1 is air and bends nothing. With dispersion above 0 the three colours land in different places and the lines in the background get coloured edges at the rim.

The line above that begins "Change from" is measured on this device each time a skin is chosen: frames drawn and missed while the change ran, the longest gap between two frames, the script time of the element paints, and the browser's long-animation-frame and event performance entries. The same numbers are sent to this site's report endpoint with the name of the two skins, and nothing else. The wrappers share a frame budget: when a frame arrives late, fewer elements are painted in the next one and the others skip ahead in their animation.

Each element changes at the moment a circle growing from the tap reaches it. Before it changes, the wrapper copies its canvas into a plain canvas, and the copy fades out over the new drawing while the new skin plays its own entrance: the pencil lines are drawn on, the gel controls wobble, the terminal types the element from left to right, the blueprint extends its construction lines and counts up the size. Wrappers that are outside the window change with no animation.

Show the code
  1. The form. No element in it knows about a canvas.
  2. Wrap every element, and change the skin from the tap.
  3. CanvasSkin.wrap() puts a <canvas-skin> round each element. Writing the wrappers in the HTML by hand does the same.
  4. The wrapper takes the element's size, and its canvas is 14 px larger on each side.
  5. The paint handler: read the element's state, let the skin draw, put the hit region back, fade the old drawing out.
  6. A change of skin is ordered by distance from a point.
  7. One wrapper changing: copy the old drawing, then switch.
  8. The CSS that gives each kind of element the same box in every skin.
  9. The glass shader: surface shape, refraction for three colours, frost, light.
  10. One WebGL context for every glass element. The background behind the element is the texture.
  11. The glass skin: the background as canvas calls, the call to the shader, and the 2D version used without WebGL.
  12. The options panel is built from the list each skin gives. A slider writes the skin's setting and its wrappers paint again.
  13. The frame budget: how many elements are painted in one frame.
  14. Measuring a change of skin: frames, gaps, paint time, long animation frames.
  15. If the shared WebGL context is lost, glass is drawn in 2D from then on.
  16. The pencil skin.
  17. The shapes of each kind of element, shared by the newer skins. A skin says how to draw each role.
  18. The thermal camera skin. A touch leaves heat that fades over 4.5 seconds.
  19. The neon sign skin. Every shape is a tube, and a disabled control is a tube that is off.
  20. The embroidery skin.
  21. The element's picture as a plain canvas, for a skin that works on the pixels.
  22. A picture as a grid of cross stitches.
  23. Any other shader runs in the same WebGL context as the glass.
  24. The brushed metal and chrome shaders, the five metals, and the skin.
  25. The underwater shader and skin. The element's own picture is the texture, sent again only when it changes.
  26. The gravity shader and skin. Each element is bent by its four heaviest neighbours and by the finger.
  27. The holographic foil shader and skin. It follows the tilt of the device.
  28. The four painting skins share this: shapes and picture in 2D, then one shader pass over the wrapper.
  29. Screen print.
  30. Crayon.
  31. Impressionist.
  32. Old master: a Kuwahara filter, paint with thickness, and a lamp where the page was last touched.
  33. Christmas.
  34. LED board. The element's picture becomes a grid of lamps.
  35. Punch card.
  36. Oscilloscope. Every shape is a list of points, and the beam runs along the points of the element that has focus.
  37. 1-bit: an ordered dither with an 8 by 8 Bayer matrix.
  38. ASCII: shapes as typed characters, and a picture read once and turned into characters.
  39. Comic: ink outlines, dot screens, and a cyan, magenta and yellow halftone of a picture.
  40. 3D blocks: the sides of each block are worked out from where the element is in the window.
  41. X-ray.
  42. Stained glass: a pale pane with a border of coloured pieces.
  43. Clay. The text of a button is pressed into the surface.
  44. Seaside.
  45. The gel skin.
  46. The terminal skin.
  47. The blueprint skin.
  48. A lost context puts the element back as plain HTML.
  49. The page's own styles.

Skins mixed on one page

A wrapper takes its skin from the nearest ancestor with a skin attribute, so skins can be mixed. Each tile below is a <div skin="…"> with the same three controls in it. These don't follow the bar above.

Show the code
  1. One skin attribute on each tile.
  2. How a wrapper decides what kind of element it holds.

A wrapper inside a wrapper

The card below is one <canvas-skin>, and the slider and the button inside it are wrapped too. The card's canvas draws the two inner canvases as part of its picture. This follows the bar above.

Ticket 0412

Not shown yet.
Show the code
  1. Wrappers written in the HTML, one inside another.

How it works

Live checks

The checks wait for a tap. Each one builds its own wrappers in a corner of the window, and none of them touches the form above. Pixels are read from a drawImage() copy.

Findings

Measured in headless Chromium 157 on 2026-11-22, at 412 px wide and device scale 2, with WebGL rendered in software. Not yet run on a phone.