From 26d647dce7acdd50970c45087c1d0417aebe8261 Mon Sep 17 00:00:00 2001 From: Davide Grilli Date: Sun, 25 Jan 2026 17:46:31 +0100 Subject: [PATCH 1/3] Aggiunge configurazione manuale numeri di maglia MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Aggiunge campi input nel dialog configurazione per modificare manualmente i numeri di maglia dei giocatori - Disegna campi da pallavolo stilizzati (220x220px) con linea dei 3 metri posizionata a 1/3 dall'alto - Layout corrisponde alla visualizzazione sul campo (ordine rotazione [3,2,1,4,5,0]) - Proporzioni realistiche: zona anteriore 33%, zona posteriore 67% - Sfondo marrone chiaro e bordi grigi per migliore leggibilità --- src/components/HomePage/HomePage.html | 53 ++++++++++++++++++++++++--- src/style.css | 40 ++++++++++++++++++++ 2 files changed, 88 insertions(+), 5 deletions(-) diff --git a/src/components/HomePage/HomePage.html b/src/components/HomePage/HomePage.html index 38b97c7..2298f88 100644 --- a/src/components/HomePage/HomePage.html +++ b/src/components/HomePage/HomePage.html @@ -1,9 +1,52 @@
- - Home - Guest - Inverti ordine - + + Nome Home + Nome Guest + + +
+
Formazione Home
+
+ + + + + + + +
+ + + + + + +
+
+ +
+
Formazione Guest
+
+ + + + + + + +
+ + + + + + +
+
+
+ + Inverti ordine + Ok
diff --git a/src/style.css b/src/style.css index 03f06b1..166e800 100644 --- a/src/style.css +++ b/src/style.css @@ -121,4 +121,44 @@ button:focus-visible { background-color: rgb(206, 247, 3); color: blue; border-radius: 5px; +} + +.campo-config { + display: flex; + flex-direction: column; + align-items: center; +} + +.campo-pallavolo { + border: 3px solid #999; + background-color: rgba(205, 133, 63, 0.25); + position: relative; + width: 220px; + height: 220px; + display: flex; + flex-direction: column; + padding: 0; +} + +.fila-anteriore { + height: 33.33%; + display: flex; + align-items: center; + justify-content: center; + padding: 5px; +} + +.fila-posteriore { + height: 66.67%; + display: flex; + align-items: center; + justify-content: center; + padding: 5px; +} + +.linea-tre-metri { + border-top: 2px solid #666; + width: 100%; + height: 0; + margin: 0; } \ No newline at end of file -- 2.49.1 From bbe08622414bfef572eeba3f5b25ca29b7fe5dd6 Mon Sep 17 00:00:00 2001 From: Davide Grilli Date: Sun, 25 Jan 2026 17:57:22 +0100 Subject: [PATCH 2/3] Implementa rotazione regolamentare con cambio palla - La formazione ruota solo quando si conquista il servizio (cambio palla) - Aggiunge array servizioPrecedente per tracciare i cambi palla - Fix decPunt per annullare correttamente la rotazione - Fix resetta per pulire lo stack dei servizi precedenti --- src/components/HomePage/HomePage.js | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/components/HomePage/HomePage.js b/src/components/HomePage/HomePage.js index 102b54f..1c9a871 100644 --- a/src/components/HomePage/HomePage.js +++ b/src/components/HomePage/HomePage.js @@ -24,6 +24,7 @@ export default { home: ["1", "2", "3", "4", "5", "6"], guest: ["1", "2", "3", "4", "5", "6"], }, + servizioPrecedente: [], // Stack per tracciare i cambi palla }, } }, @@ -66,6 +67,7 @@ export default { guest: ["1", "2", "3", "4", "5", "6"], } this.sp.striscia = { home: [0], guest: [0] } + this.sp.servizioPrecedente = [] }, incSet(team) { if (this.sp.set[team] == 2) { @@ -89,8 +91,16 @@ export default { this.sp.striscia.guest.push(this.sp.punt.guest) this.sp.striscia.home.push(' ') } + + // Ruota la formazione solo se c'è cambio palla (conquista del servizio) + const cambioPalla = (team == "home" && !this.sp.servHome) || (team == "guest" && this.sp.servHome); + this.sp.servizioPrecedente.push(cambioPalla); // Salva se c'è stato cambio palla + + if (cambioPalla) { + this.sp.form[team].push(this.sp.form[team].shift()); + } + this.sp.servHome = (team == "home"); - this.sp.form[team].push(this.sp.form[team].shift()); }, checkVittoria() { const puntHome = this.sp.punt.home; @@ -117,12 +127,20 @@ export default { if (this.sp.striscia.home.length > 1) { var tmpHome = this.sp.striscia.home.pop() var tmpGuest = this.sp.striscia.guest.pop() + var cambioPalla = this.sp.servizioPrecedente.pop() // Recupera se c'era stato cambio palla + if (tmpHome == ' ') { this.sp.punt.guest-- - this.sp.form.guest.unshift(this.sp.form.guest.pop()); + // Ruota indietro solo se c'era stato un cambio palla + if (cambioPalla) { + this.sp.form.guest.unshift(this.sp.form.guest.pop()); + } } else { this.sp.punt.home-- - this.sp.form.home.unshift(this.sp.form.home.pop()); + // Ruota indietro solo se c'era stato un cambio palla + if (cambioPalla) { + this.sp.form.home.unshift(this.sp.form.home.pop()); + } } } }, -- 2.49.1 From 6c6ac7fc291b2c75f9fe41bc40d6e0269a3e5952 Mon Sep 17 00:00:00 2001 From: davide3011 Date: Mon, 26 Jan 2026 13:45:22 +0100 Subject: [PATCH 3/3] Limita il cambio palla solo a inizio set (0-0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Aggiunge computed property isPunteggioZeroZero per verificare lo stato del punteggio - Crea metodo cambiaPalla() con validazione che blocca il cambio se il punteggio non è 0-0 - Disabilita il pulsante cambio palla quando il punteggio non è 0-0 - Mostra notifica di avviso se si tenta il cambio palla durante il set - Aggiorna scorciatoia tastiera Ctrl+ArrowLeft per usare la stessa validazione --- src/components/HomePage/HomePage.html | 2 +- src/components/HomePage/HomePage.js | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/components/HomePage/HomePage.html b/src/components/HomePage/HomePage.html index 2298f88..a179fb1 100644 --- a/src/components/HomePage/HomePage.html +++ b/src/components/HomePage/HomePage.html @@ -149,7 +149,7 @@ - + diff --git a/src/components/HomePage/HomePage.js b/src/components/HomePage/HomePage.js index 1c9a871..0741da9 100644 --- a/src/components/HomePage/HomePage.js +++ b/src/components/HomePage/HomePage.js @@ -38,6 +38,11 @@ export default { } this.abilitaTastiSpeciali(); }, + computed: { + isPunteggioZeroZero() { + return this.sp.punt.home === 0 && this.sp.punt.guest === 0; + } + }, methods: { closeApp() { var win = window.open("", "_self"); @@ -69,6 +74,13 @@ export default { this.sp.striscia = { home: [0], guest: [0] } this.sp.servizioPrecedente = [] }, + cambiaPalla() { + if (!this.isPunteggioZeroZero) { + this.$waveui.notify("Cambio palla consentito solo a inizio set (0-0)", "warning"); + return; + } + this.sp.servHome = !this.sp.servHome; + }, incSet(team) { if (this.sp.set[team] == 2) { this.sp.set[team] = 0; @@ -216,7 +228,7 @@ export default { } else if (e.shiftKey && e.key == "ArrowRight") { this.incSet("guest") } else if (e.ctrlKey && e.key == "ArrowLeft") { - this.sp.servHome = !this.sp.servHome + this.cambiaPalla() } else { return false } } } -- 2.49.1