Skip to content
Crafts

The decoding motto

Craft 09 · Type, motion

Never the same line twice in a row.

The line under my name on the home page, on its own.

Mostly tools I wanted to exist.

Fig. 1Press for another line.

Each letter gets its own moment to settle: 38 ms after the one before it, plus up to 120 ms of chance. Until then it shows a random letter. Spaces never scramble, so the shape of the sentence is there from the first frame and your eye already knows how long it is.

lib/ascii/decode.ts · ts
export function decoder(final: string, t0: number) {
  const at = [...final].map((_, i) => t0 + 300 + i * 38 + Math.random() * 120);
  return (t: number) => {
    let text = "";
    let done = true;
    for (let i = 0; i < final.length; i++) {
      if (final[i] === " " || t >= at[i]) text += final[i];
      else {
        text += LETTERS[Math.floor(Math.random() * 26)];
        done = false;
      }
    }
    return { text, done };
  };
}

On my home page the line changes on every visit. The index of the last one is kept in local storage and skipped when the next one is picked, so a reload never shows you the same line twice in a row. If storage is blocked, it just picks at random.