From fdd009449eac00e892e00059e87abd8820b333f9 Mon Sep 17 00:00:00 2001 From: Edward Oliveira Date: Sat, 6 Dec 2025 20:51:11 -0300 Subject: [PATCH] WIP2 --- frontend/src/__apps/painel/main.js | 8 ++++++++ frontend/src/components/Cronometro.vue | 9 ++++++++- frontend/src/components/PainelResultado.vue | 15 ++++++++++++--- sapl/templates/painel/painel_v2.html | 12 ++++++------ 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/frontend/src/__apps/painel/main.js b/frontend/src/__apps/painel/main.js index 4f8a69c10..def3ca411 100644 --- a/frontend/src/__apps/painel/main.js +++ b/frontend/src/__apps/painel/main.js @@ -290,6 +290,14 @@ new Vue({ this.closeWS(); }, + changeFontSize(value) { + for (var name in this.$refs){ + if (name.startsWith("sw")) { + const cronometro = this.$refs[name] + cronometro.changeFontSize(value) + } + } + }, startStopwatch() { if (this.isOpen) this.ws.send(JSON.stringify({ type:'notify', stopwatch:'start' })) }, } }) diff --git a/frontend/src/components/Cronometro.vue b/frontend/src/components/Cronometro.vue index 475c2d2a4..a77e1d777 100644 --- a/frontend/src/components/Cronometro.vue +++ b/frontend/src/components/Cronometro.vue @@ -5,7 +5,7 @@ :src="audioSrc" preload="auto" > - {{ title }}: {{ formatTime(time) }}
+ {{ title }}: {{ formatTime(time) }}
@@ -28,6 +28,13 @@ export default { this.$emit('child-mounted'); // Emit a custom event }, methods: { + changeFontSize(value) { + const el = this.$refs.time; + if (!el) return; + let fontSize = window.getComputedStyle(el).fontSize; + fontSize = parseFloat(fontSize); // safely convert "16px" → 16 + el.style.fontSize = (fontSize + value) + 'px'; + }, handleStartStop() { this.isRunning = !this.isRunning; diff --git a/frontend/src/components/PainelResultado.vue b/frontend/src/components/PainelResultado.vue index 454daaabe..504caba09 100644 --- a/frontend/src/components/PainelResultado.vue +++ b/frontend/src/components/PainelResultado.vue @@ -2,14 +2,14 @@

Resultado

- -
-
+
  • Sim: {{ resultado.numero_votos.votos_sim }}
  • Não: {{ resultado.numero_votos.votos_nao }}
  • @@ -51,6 +51,15 @@ export default { return this.sessao_aberta && this.painel_aberto; }, ...mapState(["painel_aberto", "sessao_aberta", "resultado"]) + }, + methods: { + changeFontSize(value) { + const el = this.$refs.votacao; + if (!el) return; + let fontSize = window.getComputedStyle(el).fontSize; + fontSize = parseFloat(fontSize); // safely convert "16px" → 16 + el.style.fontSize = (fontSize + value) + 'px'; + }, } }; diff --git a/sapl/templates/painel/painel_v2.html b/sapl/templates/painel/painel_v2.html index 12abe43c0..e8ceeb76e 100644 --- a/sapl/templates/painel/painel_v2.html +++ b/sapl/templates/painel/painel_v2.html @@ -59,16 +59,16 @@

    Cronômetros

    + + - -