ASCII OrbPRO
A spinning donut, globe or rippling pool rendered in ASCII with a luminance ramp.
Code
1 file · 327 lines of TypeScriptPRO
ASCII Orb is part of Pro
Get its source, the one-paste agent prompt and all 113 components, for a one-time $99.
Motion notes
- Real 3D, then quantised: surface points are rotated, perspective-projected and z-buffered into a character grid, and Blinn-Phong lighting picks a glyph from ' .:-=+*#%@'. Every surface cell gets at least '.', so silhouettes stay whole.
- Capped at 30fps on purpose: the slight step reads as a terminal redraw, not a video. It only runs while on screen, and reduced motion shows one still frame.
- Built for inline sizes: the default 22×11 grid is square at any width because a mono cell is twice as tall as it is wide. Drop to 12×6 or 14×7 for 24–40px icons.
- No React state per frame. Sample points are precomputed into typed arrays once per shape and grid, and each frame writes one string to the <pre>'s textContent (about 0.05ms).
Usage
Example
<AsciiOrb shape="torus" size={96} />
<StatusPill icon={<AsciiOrb shape="sphere" size={30} cols={12} rows={6} />} label="Thinking" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| shape | "torus" | "sphere" | "wave" | "torus" | torus: the classic spinning donut. sphere: a banded globe on a tilted axis. wave: a rippling pool seen from above. |
| size | number | 64 | Width in px. Font size is derived from it, and height from the grid. |
| cols | number | 22 | Characters per row. |
| rows | number | 11 | Rows. Half of cols gives a square. |
| ramp | string | " .:-=+*#%@" | Luminance ramp, darkest to brightest. The first character is the background. |
| speed | number | 1 | Playback multiplier. |
| className | string | — | Classes for the <pre>. Color comes from text-fg by default. |