Big entry qr shows the closed question and its ballot count above it
This commit is contained in:
@@ -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 { 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 .entry div { font-size: clamp(.9rem, 1.4vw, 1.6rem); }
|
||||||
body.entry-big .s-main:not(.split) .s-steps { visibility: hidden; }
|
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,
|
/* 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... */
|
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; }
|
#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 { --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 .entry { top: auto; bottom: 1.5vh; right: 1.2vw; translate: none; }
|
||||||
body.entry-big .s-main:not(.split) .s-steps { visibility: visible; }
|
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 */
|
/* 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 .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; }
|
.s-main.split .qr-wrap { height: auto; width: 100%; max-height: 38vh; justify-self: center; }
|
||||||
|
|||||||
@@ -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
|
// 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;
|
const big = entryOn && st.entry_big && !focus;
|
||||||
document.body.classList.toggle("entry-big", big);
|
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 ?";
|
$("#entry-hint").textContent = big ? "Scannez ici, puis visez le cercle" : "Pas encore sur la page ?";
|
||||||
$(".qr-wrap").classList.toggle("ring", ring);
|
$(".qr-wrap").classList.toggle("ring", ring);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<aside id="entry" class="entry" hidden>
|
<aside id="entry" class="entry" hidden>
|
||||||
|
<div id="entry-q" class="entry-q" hidden><b id="entry-q-text"></b><span id="entry-q-count"></span></div>
|
||||||
<canvas id="entry-qr" aria-label="QR code de la page de vote"></canvas>
|
<canvas id="entry-qr" aria-label="QR code de la page de vote"></canvas>
|
||||||
<div><b id="entry-hint">Pas encore sur la page ?</b><span id="entry-url"></span></div>
|
<div><b id="entry-hint">Pas encore sur la page ?</b><span id="entry-url"></span></div>
|
||||||
</aside>
|
</aside>
|
||||||
|
|||||||
Reference in New Issue
Block a user