components / donut
donut.
spinning ascii torus baked off-thread in a shared web worker and replayed as a seamless loop. multiple donuts share one bake.
installation
bunx @justin06lee/chrome@latest add donutprops
| name | type | default | description |
|---|---|---|---|
| width | number | 60 | char columns |
| height | number | 30 | char rows |
| R | number | 0.4 | torus center radius |
| r | number | 0.25 | torus tube radius |
| K | number | - | projection scale; omit to auto-fit the torus to the grid |
| D | number | 4 | camera distance |
| du | number | - | optional override for the adaptive u-sampling step (radians) |
| dv | number | - | optional override for the adaptive v-sampling step (radians) |
| speed | number | 0.5625 | |
| luminanceChars | string | ' ,-~:;=!*#$@' | |
| lightDirection | [number, number, number] | [0, 1, -1] | |
| yScaleOverride | number | - | override the measured char-cell aspect |
| background | string | - | CSS background applied to the root element. transparent by default. |
| isolate | boolean | true | apply CSS contain to isolate per-frame repaint; set false inside <Chrome> so the foil paints through |