wip-cambi #5
@@ -20,6 +20,7 @@ Applicazione web **Progressive Web App (PWA)** per tracciare i punteggi di parti
|
|||||||
- Visualizzazione interattiva dei 6 giocatori in campo
|
- Visualizzazione interattiva dei 6 giocatori in campo
|
||||||
- Rotazione automatica regolamentare al cambio palla
|
- Rotazione automatica regolamentare al cambio palla
|
||||||
- Configurazione manuale dei numeri di maglia
|
- Configurazione manuale dei numeri di maglia
|
||||||
|
- Dialog cambi con sostituzione IN/OUT e validazioni
|
||||||
- Supporto logica pallavolo ufficiale (25 punti + 2 di vantaggio, tie-break a 15 nel set decisivo)
|
- Supporto logica pallavolo ufficiale (25 punti + 2 di vantaggio, tie-break a 15 nel set decisivo)
|
||||||
|
|
||||||
- **Controlli Multimodali**
|
- **Controlli Multimodali**
|
||||||
@@ -171,6 +172,7 @@ Serve i file dalla cartella `/dist` per testare la build prima del deploy.
|
|||||||
| `Ctrl + F` | Attiva/disattiva fullscreen |
|
| `Ctrl + F` | Attiva/disattiva fullscreen |
|
||||||
| `Ctrl + S` | Annuncio vocale punteggio corrente |
|
| `Ctrl + S` | Annuncio vocale punteggio corrente |
|
||||||
| `Ctrl + Z` | Switch tra visualizzazione formazioni e punteggio |
|
| `Ctrl + Z` | Switch tra visualizzazione formazioni e punteggio |
|
||||||
|
| `Ctrl + C` | Apri dialog cambi |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -301,36 +301,79 @@ export default {
|
|||||||
window.addEventListener("keydown", this.funzioneTastiSpeciali);
|
window.addEventListener("keydown", this.funzioneTastiSpeciali);
|
||||||
},
|
},
|
||||||
funzioneTastiSpeciali(e) {
|
funzioneTastiSpeciali(e) {
|
||||||
const target = e.target;
|
if (this.diaNomi.show || this.diaCambi.show) {
|
||||||
if (target && (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
|
||||||
|
const target = e.target;
|
||||||
|
const path = typeof e.composedPath === "function" ? e.composedPath() : [];
|
||||||
|
const elements = [target, ...path].filter(Boolean);
|
||||||
|
const isTypingField = elements.some((el) => {
|
||||||
|
if (!el || !el.tagName) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const tag = String(el.tagName).toLowerCase();
|
||||||
|
if (tag === "input" || tag === "textarea") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (el.isContentEditable) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (el.classList && (el.classList.contains("w-input") || el.classList.contains("w-textarea"))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
const contentEditable = el.getAttribute && el.getAttribute("contenteditable");
|
||||||
|
return contentEditable === "true";
|
||||||
|
});
|
||||||
|
if (isTypingField) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let handled = false;
|
||||||
if (e.ctrlKey && e.key == "m") {
|
if (e.ctrlKey && e.key == "m") {
|
||||||
this.diaNomi.show = true
|
this.diaNomi.show = true
|
||||||
|
handled = true;
|
||||||
} else if (e.ctrlKey && e.key == "b") {
|
} else if (e.ctrlKey && e.key == "b") {
|
||||||
this.visuButt = !this.visuButt
|
this.visuButt = !this.visuButt
|
||||||
|
handled = true;
|
||||||
} else if (e.ctrlKey && e.key == "f") {
|
} else if (e.ctrlKey && e.key == "f") {
|
||||||
document.documentElement.requestFullscreen();
|
document.documentElement.requestFullscreen();
|
||||||
|
handled = true;
|
||||||
} else if (e.ctrlKey && e.key == "s") {
|
} else if (e.ctrlKey && e.key == "s") {
|
||||||
this.speak();
|
this.speak();
|
||||||
|
handled = true;
|
||||||
} else if (e.ctrlKey && e.key == "z") {
|
} else if (e.ctrlKey && e.key == "z") {
|
||||||
this.visuForm = !this.visuForm
|
this.visuForm = !this.visuForm
|
||||||
|
handled = true;
|
||||||
} else if (e.ctrlKey && e.key == "ArrowUp") {
|
} else if (e.ctrlKey && e.key == "ArrowUp") {
|
||||||
this.incPunt("home")
|
this.incPunt("home")
|
||||||
|
handled = true;
|
||||||
} else if (e.ctrlKey && e.key == "ArrowDown") {
|
} else if (e.ctrlKey && e.key == "ArrowDown") {
|
||||||
this.decPunt("home")
|
this.decPunt("home")
|
||||||
|
handled = true;
|
||||||
} else if (e.ctrlKey && e.key == "ArrowRight") {
|
} else if (e.ctrlKey && e.key == "ArrowRight") {
|
||||||
this.incSet("home")
|
this.incSet("home")
|
||||||
|
handled = true;
|
||||||
} else if (e.shiftKey && e.key == "ArrowUp") {
|
} else if (e.shiftKey && e.key == "ArrowUp") {
|
||||||
this.incPunt("guest")
|
this.incPunt("guest")
|
||||||
|
handled = true;
|
||||||
} else if (e.shiftKey && e.key == "ArrowDown") {
|
} else if (e.shiftKey && e.key == "ArrowDown") {
|
||||||
this.decPunt("guest")
|
this.decPunt("guest")
|
||||||
|
handled = true;
|
||||||
} else if (e.shiftKey && e.key == "ArrowRight") {
|
} else if (e.shiftKey && e.key == "ArrowRight") {
|
||||||
this.incSet("guest")
|
this.incSet("guest")
|
||||||
|
handled = true;
|
||||||
} else if (e.ctrlKey && e.key == "ArrowLeft") {
|
} else if (e.ctrlKey && e.key == "ArrowLeft") {
|
||||||
this.cambiaPalla()
|
this.cambiaPalla()
|
||||||
|
handled = true;
|
||||||
|
} else if (e.ctrlKey && (e.key == "c" || e.key == "C")) {
|
||||||
|
this.apriDialogCambi()
|
||||||
|
handled = true;
|
||||||
} else { return false }
|
} else { return false }
|
||||||
|
|
||||||
|
if (handled) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user