fix: correzioni della revisione finale (testi, visuale, brief, codice)
- testi: «lo Studio» uniforme, «Centro autorizzato CAF», ripetizioni tolte nei servizi e in «Lo studio», valori senza superlativi, meta corrette, testo della mappa di §10.2, numeri e indirizzi con spazi non separabili - visuale: breadcrumb, anello della banda CTA, card dei professionisti, pager e sidebar dei servizi su mobile, pagine legali a colonna singola, pulsante e-mail su una riga, card sedi allineate - dati: fatti della sede di Asti da studio.ts/testi.ts, sede.telefono - 404 e conferma senza canonical; avviso mappa senza JavaScript - controlli: CSP per direttive (endpoint), anno da SOURCE_DATE_EPOCH, URL del sito controllati sulla build locale, import file:// e tar da stdin per Windows, .gitattributes, porta libera corretta - modulo: pattern del telefono valido, avviso visibile, Esc sul sottomenu aperto al passaggio del mouse; contact.php con -f, senza mbstring obbligatorio, fuso Europe/Rome - release: note --shell-safe, ripiego REST automatico, RELEASE_TOKEN; deploy di esempio senza esclusione di contact.php; nginx /privacy/ - DECISIONS D-040–D-044, TODO C4 e riferimenti di riga aggiornati Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016zJ9ZWGKvoKoxYwbmnRKdJ
This commit is contained in:
51 files changed
+560
-185
No files matched your search
@@ -63,6 +63,13 @@ function init(form: HTMLFormElement): void {
|
||||
const summary = form.querySelector<HTMLElement>('[data-form-summary]');
|
||||
const summaryList = form.querySelector<HTMLElement>('[data-form-summary-list]');
|
||||
const status = form.querySelector<HTMLElement>('[data-form-status]');
|
||||
// avviso visibile per chi non usa uno screen reader (lo stesso testo va anche in `status`)
|
||||
const notice = form.querySelector<HTMLElement>('[data-form-notice]');
|
||||
const showNotice = (text: string | null) => {
|
||||
if (!notice) return;
|
||||
notice.textContent = text ?? '';
|
||||
notice.hidden = !text;
|
||||
};
|
||||
const fields = Array.from(
|
||||
form.querySelectorAll<Field>('input[required], textarea[required]'),
|
||||
).filter((f) => f.type !== 'hidden');
|
||||
@@ -90,6 +97,7 @@ function init(form: HTMLFormElement): void {
|
||||
if (message) invalid.push({ field, message });
|
||||
}
|
||||
|
||||
showNotice(null);
|
||||
if (invalid.length > 0) {
|
||||
event.preventDefault();
|
||||
if (summary && summaryList) {
|
||||
@@ -122,6 +130,7 @@ function init(form: HTMLFormElement): void {
|
||||
if (Date.now() - loadedAt < minMs) {
|
||||
event.preventDefault();
|
||||
if (status) status.textContent = m.rapido;
|
||||
showNotice(m.rapido);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+12
-1
@@ -5,7 +5,9 @@
|
||||
* - Menu mobile: <dialog> modale aperto con `showModal()`; Esc e il pulsante «Chiudi» lo
|
||||
* chiudono; il focus passa al pulsante di chiusura e, alla chiusura, torna al pulsante menu.
|
||||
* - Sottomenu: pulsanti con `aria-expanded`; Esc chiude il sottomenu aperto e riporta il focus
|
||||
* sul pulsante; un clic all'esterno o l'uscita del focus chiudono il sottomenu desktop.
|
||||
* sul pulsante; un clic all'esterno o l'uscita del focus chiudono il sottomenu desktop. Esc
|
||||
* chiude anche il sottomenu aperto al passaggio del mouse (`data-dismissed` fino all'uscita
|
||||
* del puntatore dalla voce).
|
||||
*/
|
||||
|
||||
function setExpanded(toggle: HTMLElement, open: boolean): void {
|
||||
@@ -70,6 +72,8 @@ function initSubmenus(): void {
|
||||
const open = toggle.getAttribute('aria-expanded') !== 'true';
|
||||
closeAll(toggle);
|
||||
setExpanded(toggle, open);
|
||||
const parent = toggle.closest<HTMLElement>('[data-submenu]');
|
||||
if (parent) delete parent.dataset.dismissed;
|
||||
});
|
||||
|
||||
// Sottomenu desktop: si chiude quando il focus esce dalla voce.
|
||||
@@ -78,10 +82,17 @@ function initSubmenus(): void {
|
||||
const next = event.relatedTarget as Node | null;
|
||||
if (!next || !item.contains(next)) setExpanded(toggle, false);
|
||||
});
|
||||
item?.addEventListener('mouseleave', () => {
|
||||
delete item.dataset.dismissed;
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('keydown', (event) => {
|
||||
if (event.key !== 'Escape') return;
|
||||
// sottomenu aperti al passaggio del mouse: nascosti finché il puntatore non esce
|
||||
for (const item of document.querySelectorAll<HTMLElement>('[data-submenu]')) {
|
||||
if (!item.closest('dialog') && item.matches(':hover')) item.dataset.dismissed = '';
|
||||
}
|
||||
const open = toggles.find(
|
||||
(t) => t.getAttribute('aria-expanded') === 'true' && !t.closest('dialog'),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user