diff --git a/static/admin.html b/static/admin.html index 64303c0..0ba2ce3 100644 --- a/static/admin.html +++ b/static/admin.html @@ -44,7 +44,7 @@
diff --git a/static/css/screen.css b/static/css/screen.css index 4e4849b..1f48a35 100644 --- a/static/css/screen.css +++ b/static/css/screen.css @@ -17,10 +17,17 @@ body.screen { background: #fff; border-radius: 28px; padding: 2vh; gap: 1.4vh; } .qr-wrap.ring { background: transparent; padding: 0; } -.entry { display: flex; align-items: center; gap: 1.2vw; margin-top: 3vh; background: var(--surface); border-radius: 18px; padding: 1.2vh 1.2vw; width: fit-content; } -.entry canvas { width: clamp(140px, min(21vw, 34vh), 420px); height: auto; aspect-ratio: 1; image-rendering: pixelated; flex: none; } -.entry div { display: grid; gap: .3vh; font-size: clamp(.8rem, 1.1vw, 1.2rem); color: var(--ink-2); min-width: 0; overflow-wrap: break-word; } +/* 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); } +.entry { + position: fixed; right: 3vw; bottom: 2.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; } +.entry div { display: grid; gap: .2vh; font-size: clamp(.7rem, .95vw, 1rem); color: var(--ink-2); overflow-wrap: break-word; } .entry b { color: var(--ink); font-weight: 700; } +body.has-entry .s-main:not(.split) .s-steps, body.has-entry .s-main.split #focus { padding-bottom: var(--dock-h); } /* 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; } @@ -39,17 +46,20 @@ body.screen { } /* a question on screen while the ring is up (vote with presence scans, late enrollment). the back rows read - the ring, so it keeps the wider column and as much height as possible: title and entry qr share one line */ + the ring, so it keeps the wider column and as much height as possible */ .s-main.split { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 4vw; } .s-main.split .s-enroll { grid-template-columns: 1fr; justify-items: center; gap: 3vh; } .s-main.split .s-enroll { grid-template-rows: minmax(0, 1fr) auto; gap: 1.5vh; height: 100%; } .s-main.split .qr-wrap { height: 100%; width: auto; max-width: 100%; max-height: none; } .s-main.split #qr-steps { display: none; } -.s-main.split .s-steps { display: flex; align-items: center; justify-content: center; gap: 2vw; text-align: left; } +.s-main.split .s-steps { text-align: center; } .s-main.split .s-steps h2 { font-size: clamp(1.2rem, 2.1vw, 2.4rem); margin: 0; } -.s-main.split .entry { margin: 0; padding: .8vh .8vw; gap: .8vw; } -.s-main.split .entry canvas { width: clamp(70px, min(7vw, 11vh), 160px); } -.s-main.split .entry div { font-size: clamp(.7rem, .9vw, 1rem); } +/* the question side scales with height too, so it still fits above the docked qr on short screens */ +.s-main.split .s-focus .q-text { font-size: clamp(1.3rem, min(3.2vw, 6.5vh), 3.6rem); margin-bottom: 2.5vh; } +.s-main.split .s-focus .opts { gap: 1vh; margin-bottom: 2.5vh; } +.s-main.split .s-focus .opts li { font-size: clamp(.95rem, min(1.8vw, 3.6vh), 2rem); padding: 1.1vh 1.5vw; } +.s-main.split .s-focus .turnout { font-size: clamp(.9rem, min(1.5vw, 3vh), 1.7rem); } +.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; } @@ -78,19 +88,15 @@ body.screen { @media (max-aspect-ratio: 1/1) { .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 entry qr sits next to the steps */ + /* 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); } .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; } - .s-steps { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 4vw; align-items: center; } - .s-steps > * { grid-column: 1; } - .s-steps .entry { grid-column: 2; grid-row: 1 / span 3; flex-direction: column; gap: .8vh; margin: 0; padding: 1.2vh; text-align: center; } - .s-steps .entry div { font-size: clamp(.7rem, 2.2vw, 1.1rem); overflow-wrap: normal; white-space: nowrap; } - .s-steps .entry canvas { width: clamp(110px, min(30vw, 17vh), 300px); } - /* upright + question: ring and entry share one row above the question */ + body.has-entry .s-main:not(.split) .s-steps { padding-bottom: 0; padding-right: calc(var(--dock-qr) + 6vw); } + /* 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; } - .s-main.split .s-steps { display: grid; grid-template-columns: auto; justify-items: center; row-gap: 1vh; text-align: center; } - .s-main.split .s-steps .entry { grid-column: 1; grid-row: auto; } + .s-main.split .s-steps { display: grid; grid-template-columns: auto; justify-items: center; row-gap: 1vh; text-align: center; max-width: 42vw; } } .qr-wrap.ring .tick { display: none; } diff --git a/static/index.html b/static/index.html index 5b95b0f..5fed75f 100644 --- a/static/index.html +++ b/static/index.html @@ -38,6 +38,11 @@
Réglages du code + +
diff --git a/static/js/index.js b/static/js/index.js index 0d8a0a6..9a2142a 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -14,6 +14,7 @@ $("#form").addEventListener("submit", async (e) => { title: $("#title").value, interval_ms: +$("#interval").value, scans_required: +$("#scans").value, + code_style: $("#code-style").value, expected: $("#expected").value ? +$("#expected").value : null, max_voters: $("#maxv").value ? +$("#maxv").value : null, require_code: $("#codes-on").checked, diff --git a/static/js/screen.js b/static/js/screen.js index 5795630..95a5d33 100644 --- a/static/js/screen.js +++ b/static/js/screen.js @@ -45,7 +45,9 @@ function layout() { $("#qr-steps").hidden = !st.enrollment_open; // rings can't be opened by the camera app, so a small fixed qr leads to the page $("#step1").textContent = ring ? "Ouvrez la page de vote" : "Scannez ce code"; - reveal($("#entry"), !!(ring && st.enrollment_open && entry)); + const entryOn = !!(ring && st.enrollment_open && entry); + reveal($("#entry"), entryOn); + document.body.classList.toggle("has-entry", entryOn); $(".qr-wrap").classList.toggle("ring", ring); } diff --git a/static/screen.html b/static/screen.html index 37b1bcc..9175938 100644 --- a/static/screen.html +++ b/static/screen.html @@ -35,10 +35,6 @@
  • Scannez ce code
  • Visez l'écran 5 s
  • -
    @@ -51,6 +47,11 @@ + +