From 970adf48535e882499f5e516b6252d18cb3fa5d3 Mon Sep 17 00:00:00 2001 From: Tom Boullay Date: Sat, 30 May 2026 18:44:03 +0200 Subject: [PATCH] feat(a11y): WCAG AA polish on the site onboarding flow - index.css: add visible :focus-visible rings for .site-card-button and .site-button so keyboard users can see where focus lives - SiteCard: drop outline:none, add aria-pressed and aria-label so screen readers announce selection state - SiteButton: add the .site-button class for the shared focus ring - SiteDisclaimerScreen: keyboard skip via Enter / Space / Escape, a role="region" + aria-label wrapper and aria-live="polite" on the message; honour prefers-reduced-motion on the fade - IntroVideoPlayer: role="region" with a skip hint in aria-label, preload="auto", and aria-hidden on the decorative caption span --- src/components/site/SiteButton.tsx | 1 + src/components/site/SiteCard.tsx | 20 +++++--------- src/components/site/SiteDisclaimerScreen.tsx | 29 ++++++++++++++------ src/components/ui/intro/IntroVideoPlayer.tsx | 22 +++++++-------- src/index.css | 12 ++++++++ 5 files changed, 52 insertions(+), 32 deletions(-) diff --git a/src/components/site/SiteButton.tsx b/src/components/site/SiteButton.tsx index cee1f8a..f1ceb38 100644 --- a/src/components/site/SiteButton.tsx +++ b/src/components/site/SiteButton.tsx @@ -21,6 +21,7 @@ export function SiteButton({ onMouseDown={() => setIsPressed(true)} onMouseUp={() => setIsPressed(false)} onMouseLeave={() => setIsPressed(false)} + className="site-button" style={{ display: "inline-flex", padding: "12px 20px", diff --git a/src/components/site/SiteCard.tsx b/src/components/site/SiteCard.tsx index df2e1b3..97ae7d1 100644 --- a/src/components/site/SiteCard.tsx +++ b/src/components/site/SiteCard.tsx @@ -22,23 +22,18 @@ export function SiteCard({ return "#b8b8b8"; }; - const getBorder = (): string => { - if (selected) return "3px solid #a8d5a2"; - if (isSituation) return "3px solid rgba(255, 255, 255, 0.55)"; - if (disabled) return "3px solid rgba(255, 255, 255, 0.55)"; - return "3px solid rgba(255, 255, 255, 0.55)"; - }; + const borderColor = selected ? "#a8d5a2" : "rgba(255, 255, 255, 0.55)"; - const getTextColor = (): string => { - if (disabled) return "rgba(77, 77, 77, 0.72)"; - return "#4d4d4d"; - }; + const textColor = disabled ? "rgba(77, 77, 77, 0.72)" : "#4d4d4d"; return (