summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-02-28 00:27:36 +0100
committerTor Andersson <tor@ccxvii.net>2025-02-28 00:27:36 +0100
commit0c4325ee1410497cbc04dff966409c534b5bc769 (patch)
tree09a3fedcd4b12ff40c91b6205be403de0f1df4ee
parentdfac77d2135ef7084852860d995113cc8709a233 (diff)
downloadland-and-freedom-0c4325ee1410497cbc04dff966409c534b5bc769.tar.gz
wip more client
-rw-r--r--play2.css20
-rw-r--r--play2.js23
2 files changed, 37 insertions, 6 deletions
diff --git a/play2.css b/play2.css
index 0a92960..52cc061 100644
--- a/play2.css
+++ b/play2.css
@@ -34,15 +34,19 @@ main {
.track {
position: absolute;
background-color: #fff4;
- border: 3px solid lime;
+ border: 3px solid transparent;
width: 52px;
height: 54px;
}
+.track.action {
+ border-color: white;
+}
+
.front {
position: absolute;
background-color: #fff4;
- border: 6px solid lime;
+ border: 6px solid transparent;
border-radius: 34px;
display: flex;
@@ -50,6 +54,10 @@ main {
gap: 4px;
}
+.front.action {
+ border-color: white;
+}
+
.front div {
margin-right: -30px;
}
@@ -140,12 +148,16 @@ main {
height: 282px;
}
-.action {
+.token.action {
+ box-shadow: 0 0 0 3px white;
+}
+
+.card.action {
box-shadow: 0 0 0 3px white;
}
.selected {
- box-shadow: 0 0 0 3px yellow;
+ box-shadow: 0 0 0 3px aqua;
}
/* PANELS */
diff --git a/play2.js b/play2.js
index 17e9ac0..494e3c6 100644
--- a/play2.js
+++ b/play2.js
@@ -86,7 +86,7 @@ function build_track(t, action_name, track_name, a, b) {
const bm = t * 11 + s
e = (ui.blank_markers[bm] = document.createElement("div"))
- e.className = "token blank"
+ e.className = "token blank hide"
e.style.top = Math.round(y+4) + "px"
e.style.left = Math.round(x+3) + "px"
register_action(e, "blank_marker", bm)
@@ -210,6 +210,12 @@ function place_cards(e, cards) {
}
}
+const faction_class = {
+ "a": "anarchist",
+ "c": "communist",
+ "m": "moderate",
+}
+
function update_front(container, front) {
var i, n, e, cn
container.replaceChildren()
@@ -226,6 +232,14 @@ function update_front(container, front) {
e.className = cn
container.appendChild(e)
}
+
+ for (i of ["a", "c", "m"]) {
+ if (front.contributions.includes(i)) {
+ let e = document.createElement("div")
+ e.className = "token player " + faction_class[i]
+ container.appendChild(e)
+ }
+ }
}
function on_update() {
@@ -253,12 +267,17 @@ function on_update() {
for (i = 0; i < 5; ++i)
ui.standees[i].style.left = ui.tracks_x[i][view.tracks[i]]
+ for (i = 0; i < 55; ++i) {
+ if (ui.blank_markers[i])
+ ui.blank_markers[i].classList.toggle("hide", !view.triggered_track_effects.includes(i))
+ }
+
for (i = 0; i < 5; ++i) {
ui.medallion_container[i].replaceChildren()
if (i < view.medallions.pool.length)
ui.medallion_container[i].appendChild(ui.medallions[i])
}
-
+
update_front(ui.fronts[0], view.fronts.a)
update_front(ui.fronts[1], view.fronts.m)
update_front(ui.fronts[2], view.fronts.n)