diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-05-28 02:29:46 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-05-30 21:59:25 +0200 |
commit | 7f0bc6422715e637ec3b80f1426b3ae512298f4e (patch) | |
tree | f90072e0b306492b2de58e0d28f0add5c089d823 | |
parent | ff01812e85b4744c9ac1f6826e0bf5c53182aa2a (diff) | |
download | friedrich-7f0bc6422715e637ec3b80f1426b3ae512298f4e.tar.gz |
wip piece tips
-rw-r--r-- | play.css | 29 | ||||
-rw-r--r-- | play.js | 41 |
2 files changed, 69 insertions, 1 deletions
@@ -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; @@ -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 } |