summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-06-11 23:37:23 +0200
committerTor Andersson <tor@ccxvii.net>2024-08-21 00:28:20 +0200
commit0363755f95fb26c141cbe293942dd78e5a8e4c9d (patch)
treec8bffcf72f05d80cfa5502903005c0e177deb865 /play.js
parent5a458a5a578445d70356b23c998fe3b8cbe909ec (diff)
downloadwashingtons-war-0363755f95fb26c141cbe293942dd78e5a8e4c9d.tar.gz
player colors
Diffstat (limited to 'play.js')
-rw-r--r--play.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/play.js b/play.js
index fd5c7e1..baf7735 100644
--- a/play.js
+++ b/play.js
@@ -543,6 +543,27 @@ function on_click_card(evt) {
/* LOG */
+function on_log(text) {
+ let p = document.createElement("div")
+ text = text.replace(/&/g, "&amp;")
+ text = text.replace(/</g, "&lt;")
+ text = text.replace(/>/g, "&gt;")
+
+ 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")