summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-03-22 17:10:45 +0100
committerTor Andersson <tor@ccxvii.net>2025-03-22 17:10:45 +0100
commitf58a3fdc03af65cce4ae8381192678f2b3f982af (patch)
tree8cf257f83a0be997e6a87fd9546e76785b8518ca
parentf2d72a1f60f19a7c5844c3f66d1d0b1a98a3d591 (diff)
downloadland-and-freedom-f58a3fdc03af65cce4ae8381192678f2b3f982af.tar.gz
Add medallion tooltips.
-rw-r--r--data.js2
-rw-r--r--data.ts2
-rw-r--r--play.css5
-rw-r--r--play.js12
4 files changed, 16 insertions, 5 deletions
diff --git a/data.js b/data.js
index 5adf1d8..eedacff 100644
--- a/data.js
+++ b/data.js
@@ -1772,7 +1772,7 @@ const data = {
{
id: 2,
name: 'Momentum',
- tooltip: 'Play another card.'
+ tooltip: 'Play another card after the current card.'
},
{
id: STRATEGY_MEDALLION_ID,
diff --git a/data.ts b/data.ts
index a06cf10..b9cb79a 100644
--- a/data.ts
+++ b/data.ts
@@ -1845,7 +1845,7 @@ const data: StaticData = {
{
id: 2,
name: 'Momentum',
- tooltip: 'Play another card.'
+ tooltip: 'Play another card after the current card.'
},
{
id: STRATEGY_MEDALLION_ID,
diff --git a/play.css b/play.css
index 843c4d6..e2a0109 100644
--- a/play.css
+++ b/play.css
@@ -226,9 +226,8 @@ body header.fascist.your_turn { background-color: hsl(30, 35%, 65%); }
background-size: 100% 100%;
}
-.token:not(.action) {
- pointer-events: none;
-}
+.token.blank:not(.action) { pointer-events: none; }
+.token.standee:not(.action) { pointer-events: none; }
/* :r! node tools/gencolor.js */
.token.white { background-color: #bbbbbb; border-color: #d6d6d6 #737373 #737373 #d6d6d6; box-shadow: 0 0 0 1px #323232, 0px 1px 4px #0008; }
diff --git a/play.js b/play.js
index 6592ac9..4456972 100644
--- a/play.js
+++ b/play.js
@@ -7,6 +7,7 @@
const ui = {
header: document.querySelector("header"),
+ status: document.getElementById("status"),
hand_panel: document.getElementById("hand_panel"),
map_container: document.getElementById("pieces"),
@@ -332,6 +333,8 @@ function on_init() {
for (i = 0; i < 9; ++i) {
e = (ui.medallions[i] = document.createElement("div"))
e.className = "pink token medallion medallion_" + i
+ e.onmouseenter = on_focus_medallion
+ e.onmouseleave = on_blur_medallion
register_action(e, "medallion", i)
register_animation(e)
}
@@ -601,6 +604,15 @@ function on_blur_tip(x) {
ui.tooltip.className = "hide"
}
+function on_focus_medallion(evt) {
+ let info = data.medallions[evt.target.my_id]
+ ui.status.textContent = info.name + ": " + info.tooltip
+}
+
+function on_blur_medallion() {
+ ui.status.textContent = ""
+}
+
function sub_card(_match, p1) {
return `<span class="tip" onmouseenter="on_focus_card_tip(${p1})" onmouseleave="on_blur_tip()">${data.cards[p1].title}</span>`
}