diff --git a/static/css/screen.css b/static/css/screen.css index 1f48a35..2b2854a 100644 --- a/static/css/screen.css +++ b/static/css/screen.css @@ -19,9 +19,11 @@ body.screen { .qr-wrap.ring { background: transparent; padding: 0; } /* the entry qr docks in the bottom right corner, outside the layout: the ring never shrinks for it. the column under it keeps that much room free (body.has-entry) */ -body.screen { --dock-qr: clamp(110px, min(19vh, 15vw), 300px); --dock-h: calc(var(--dock-qr) + 2.4vh + 2.9rem); } +body.screen { --dock-qr: clamp(150px, min(34vh, 24vw), 480px); --dock-h: calc(var(--dock-qr) + 2.4vh + 2.9rem); } +/* with a question on screen the qr leaves the question some height */ +body.split-on { --dock-qr: clamp(130px, min(26vh, 19vw), 380px); } .entry { - position: fixed; right: 3vw; bottom: 2.5vh; z-index: 5; display: grid; justify-items: center; gap: .8vh; + position: fixed; right: 1.2vw; bottom: 1.5vh; z-index: 5; display: grid; justify-items: center; gap: .8vh; background: var(--surface); border-radius: 18px; padding: 1.2vh; text-align: center; max-width: 40vw; } .entry canvas { width: var(--dock-qr); height: auto; aspect-ratio: 1; image-rendering: pixelated; } @@ -62,7 +64,7 @@ body.has-entry .s-main:not(.split) .s-steps, body.has-entry .s-main.split #focus .s-main.split .s-focus .results .bar-row { font-size: clamp(.95rem, min(1.8vw, 3.6vh), 2rem); margin: 1.2vh 0; } .s-main.split .s-steps li { font-size: clamp(1rem, 1.5vw, 1.6rem); } -.s-focus { align-self: center; max-width: 1400px; width: 100%; margin: 0 auto; } +.s-focus { align-self: center; align-self: safe center; max-width: 1400px; width: 100%; margin: 0 auto; } .s-focus .q-text { font-size: clamp(1.8rem, 3.8vw, 4rem); letter-spacing: -.025em; line-height: 1.1; margin-bottom: 4vh; } .s-focus .opts { list-style: none; padding: 0; margin: 0 0 4vh; display: grid; gap: 1.4vh; } .s-focus .opts li { font: 600 clamp(1.1rem, 2.2vw, 2.3rem) var(--round); background: var(--surface); border-radius: 20px; padding: 1.6vh 2vw; } @@ -89,7 +91,7 @@ body.has-entry .s-main:not(.split) .s-steps, body.has-entry .s-main.split #focus .s-enroll, .s-main.split { grid-template-columns: 1fr; } .qr-wrap { max-height: 50vh; justify-self: center; } /* upright screen: the ring takes what the text leaves, the docked entry qr sits right of the steps */ - body.screen { --dock-qr: clamp(100px, min(16vh, 26vw), 240px); } + body.screen { --dock-qr: clamp(120px, min(21vh, 34vw), 340px); } .s-main:not(.split) .s-enroll { grid-template-rows: minmax(0, 1fr) auto; gap: 3vh; height: 100%; } .s-main:not(.split) .qr-wrap { height: 100%; width: auto; max-width: 100%; max-height: none; } body.has-entry .s-main:not(.split) .s-steps { padding-bottom: 0; padding-right: calc(var(--dock-qr) + 6vw); } diff --git a/static/js/screen.js b/static/js/screen.js index 95a5d33..2e9b567 100644 --- a/static/js/screen.js +++ b/static/js/screen.js @@ -39,6 +39,7 @@ function layout() { reveal($("#focus"), !!focus); reveal($("#idle"), !qrOn && !focus); $(".s-main").classList.toggle("split", qrOn && !!focus); + document.body.classList.toggle("split-on", qrOn && !!focus); const ring = st.code_style === "ring"; // a vote waiting for presence scans takes the title, even while late arrivals can still enroll $("#qr-title").textContent = st.presence || !st.enrollment_open ? (ring ? "Visez le cercle pour voter" : "Scannez pour voter") : "Inscription";