Conveyor belt list: an endless list from ten elements, drawn round two rollers

A list with no first and no last row, shown as the face of a conveyor belt. Rows come up from underneath round the bottom roller, travel up the flat face, and go over the top roller to the back. The document holds ten row elements whatever the position: an element that has gone over a roller is given the content of the next row to arrive.

The belt

Drag the belt up or down, or flick it. Tick a parcel or open it: each row is a real element with a checkbox and a button. The motor runs the belt by itself.

Rows are numbered from 0 and the numbers go on in both directions. Arrow keys and Page Up and Page Down move the belt while something in it has the focus. The wheel moves it while the pointer is over it.

Show the code

How it works

The canvas has ten drawable children. Row i of the list is shown by element i mod 10, so an element is refilled only when its row is past the crest of a roller.

Moving the belt doesn't draw any element. Each element's picture is drawn with drawElementImage() once after it changes, copied into a plain canvas with drawImage(), and wiped. A frame of the belt is cut from that copy: one piece for the part of a row on the flat face, and pieces 3 px of belt long round a roller, each drawn shorter, narrower and darker by the angle it has turned.

Because no element is drawn where it appears, the canvas tells the browser where each row is with updateElementGeometry(). That's what lets a tap reach a checkbox on a moving row.

Show the code

Live checks

These run on their own fixtures, after a tap.

Findings

Measured in headless Chromium 157 on 2026-11-22. Not yet run on a phone.