summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-10-26 00:36:46 +0200
committerTor Andersson <tor@ccxvii.net>2024-10-26 00:36:46 +0200
commit4cc31a4a900a93473f98a23a9de78ffe7001dbff (patch)
tree3cada84f253a967e0bcbde9ce37cc9da296ce554 /play.js
parentea8755f9fe54ea911cdd864c5cfc01d708bdafb4 (diff)
download1989-dawn-of-freedom-4cc31a4a900a93473f98a23a9de78ffe7001dbff.tar.gz
show power card tooltip
Diffstat (limited to 'play.js')
-rw-r--r--play.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/play.js b/play.js
index 770e6d5..319f79c 100644
--- a/play.js
+++ b/play.js
@@ -476,7 +476,7 @@ function sub_card_name(match, p1) {
function sub_power_card_name(match, p1) {
let x = p1 | 0
- return `<span class="card_name">${power_cards[x].name}</span>`
+ return `<span class="card_name" onmouseenter="on_focus_power_card_tip(${x})" onmouseleave="on_blur_power_card_tip()">${power_cards[x].name}</span>`
}
function sub_power_card_value(match, p1) {
@@ -513,6 +513,14 @@ function on_blur_card_tip() {
document.getElementById("tooltip").classList = "card hide"
}
+function on_focus_power_card_tip(card_number) {
+ document.getElementById("tooltip").className = "card power_" + card_number
+}
+
+function on_blur_power_card_tip() {
+ document.getElementById("tooltip").classList = "card hide"
+}
+
function on_focus_space_tip(id) {
ui.spaces[id].classList.add("tip")
}