From 9e282d95b75ea60d3ce1ebee7ddbe959fa83d363 Mon Sep 17 00:00:00 2001 From: Mischa Untaga <99098079+MischaU8@users.noreply.github.com> Date: Sat, 9 Dec 2023 16:41:51 +0100 Subject: make congress hall clickable, always show box when adding --- play.css | 2 +- play.html | 1 + play.js | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/play.css b/play.css index b2b7de0..50f01c5 100644 --- a/play.css +++ b/play.css @@ -435,7 +435,7 @@ body.shift .persistent_box .card:hover { z-index: 100; } -div.congress_box { +div.congress_box, div.congress_hall { position: absolute; box-sizing: border-box; } diff --git a/play.html b/play.html index 89575ea..8a686c5 100644 --- a/play.html +++ b/play.html @@ -586,6 +586,7 @@ c5 3 13 7 17 8 8 2 9 3 11 12 1 5 5 12 8 16 5 8 5 8 3 22 l-3 14 -30 -1 c-35
+
diff --git a/play.js b/play.js index 45b8f2c..40086ed 100644 --- a/play.js +++ b/play.js @@ -80,6 +80,7 @@ let ui = { favicon: document.getElementById("favicon"), status: document.getElementById("status"), turn: document.getElementById("turn"), + congress_hall: document.getElementById("congress_hall"), congress_box: document.getElementById("congress_box"), congress: [ null ], nineteenth_amendment_score: document.getElementById("nineteenth_amendment_score"), @@ -431,6 +432,7 @@ function build_user_interface() { REGIONS_LAYOUT.push(LAYOUT[r.replaceAll(' & ', '')]) } + ui.congress_hall.addEventListener("mousedown", on_click_congress) ui.congress_box.addEventListener("mousedown", on_click_congress) for (let c = 1; c <= 6; ++c) { elt = ui.congress[c] = create("div", { @@ -691,8 +693,9 @@ function on_update() { // eslint-disable-line no-unused-vars ui.turn.style.left = 806 + (42 * (view.turn - 1)) + "px" + ui.congress_hall.classList.toggle("action", is_action("congress")) ui.congress_box.replaceChildren() - ui.congress_box.classList.toggle("action", !view.congress && is_action("congress")) + ui.congress_box.classList.toggle("action", view.active === SUF_NAME && is_action("congress")) for (let c = 1; c <= view.congress; ++c) { ui.congress_box.appendChild(ui.congress[c]) ui.congress[c].classList.toggle("action", is_action("congress")) -- cgit v1.2.3