KQ-1826 · PULLED/SUGAR

Pulled Sugar

A candy-pulling machine whose two arm pins orbit opposite ways round a fixed middle pin, with a rope of striped sugar looped over all three: a soft body of particles under gravity, carried by the pins' grip, that stretches plastically and necks thin where it is pulled and slowly gathers back. Every pass folds it over the middle pin, the stripes doubling along the rope from the fold until they read as satin, while a gloss highlight runs along the side of each span that faces a swaying light. Dragging an arm turns it 1:1 and the release sets the motor's speed, forwards or reversed, the flywheel easing to it on the springs.drift constants; arrow keys step the speed.

KQ-1826 · PULLED/SUGAR

Waylight Confectioners · pulled to order

Saturday taffy, in the window

Drag an arm round to turn the machine faster, slower or backwards, or use the arrow keys. Space stops and starts it; Enter drops a fresh batch.

pulling 18 rpm · 3 stripes · fold 0

Install

One command — the source lands in your repo. Or copy it from the Code tab.

$ pnpm dlx shadcn@latest add @kinetiq/pulled-sugar

Props

speed / defaultSpeed
number
default 18
The motor's speed in turns a minute, negative runs it backwards; controlled or the uncontrolled start.
onSpeedChange
(speed: number) => void
default —
Fires from the throw, key or stop that changed the motor's speed, in whole turns a minute.
stretch
number
default 0.5
How readily the sugar stretches, 0 stiff to 1 soft with long sags and thin necks.
gloss
number
default 0.6
How glassy the candy is, 0 matte to 1 a sharp, bright highlight.
palette
"berry" | "mint" | "honey" | "lilac"
default "berry"
The candy's three colours.
colors
string[]
default —
Three CSS colours for the stripes, overriding palette.
batch
number
default 8
Folds before a fresh batch drops on; 0 keeps pulling the same one.
maxSpeed
number
default 60
The fastest the motor turns either way, 10 to 90 turns a minute.
ropeWidth
number
default 24
The rope's thickness before it is pulled, in the machine's own units (it is drawn 280 wide).
onFold
(folds: number, stripes: number) => void
default —
Fires on every fold, and with 0 when a fresh batch starts, with the folds so far in this batch and the stripes across the rope.
label
string
default "Candy puller speed"
The slider's accessible name.
paused
boolean
default false
Stops the machine and the candy where they are.
disabled
boolean
default false
No dragging or keys.
seed
number
default 3
Seeds the stripes' order.
dpr
number
default 2
Cap on the canvas's device pixel ratio, at most 2.
className
string
default —
Sizes the piece; the machine scales to fit and centres. 224px tall by default.