How the site’s cursor became a camera shutter
The cursor, an iris that closes on a click, a shutter you wind by holding, recorded sounds, a flash that fills the page and an image burned into the background. Each part came right when a measurement replaced a guess.
I wanted a click on this site to answer like a camera: wind something up, point it at a photograph, release it, and let the room remember the light. Every part of it, from the cursor to the afterimage, came right when a measurement replaced a guess.
I photograph wet streets at night, and a flash is the thing I trust least in that work. The shutter took more than twenty commits over three days, in a stretch where the whole repository logged 43 commits on 22 September, 54 on 23 September and 42 on 24 September.
The cursor, matched by measurement
The cursor is a ring and a dot, drawn with a difference blend (which subtracts the cursor’s colour from what is underneath) so it reads dark over a white header and light over a photograph without anyone choosing a colour. At first I matched a cursor I liked by eye.
On 23 September I matched it by measurement instead. Sizes and timing were read off the reference in a browser: a 30px ring, a 6px dot, transitions of 0.125 and 0.1 seconds. Mine had wandered between 28px and 20px, guessing from crops.
The off-centre cursor was a timing fault
The number that mattered was the timing. The reference moves ring and dot 1.25 times apart. Mine ran at 0.13 and 0.55, four times apart, so the dot ran ahead of the ring and the light, and the faster the pointer moved the further they separated. That was the off-centre, and resizing could not fix it.
Earlier that afternoon I had made the cursor black and smaller, and then put the original inverting cursor back. I had disliked the inversion over the hero photographs, and black fixed a white header while vanishing on every dark photograph. Both requests compensated for the timing fault instead of repairing it. Inversion stayed, and went off only over a photograph.
An iris needs hinged blades
A click should look like a shutter. The first version was a ring contracting with an inset shadow, a placeholder. The next was a six-blade iris.
Most recipes rotate each blade about the centre and scale it down. That is a pinwheel: it spins and shrinks and never forms a polygon, because nothing is hinged. A real blade is hinged on the housing and swings inward, so its straight edges sweep across one another and the hole they leave is the polygon. The geometry was drawn out as pixels at five points in its travel first, which caught a parameterisation running backwards.
Then I sent a reference, and the blades were measured off it rather than counted by eye: the dominant angular harmonic was 8 in all four frames, the opening running from 0.94 of the radius to 0.37. So the next change made eight blades.
On 24 September the blades took the ring’s colour, because black blades vanished on a dark frame, and the click slowed from 230ms to 520ms. The iris is the whole feedback for a click.
Winding it: speed worked where roundness did not
The charge began as a gesture: circle the cursor and the shutter fires. Roundness was useless as a test: a rectangular sweep round the screen varies barely more than a circle, and an early version fired on exactly that.
On 22 September I replaced it with speed. Move fast and the ring fills; slow down and it drains, so it has to be held, not merely reached.
Testing showed two bugs. The gain (how fast movement fills the ring) was below the bleed (how fast it drains), so the meter sat at zero however hard the pointer moved. Then the reference speed was a guess: at a measured 1350 px/s the net rate was +0.08 per second, twelve seconds to fill, which reads as broken rather than difficult.
The code now puts vigorous circling at roughly 1300 to 1500 px/s, and pairs a gain of 0.8 with a bleed of 0.5: about 0.3 per second, a bit over three seconds of sustained movement. That is deliberate: a charge that arrives in a second is not noticed.
On 24 September I added press-and-hold as a second way in, for a page dropping frames, where the computed speed collapses. Its first version integrated a gain per frame, and at about 3 frames per second a 3.6 second hold reached only 0.73. It now reads the wall clock: 2.6 seconds and it is full.
On 26 September I had the movement trigger turned off. The code stays, behind a switch that is set to off.
One bug was found frame by frame. Winding by holding still grew the ring and lit nothing on the glass. Checked at 25, 50, 75 and 100 percent charge, there was not one photon on the glass until the pointer moved: the light loop slept when the pointer did.
The sounds are real recordings, of unrecorded origin
Charging has a whine and releasing has a click, and I found recordings for both. On 22 September they were cut into three files. Play them here.
Charge, the capacitor winding:
Click, the mechanism alone:
Flash, mechanism and flash together:
Where the recordings came from is not in the repository. The code calls them cuts from recordings of a real film camera, and no file names a source or a licence.
The fitting is recorded. The charge file is a near-pure 18 kHz tone, what a flash capacitor really whines at and almost exactly what most adults cannot hear. It was pitched down to about 4 kHz, then put back the same day because it no longer sounded like a capacitor.
On 23 September the whine was found to pulse every 1.87 seconds. The recording swells, with RMS (average loudness) of 0.28 at the start, 1.00 two thirds through and 0.25 at the end, and looping replayed the swell. Dividing the signal by its own smoothed envelope brought it to 0.93 to 1.00.
The flash fills the page, and the burn outlasts it
The burst used to fade out at 72 percent of its radius, so the corners of a wide screen never lit and it read as a spotlight. It now reaches the farthest corner and peaks at full white.
The afterimage took longer. It began as a clone of the photograph under the pointer, but a flash lights the room, so the burn code photographs the whole page, header and type included.
It is captured when the charge passes halfway, because rasterising (turning the page into pixels) takes tens to hundreds of milliseconds and an afterimage has to be ready when the flash ends. It takes two passes, because fixed elements do not survive cloning. On the home page it took nearly six seconds until off-screen elements were dropped.
I wanted it stronger and much slower. The detail channel went from 0.55 to 1.6 seconds and the residue from 1.1 to 3.2, so the default dwell went from 2.6 to 6.4 seconds. Two bugs hid in the truncation, both found by measuring: the attribute holding the effect open was removed after 3.2 seconds, so the burn snapped out mid-fade, and a peak of 1.15 was clipped by opacity at 1.
A different burn shares the name. A preview switch called burn, from 29 September, is about colour: bright coloured light on the glass reflected as a solid cyan wedge, because each channel was squeezed on its own. Film burns toward white, so the corner went from (50, 255, 255) to (255, 255, 255). The same day, a preview called flash made the shutter a real light in the scene: a speedlight at the eye, falling away with a 0.12 second time constant.
On 1 October I decided that fixes to existing features should be on by default without a trial, and both flash and burn are in the preview list’s on-by-default group.
What is still open
The WebGL light canvases come out empty in the burn, on purpose. The movement trigger is off. The sounds’ origin is not in the repository.
Sources and notes (7)
- Ony's reference cursor — his reference site's cursor, as recorded in the commit that matched it by measurement
- Ony's iris snippet — the blade code he sent, as recorded in the commit
- Ony's shutter recordings — the sounds were cut from his recordings; their origin is not recorded in the repo
- Shutter charge — the notes this was written from
- Shutter audio — the notes this was written from
- Page burn — the notes this was written from
- Camera iris — the notes this was written from
