summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-12-15 00:48:43 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-08 16:36:48 +0100
commit4640a9affe7633628ce95de0bb5640e30dd71039 (patch)
tree8d24a8dbae1fce988b2ad1a86e8f7e040db2dd1f
parent98b1e64b2c3b697a6e9156b6f75de83402c4cfb8 (diff)
downloadtable-battles-4640a9affe7633628ce95de0bb5640e30dd71039.tar.gz
log styling
-rw-r--r--play.html28
-rw-r--r--play.js8
-rw-r--r--rules.js2
3 files changed, 37 insertions, 1 deletions
diff --git a/play.html b/play.html
index 50debc2..acdb235 100644
--- a/play.html
+++ b/play.html
@@ -19,6 +19,34 @@
#roles { background-color: bisque; }
#log { background-color: floralwhite; }
+#log .h1 {
+ text-align: center;
+ font-weight: bold;
+ font-variant: small-caps;
+ background-color: tan;
+ padding: 2px 8px;
+}
+
+#log .h2 {
+ text-align: center;
+ font-variant: small-caps;
+ background-color: wheat;
+ padding: 2px 8px;
+}
+
+#log .ind {
+ padding-left: 20px;
+}
+
+#log .i {
+ font-style: italic;
+}
+
+#log .blue { background-color: blue; }
+#log .dkblue { background-color: navy; }
+#log .red { background-color: red; }
+#log .pink { background-color: pink; }
+
.role.blue, .role.dkblue { background-color: #8bf }
.role.red, .role.pink { background-color: #f88 }
diff --git a/play.js b/play.js
index b8d9e00..7eb87af 100644
--- a/play.js
+++ b/play.js
@@ -479,6 +479,14 @@ function on_log(text) {
text = text.substring(4)
p.className = "h2"
}
+ else if (text.match(/^>/)) {
+ text = text.substring(1)
+ p.className = "ind"
+ }
+ else if (text.match(/^\.i /)) {
+ text = text.substring(3)
+ p.className = "i"
+ }
text = text.replace(/\bC\d+\b/g, sub_card)
text = text.replace(/\b[DPRBK]\d\b/g, sub_icon)
diff --git a/rules.js b/rules.js
index acf4d95..121049f 100644
--- a/rules.js
+++ b/rules.js
@@ -417,7 +417,7 @@ exports.setup = function (seed, scenario, options) {
if (info.lore_text) {
for (let line of info.lore_text.split("<p>"))
- log(line)
+ log(".i " + line)
log("")
}