diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-06-11 23:37:23 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-08-21 00:28:20 +0200 |
commit | 0363755f95fb26c141cbe293942dd78e5a8e4c9d (patch) | |
tree | c8bffcf72f05d80cfa5502903005c0e177deb865 | |
parent | 5a458a5a578445d70356b23c998fe3b8cbe909ec (diff) | |
download | washingtons-war-0363755f95fb26c141cbe293942dd78e5a8e4c9d.tar.gz |
player colors
-rw-r--r-- | play.css | 18 | ||||
-rw-r--r-- | play.js | 21 |
2 files changed, 39 insertions, 0 deletions
@@ -2,6 +2,23 @@ main { background-color: slategray; } +.x_britain { background-color: hsl(15, 88%, 66%) } +.x_america { background-color: hsl(211, 52%, 64%) } + +body.Britain header.your_turn { background-color: hsl(15, 90%, 75%) } +body.America header.your_turn { background-color: hsl(211, 50%, 75%) } + +#role_Britain { background-color: hsl(15, 90%, 80%) } +#role_America { background-color: hsl(211, 50%, 80%) } + +#log { background-color: hsl(35, 53%, 89%); } +#turn_info { background-color: hsl(35, 25%, 50%); } + +#log .h { border-top: 1px solid black; border-bottom: 1px solid black; text-align: center; } +#log .h.turn { background-color: hsl(35, 45%, 70%); } +#log .h.britain { background-color: hsl(15, 90%, 80%) } +#log .h.america { background-color: hsl(211, 50%, 80%) } + #tooltip { display: none; pointer-events: none; @@ -177,6 +194,7 @@ main { height: 350px; border-radius: 16px; background-size: 100%; + background-color: hsl(35, 53%, 89%); border: 1px solid black; box-shadow: 1px 1px 4px #0008; } @@ -543,6 +543,27 @@ function on_click_card(evt) { /* LOG */ +function on_log(text) { + let p = document.createElement("div") + text = text.replace(/&/g, "&") + text = text.replace(/</g, "<") + text = text.replace(/>/g, ">") + + if (text.startsWith("=t")) { + p.className = "h turn" + text = text.substring(2) + } else if (text.startsWith("=a")) { + p.className = "h america" + text = text.substring(3) + } else if (text.startsWith("=b")) { + p.className = "h britain" + text = text.substring(3) + } + + p.innerHTML = text + return p +} + /* OLD --- function on_log(text) { let p = document.createElement("div") |