fix(a11y): reduced motion, screen-reader text and route-level splitting

Typewriter reads useReducedMotion: under reduced motion the timer never starts and the first role renders whole, while a screen-reader-only span exposes the full role list once instead of one keystroke at a time. BackToTop scrolls instantly under reduced motion and is labelled in the active language; the nav landmark and the mode toggle stop being English-only. The hero photo declares its measured 1200x1600 canvas plus fetch priority so the box is reserved before the 898 kB image decodes. HomePage stays eagerly imported because it owns the LCP; the other six routes lazy-load behind one Suspense boundary, which is also why the pages barrel is gone.
This commit is contained in:
dong.nguyen committed 2026-10-18 23:45:47 +07:00
1 parent 0c4aea32b5
commit 63afc1b505
8 files changed
+71 -41

No files matched your search

+3 -3
View File
@@ -57,7 +57,7 @@ export function Navigation() {
return (
<>
<nav className="nav" role="navigation" aria-label="Main navigation">
<nav className="nav" role="navigation" aria-label={strings.nav.mainNav[lang]}>
<div className="nav-container">
<div className="nav-brand">
{/* Trigger first, brand next: the hamburger is the sheet's own control and sits at
@@ -143,8 +143,8 @@ export function Navigation() {
<button
className="nav-control theme-toggle"
onClick={cycleTheme}
aria-label={`Switch theme (currently ${resolvedTheme})`}
title={`Theme: ${resolvedTheme}`}
aria-label={`${strings.nav.themeSwitch[lang]} (${resolvedTheme === 'dark' ? strings.nav.themeDark[lang] : strings.nav.themeLight[lang]})`}
title={`${strings.nav.themeMode[lang]}: ${resolvedTheme === 'dark' ? strings.nav.themeDark[lang] : strings.nav.themeLight[lang]}`}
>
{resolvedTheme === 'dark' ? (
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">