test: suite completa di §11 e npm run verify verde
- html-validate su tutte le pagine; linkinator su astro preview (link, asset, CSS e ancore), con modalità --external per i siti esterni - e2e Playwright: struttura e metadati di ogni pagina, 404, navigazione, sottomenu, menu mobile, ancore del vecchio sito, nessuna richiesta esterna, nessun cookie, localStorage vuoto, mappa solo dopo il clic, funzionamento senza JavaScript, modulo di contatto - a11y: axe su tutte le pagine a 1440 e 390 px e negli stati interattivi, tastiera (skip link, sottomenu, menu mobile), focus visibile, testo al 200 %, reflow a 320 px, movimento ridotto - check-compliance.mjs: P.IVA, link legali, risorse sicure, segnaposto, JSON-LD, sitemap, robots, .htaccess, badge e servizi, uso di «commercialista», riferimento L. 4/2013, budget - fix: punti di interruzione in em, focus ciclico nel menu mobile, rel="noopener" sui link esterni del Markdown, numeri di telefono non spezzabili Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016zJ9ZWGKvoKoxYwbmnRKdJ
This commit is contained in:
40 files changed
+1798
-114
No files matched your search
+19
-1
@@ -27,13 +27,31 @@ function initMobileMenu(): void {
|
||||
|
||||
closeButton?.addEventListener('click', () => dialog.close());
|
||||
|
||||
// Il focus resta nel menu aperto: Tab dall'ultimo elemento torna al primo e viceversa.
|
||||
dialog.addEventListener('keydown', (event) => {
|
||||
if (event.key !== 'Tab') return;
|
||||
const focusables = Array.from(
|
||||
dialog.querySelectorAll<HTMLElement>('a[href], button:not([disabled])'),
|
||||
).filter((el) => el.offsetParent !== null);
|
||||
if (focusables.length === 0) return;
|
||||
const first = focusables[0];
|
||||
const last = focusables[focusables.length - 1];
|
||||
if (event.shiftKey && document.activeElement === first) {
|
||||
event.preventDefault();
|
||||
last.focus();
|
||||
} else if (!event.shiftKey && document.activeElement === last) {
|
||||
event.preventDefault();
|
||||
first.focus();
|
||||
}
|
||||
});
|
||||
|
||||
dialog.addEventListener('close', () => {
|
||||
setExpanded(openButton, false);
|
||||
openButton.focus();
|
||||
});
|
||||
|
||||
// Se la finestra diventa larga (rotazione, ridimensionamento) il menu mobile si chiude.
|
||||
const desktop = window.matchMedia('(min-width: 960.02px)');
|
||||
const desktop = window.matchMedia('(min-width: 60.001em)');
|
||||
desktop.addEventListener('change', (event) => {
|
||||
if (event.matches && dialog.open) dialog.close();
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user