Skip to content

Type the home headline round and round, with a pause control - #2

Merged
rdlu merged 1 commit into
mainfrom
dev
Oct 17, 2026
Merged

rdlu merged 1 commit into
mainfrom
dev

Conversation

@rdlu

@rdlu rdlu commented Oct 17, 2026

Copy link
Copy Markdown
Owner

The home page's headline now works like the NMSii hero (rdlu/nms-items-interface#25). It types each line, holds it, backspaces it and moves on to the next, round and round, with a 35-70 ms jitter between keys.

Lines

The lines are in the hero front matter of site/content/_index.md, each written as { text, hold }. Adding, dropping or retiming a line changes one line there. layouts/_shortcodes/hero-typed.html renders them.

# Line Hold
1 plugii: a live USB port monitor for Linux 4.5 s
2 Know what every USB port is really doing 5 s (the tagline)
3 10G capable, linked at 5G. It's the cable. 2.5 s
4 USB-C: the C is for Could be anything. 2.5 s

Behaviour

  • Return visits: the site isn't a SPA, so "once per page load" becomes once per tab session (sessionStorage). Coming back to the home page picks up at the tagline, already typed.
  • Cursor: the block cursor stays solid while text is typed or erased, and blinks while a line is held or paused.
  • No layout shift: every line sits invisibly in the h1's grid cell. The > prompt and the cursor are on each line, so they all wrap the same way.
  • Pause toggle (WCAG 2.2.2): ‖ pause / ▶ resume. It is a 24 px button positioned absolutely in the headline's bottom margin, with an aria-label that changes with its state and a focus ring.
  • Automatic holds: the rotation also stops while the mouse is over the line (mouse only), while the toggle has keyboard focus, while the tab is hidden, and while the hero is scrolled out of view. Resuming with the toggle also lifts the focus hold.
  • Screen readers, reduced motion and no-JS: screen readers hear only the tagline (the h1's aria-label). With reduced motion or without JS, the tagline shows still and there is no toggle.

The NMSii PR's Enter-key fix doesn't apply here, because the docs site has no page-wide key handler that takes Enter.

Checks

These ran in headless chromium against hugo server:

  • Height: the h1 was sampled every 50 ms for 28 s, which covers all four lines.
    • At 1400 px the h1 was always 64 px tall, in both dark and light themes.
    • At 390 px it was always 160 px tall, in both themes.
    • The subtitle's top never moved.
  • Holds, each started mid-typing: hover, a hidden tab and the hero scrolled away each kept the text frozen for 5.5 s, and the typing resumed afterwards.
  • Toggle: keyboard focus on it holds the rotation, Enter pauses it, and Enter again resumes it.
  • Return visit: a reload in the same tab starts on the tagline.
  • Reduced motion: the tagline is static and the toggle stays hidden.

🤖 Generated with Claude Code

The hero now types each line of the home page's `hero` front matter, holds
it, backspaces it and moves on, with a 35-70 ms jitter a key. The tagline
is the h1's aria-label and what reduced motion and no-JS get; a return
visit in the same tab picks up at it. Every line sits invisibly in the h1's
grid cell, so the typing never moves the page.

A `‖ pause` toggle in the headline's bottom margin stops it (WCAG 2.2.2);
it also holds while the mouse is over the line, the toggle has keyboard
focus, the tab is hidden or the hero is scrolled away.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rdlu
rdlu merged commit 6eb0e45 into main Oct 17, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant