summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--play.css29
-rw-r--r--play.js41
2 files changed, 69 insertions, 1 deletions
diff --git a/play.css b/play.css
index f82e5d6..862f51c 100644
--- a/play.css
+++ b/play.css
@@ -89,6 +89,17 @@
#log .city_tip:hover { cursor: pointer; text-decoration: underline; }
+#log .piece_tip:hover { cursor: pointer; text-decoration: underline; }
+/*
+#log .piece_tip.prussia:hover { background-color: var(--color-light-prussia); }
+#log .piece_tip.hanover:hover { background-color: var(--color-light-hanover); }
+#log .piece_tip.russia:hover { background-color: var(--color-light-russia); }
+#log .piece_tip.sweden:hover { background-color: var(--color-light-sweden); }
+#log .piece_tip.austria:hover { background-color: var(--color-light-austria); }
+#log .piece_tip.imperial:hover { background-color: var(--color-light-imperial); }
+#log .piece_tip.france:hover { background-color: var(--color-light-france); }
+*/
+
#log .h {
background-color: tan;
border-top: 1px solid black; border-bottom: 1px solid black;
@@ -107,6 +118,8 @@
#log .q { font-style: italic; }
+
+
#log .i { padding-left: 20px }
#log .ii { padding-left: 32px }
@@ -191,6 +204,22 @@ TWOD.piece.cylinder {
drop-shadow(-2px 0px 0px orange);
}
+.piece.tip {
+ filter:
+ drop-shadow(2px 0px 0px red)
+ drop-shadow(0px 2px 0px red)
+ drop-shadow(0px -2px 0px red)
+ drop-shadow(-2px 0px 0px red);
+}
+
+.piece.france.tip, .piece.prussia.tip {
+ filter:
+ drop-shadow(2px 0px 0px yellow)
+ drop-shadow(0px 2px 0px yellow)
+ drop-shadow(0px -2px 0px yellow)
+ drop-shadow(-2px 0px 0px yellow);
+}
+
.number {
width: 14px;
height: 14px;
diff --git a/play.js b/play.js
index 2ceef9f..82b264b 100644
--- a/play.js
+++ b/play.js
@@ -985,6 +985,44 @@ const piece_log_name = [
"French supply train", "French supply train",
]
+const piece_power = [
+ P_PRUSSIA,
+ P_PRUSSIA,
+ P_PRUSSIA,
+ P_PRUSSIA,
+ P_PRUSSIA,
+ P_PRUSSIA,
+ P_PRUSSIA,
+ P_PRUSSIA,
+ P_HANOVER,
+ P_HANOVER,
+ P_RUSSIA,
+ P_RUSSIA,
+ P_RUSSIA,
+ P_RUSSIA,
+ P_SWEDEN,
+ P_AUSTRIA,
+ P_AUSTRIA,
+ P_AUSTRIA,
+ P_AUSTRIA,
+ P_AUSTRIA,
+ P_IMPERIAL,
+ P_FRANCE,
+ P_FRANCE,
+ P_FRANCE,
+ P_PRUSSIA,
+ P_PRUSSIA,
+ P_HANOVER,
+ P_RUSSIA,
+ P_RUSSIA,
+ P_SWEDEN,
+ P_AUSTRIA,
+ P_AUSTRIA,
+ P_IMPERIAL,
+ P_FRANCE,
+ P_FRANCE,
+]
+
const piece_tooltip_name = [
"P1 Friedrich",
"P2 Winterfeldt",
@@ -1026,7 +1064,8 @@ const piece_tooltip_name = [
function sub_piece(match, p1) {
let x = p1 | 0
let n = piece_log_name[x]
- return `<span class="piece_tip" onclick="on_click_piece_tip(${x})" onmouseenter="on_focus_piece_tip(${x})" onmouseleave="on_blur_piece_tip(${x})">${n}</span>`
+ let p = power_class[piece_power[x]]
+ return `<span class="piece_tip ${p}" onclick="on_click_piece_tip(${x})" onmouseenter="on_focus_piece_tip(${x})" onmouseleave="on_blur_piece_tip(${x})">${n}</span>`
return n
}