diff options
author | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2023-11-29 06:27:14 +0100 |
---|---|---|
committer | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2023-11-29 06:27:14 +0100 |
commit | c0553c1d3484854fcfae1ff1dcb05c81dd9a6f13 (patch) | |
tree | 5b144920d12c8bf24bce0d9319a24532ebfef1c9 /play.js | |
parent | c1c4713e0777509885d26db44a7fdb1e4386e3dc (diff) | |
download | votes-for-women-c0553c1d3484854fcfae1ff1dcb05c81dd9a6f13.tar.gz |
show nineteenth amendment voting score
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -29,6 +29,9 @@ let ui = { turn: document.getElementById("turn"), congress_box: document.getElementById("congress_box"), congress: [ null ], + nineteenth_amendment_score: document.getElementById("nineteenth_amendment_score"), + green_checks_count: document.getElementById("green_checks_count"), + red_xs_count: document.getElementById("red_xs_count"), player: [ document.getElementById("role_Suffragist"), document.getElementById("role_Opposition"), @@ -578,13 +581,11 @@ function on_log(text) { // eslint-disable-line no-unused-vars function support_info() { - // TODO show the # of green_checks and red_xs instead of the congress circles when the 19th has passed instead - return `${view.support_buttons}\u{2b50} ${view.support_hand}\u{1f3b4} ${view.green_checks} \u{2713}` + return `${view.support_buttons}\u{2b50} ${view.support_hand}\u{1f3b4}` } function opposition_info() { - // TODO show the # of green_checks and red_xs instead of the congress circles when the 19th has passed instead - return `${view.opposition_buttons}\u{2b50} ${view.opposition_hand}\u{1f3b4} ${view.red_xs} \u{2717}` + return `${view.opposition_buttons}\u{2b50} ${view.opposition_hand}\u{1f3b4}` } function layout_cubes(list, xorig, yorig) { @@ -631,6 +632,12 @@ function on_update() { // eslint-disable-line no-unused-vars ui.congress[c].classList.toggle("action", is_action("congress")) } + ui.nineteenth_amendment_score.classList.toggle("hide", !view.nineteenth_amendment) + if (view.nineteenth_amendment) { + ui.green_checks_count.textContent = view.green_checks + ui.red_xs_count.textContent = view.red_xs + } + ui.support_button_box.replaceChildren() for (let i = 0; i < view.support_buttons; ++i) { ui.support_button_box.appendChild(ui.support_buttons[i]) |