Skip to content

a11y: reduced-motion guards + visually-hidden headings for demo apps#6

Merged
jonfroehlich merged 1 commit into
mainfrom
a11y/reduced-motion-and-headings
Jun 22, 2026
Merged

a11y: reduced-motion guards + visually-hidden headings for demo apps#6
jonfroehlich merged 1 commit into
mainfrom
a11y/reduced-motion-and-headings

Conversation

@jonfroehlich

Copy link
Copy Markdown
Member

Addresses the two follow-ups from #5 (the June 2026 a11y pass).

Changes

Visually-hidden <h1> per demo (14 canvas apps) — adds a shared .visually-hidden utility to each app's style.css (inline <style> for basic/Basic, which has no stylesheet) and an <h1> as the first child of <main>, each prefaced with a short comment explaining its purpose. Completes the document heading structure for screen-reader navigation with no visual change. MorphPaths already has a visible <h1>, so it's left as-is.

prefers-reduced-motion — freezes the autonomous, auto-playing demos (BouncyBall, GridFade, LeafFall, ZoomFade): they render a single settled frame instead of starting the rAF loop, react live to the setting changing, and repaint the static frame on resize. SantaMorph's morph is mouse-driven, so only its self-pulsing text glow is held steady. The remaining morph demos (TriangleArtMorphTest, TriangleArtMorphTest2, MorphPaths, ReverseExplosion/2) are mouse-driven direct manipulation and are intentionally left untouched.

Verification

Driven in Chrome via Playwright: reduced motion freezes the loop while no-preference animates, and the hidden <h1> is exposed as a heading in the accessibility tree while clipped to 1×1px visually. All modified JS passes node --check.

No src/lib/ changes → no dist/ rebuild needed. Gallery and previews/ are CI-regenerated on push.

Closes #5

🤖 Generated with Claude Code

Addresses the two follow-ups from issue #5 (the June 2026 a11y pass).

Visually-hidden <h1> per demo (14 canvas apps): adds a shared
`.visually-hidden` utility to each app's style.css (inline <style> for
basic/Basic, which has no stylesheet) and an <h1> as the first child of
<main>, each prefaced with a short comment explaining its purpose. This
completes the document heading structure for screen-reader navigation
without any visual change. MorphPaths already has a visible <h1>, so it
is left as-is.

prefers-reduced-motion: freezes the autonomous, auto-playing animations
(BouncyBall, GridFade, LeafFall, ZoomFade) — they render a single settled
frame instead of starting the rAF loop, react live to the setting changing,
and repaint the static frame on resize. SantaMorph's morph is mouse-driven,
so only its self-pulsing text glow is held steady. The remaining morph demos
(TriangleArtMorphTest, TriangleArtMorphTest2, MorphPaths, ReverseExplosion[2])
are mouse-driven direct manipulation and are intentionally left untouched.

Verified in Chrome via Playwright: reduced motion freezes the loop while
no-preference animates, and the hidden <h1> is exposed as a heading in the
accessibility tree while clipped to 1x1px visually.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jonfroehlich jonfroehlich merged commit 23a63be into main Jun 22, 2026
1 check passed
@jonfroehlich jonfroehlich deleted the a11y/reduced-motion-and-headings branch June 22, 2026 18:41
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.

Demo-app accessibility follow-ups (reduced-motion + headings)

1 participant