Kinetic quotes
Inspired by https://x.com/iamnotsrc
Build a single self-contained HTML file (one file, no frameworks, under 500 KB) that shows an animated quote display on a full-screen <canvas>. LOOK Pure black background (#000), pure white text (#fff). No other colours anywhere. The only exception is the ASCII lead-in described below, which may use two greys (#4e4e4e and #9a9a9a). Font: JetBrains Mono, weight 500, all caps. Embed the font as a base64 woff2 inside an @font-face rule (font-display:block) so the file works offline. One block of text, centred horizontally and vertically. Auto-size it so the widest line of any quote fills about 78% of the window width (cap at 60% of the height, minimum 16px, maximum 96px). Line height 1.16× the font size. Re-layout on resize, and use devicePixelRatio (up to 2) for sharp text. Nothing else on the page. No UI, no settings. CONTENT Cycle through these public-domain quotes in random order, never showing the same one twice in a row. Each quote is 2–4 lines, ends with the author, and has geometric symbols scattered between the words: NO MAN EVER STEPS / IN THE SAME RIVER ◆ TWICE / ✦ HERACLITUS WE SUFFER MORE OFTEN / IN IMAGINATION ● THAN / IN REALITY ✳ / ◐ SENECA THE JOURNEY OF ▲ A THOUSAND MILES / BEGINS WITH ✦ A SINGLE STEP / ● LAO TZU WELL DONE ✳ IS BETTER / THAN WELL SAID ◆ / ↻ BENJAMIN FRANKLIN DO I CONTRADICT MYSELF? ✦ / VERY WELL ● THEN / I CONTRADICT MYSELF / ◆ WALT WHITMAN SIMPLIFY ✦ SIMPLIFY ◆ / ● HENRY DAVID THOREAU TO BE GREAT ◆ IS TO BE / MISUNDERSTOOD ✳ / ● RALPH WALDO EMERSON THE HAPPINESS OF YOUR LIFE / DEPENDS ◆ UPON THE QUALITY / OF YOUR THOUGHTS ✦ / ● MARCUS AURELIUS FIRST SAY TO YOURSELF ◐ / WHAT YOU WOULD BE ✦ / THEN DO WHAT YOU HAVE TO DO / ▲ EPICTETUS LIFECYCLE OF EACH QUOTE (driven by one clock that pauses when paused) ASCII lead-in, about 1.1 s. Every character cell of the quote (spaces included) shows a character from the ramp " .:-=+#%@", so the quote's shape appears as ASCII texture. Cells appear left to right with some randomness (each cell appears at leadIn × (0.55 × column/columns + 0.35 × random)). Choose each cell's character from a moving sine/cosine field over column, line and time, so it ripples. Spaces only use the lightest characters. Draw dense characters in #9a9a9a and light ones in #4e4e4e. The 3 cells just ahead of the typing cursor are white. Stay in this phase until document.fonts.ready resolves. Typing, 28 ms per character. Characters are revealed in order and replace the ASCII. Each newly typed letter shows random characters from A–Z, 0–9 and #%&@$/<>+= for about 4 character-durations before settling. Hold for about 2.6 s. Erase from the front: characters disappear from the first one onward, twice as fast as typing. Pause 0.5 s, then pick the next quote. CURSOR A white square (88% of the line height) follows just after the last visible character. Inside it, a black ✳ spins continuously. When the cursor reaches the end of a line it sits a little further out. It blinks (450 ms) during the hold, and is hidden during the ASCII lead-in. SPINNING SYMBOLS Every symbol character (✱✦✳◆◇●○◐◑▲△■□↻⊕※✺∞✚✕✶✷✸✹⁂) is drawn rotated about its own centre with ctx.rotate. Each one gets a random direction, a speed between 0.6× and 2×, and a random starting angle. Each also pulses its scale by ±12% on a sine. WORD HIGHLIGHTS Words are runs of letters, digits and apostrophes. Every 90–350 ms, each word has a 35% chance to be re-rolled. When re-rolled, it becomes highlighted 40% of the time and plain otherwise. A highlighted word gets a solid white rectangle behind it, the full line height, wiping in from the left over about 110 ms with an ease-out curve, and its text turns black. Only the visible part of a partly typed or partly erased word is highlighted. INTERACTION Pointer movement adds "energy" in proportion to distance moved (capped at 1.5). Energy decays exponentially, to about 12% after one second. Energy speeds up symbol spin (×(1 + 3·energy)) and the highlight flicker. While energy is high, letters occasionally glitch to random characters. Click or tap skips to the next quote and adds a burst of energy. The Space key pauses and resumes. With prefers-reduced-motion, keep the animation but calm it: spin at 35% speed, no letter scrambling, slower ASCII ripple. ROBUSTNESS In the requestAnimationFrame loop, schedule the next frame first, clamp dt to between 0 and 100 ms (the first frame's timestamp can precede performance.now() taken at script start), and wrap the drawing in try/catch so one bad frame never stops the animation. Wrap colour lookups by index so they can never come back undefined. Include a visually hidden <h1> containing the current quote's text, for screen readers.

