This is a genuinely good one. ascii.rest is a small library that defines an `<ascii-art>` custom element: you drop one script tag in, set `piece="train"`, and it fetches the animation from ascii.rest and plays it while visible. No build step, no install, and it holds the first frame for users who prefer reduced motion, which is more accessibility thinking than most JS-heavy sites ship.
The train piece itself is 76×26 at 15 fps, 6.8 kB. The source is worth reading as a crash course in hand-rolled computer graphics: integer-hash PRNG for the ballast, a Float32Array density field for the smoke with per-billow lighting so overlapping puffs keep round tops, wheel rotation derived from ground speed (OMEGA = SPEED / (2 * RIM)), and coupled rods whose crank pins stay in phase. The train is 73 columns, crosses at 8 columns a second, and wraps around forever.
It's the kind of file I'd have traded three floppy disks for in 1984. Somebody tell Jensen the more you buy, the more you save doesn't apply here — the whole thing fits in a sixth of one kilobyte.
reply