summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-12-09 16:41:51 +0100
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-12-09 16:41:51 +0100
commit9e282d95b75ea60d3ce1ebee7ddbe959fa83d363 (patch)
tree1e2c1fc12b6a1f4de204bd31af7a9f6800af828f
parent31df2fe9d118a8dd2004ec0844602cba08d12a85 (diff)
downloadvotes-for-women-9e282d95b75ea60d3ce1ebee7ddbe959fa83d363.tar.gz
make congress hall clickable, always show box when adding
-rw-r--r--play.css2
-rw-r--r--play.html1
-rw-r--r--play.js5
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
<div id="Northeast" class="region" style="top:157px;left:880px;"></div>
<div id="turn" class="piece turn" style="left:806px;top:770px;"></div>
+ <div id="congress_hall" class="congress_hall" style="left:560px;top:600px;width:135px;height:160px;border-top-right-radius:100px;border-top-left-radius:100px;"></div>
<div id="congress_box" class="congress_box" style="left:490px;top:760px;width:270px;height:60px;">
</div>
<div id="nineteenth_amendment_score" class="nineteenth_amendment_score" style="left:490px;top:760px;width:270px;height:60px;">
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"))