summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-10-16 12:21:33 +0200
committerTor Andersson <tor@ccxvii.net>2024-10-16 12:21:33 +0200
commit227dca6e6e4c2f2d5a16527507810bc373b758ec (patch)
treec1284345f1116e42d7e15c8e7bc6cde684f35df9 /play.js
parent55927b36e1f17183c6f63b3b106d838e5a0c15de (diff)
downloadred-flag-over-paris-227dca6e6e4c2f2d5a16527507810bc373b758ec.tar.gz
Add special panels for Karl Marx and Jules Ducatel events.
Diffstat (limited to 'play.js')
-rw-r--r--play.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/play.js b/play.js
index 3e0300b..df7b04b 100644
--- a/play.js
+++ b/play.js
@@ -527,6 +527,8 @@ function on_update() {
ui.military_vp.className = `piece cylinder purple vp${5+view.military_vp}`
ui.political_vp.className = `piece cylinder orange vp${5+view.political_vp}`
+ document.getElementById("karl_marx").replaceChildren()
+ document.getElementById("jules_ducatel").replaceChildren()
document.getElementById("hand").replaceChildren()
document.getElementById("final").replaceChildren()
document.getElementById("discard").replaceChildren()
@@ -546,6 +548,26 @@ function on_update() {
if (view.discard)
document.getElementById("discard").appendChild(ui.cards[view.discard])
+ if (view.karl_marx || view.jules_ducatel) {
+ document.getElementById("event_grid").style.display = null
+ if (view.karl_marx) {
+ document.getElementById("karl_marx_panel").classList.remove("hide")
+ for (let c of view.karl_marx)
+ document.getElementById("karl_marx").appendChild(ui.cards[c])
+ } else {
+ document.getElementById("karl_marx_panel").classList.add("hide")
+ }
+ if (view.jules_ducatel) {
+ document.getElementById("jules_ducatel_panel").classList.remove("hide")
+ for (let c of view.jules_ducatel)
+ document.getElementById("jules_ducatel").appendChild(ui.cards[c])
+ } else {
+ document.getElementById("jules_ducatel_panel").classList.add("hide")
+ }
+ } else {
+ document.getElementById("event_grid").style.display = "none"
+ }
+
if (view.hand) {
document.getElementById("hand_panel").classList.remove("hide")
for (let c of view.hand)