From ad6c3c6f57178a056b318dc138df9b6b230d8780 Mon Sep 17 00:00:00 2001 From: Showdown76py Date: Tue, 17 Nov 2026 14:20:54 +0100 Subject: [PATCH] Big entry qr shows the closed question and its ballot count above it --- static/css/screen.css | 6 ++++++ static/js/screen.js | 8 ++++++++ static/screen.html | 1 + 3 files changed, 15 insertions(+) diff --git a/static/css/screen.css b/static/css/screen.css index 529895e..b6b524d 100644 --- a/static/css/screen.css +++ b/static/css/screen.css @@ -36,6 +36,11 @@ body.entry-big { --dock-qr: clamp(180px, min(58vh, 34vw), 640px); } body.entry-big .entry { top: 50%; bottom: auto; right: max(4vw, calc((50vw - var(--dock-qr)) / 2 - 2vw)); translate: 0 -46%; padding: 2vh; gap: 1.2vh; } body.entry-big .entry div { font-size: clamp(.9rem, 1.4vw, 1.6rem); } body.entry-big .s-main:not(.split) .s-steps { visibility: hidden; } +body.entry-q-on { --dock-qr: clamp(160px, min(46vh, 30vw), 520px); } +/* width 0 + min-width 100%: a long question wraps to the qr's width instead of widening the block */ +.entry-q { display: grid; gap: .6vh; padding-bottom: 1vh; margin-bottom: .4vh; border-bottom: 2px solid var(--bg); width: 0; min-width: 100%; } +.entry-q b { font: 700 clamp(1rem, 1.7vw, 2rem) var(--round); color: var(--ink); line-height: 1.15; } +.entry-q span { font: 600 clamp(.85rem, 1.2vw, 1.4rem) var(--round); color: var(--ink-2); } /* the ring loop resizes the canvas bitmap every frame: its intrinsic size must not feed the layout, or safari widens the column, which grows the bitmap, which widens the column... */ #qr { width: 100%; height: 100%; min-width: 0; min-height: 0; contain: size; image-rendering: pixelated; image-rendering: crisp-edges; object-fit: contain; } @@ -105,6 +110,7 @@ body.entry-big .s-main:not(.split) .s-steps { visibility: hidden; } body.entry-big { --dock-qr: clamp(140px, min(26vh, 40vw), 400px); } body.entry-big .entry { top: auto; bottom: 1.5vh; right: 1.2vw; translate: none; } body.entry-big .s-main:not(.split) .s-steps { visibility: visible; } + .entry-q { display: none; } /* upright + question: ring and title share one row above the question */ .s-main.split .s-enroll { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: none; height: auto; align-items: center; justify-items: stretch; } .s-main.split .qr-wrap { height: auto; width: 100%; max-height: 38vh; justify-self: center; } diff --git a/static/js/screen.js b/static/js/screen.js index ca5d961..f4311d1 100644 --- a/static/js/screen.js +++ b/static/js/screen.js @@ -54,6 +54,14 @@ function layout() { // big entry qr next to the ring (start of a meeting, between votes), back to the corner while a question is up const big = entryOn && st.entry_big && !focus; document.body.classList.toggle("entry-big", big); + // the closed vote it replaced stays readable above the qr: question and ballot count + const showQ = big && !!idleVote; + document.body.classList.toggle("entry-q-on", showQ); + $("#entry-q").hidden = !showQ; + if (showQ) { + $("#entry-q-text").textContent = f.text; + $("#entry-q-count").textContent = `Vote clos, ${f.participants} bulletin${f.participants > 1 ? "s" : ""}`; + } $("#entry-hint").textContent = big ? "Scannez ici, puis visez le cercle" : "Pas encore sur la page ?"; $(".qr-wrap").classList.toggle("ring", ring); } diff --git a/static/screen.html b/static/screen.html index 1ce5a04..592aaf9 100644 --- a/static/screen.html +++ b/static/screen.html @@ -48,6 +48,7 @@