summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-11-24 14:27:06 +0100
committerTor Andersson <tor@ccxvii.net>2023-11-24 14:27:18 +0100
commit1f1747b893d213cb48372ba3177bd4c3eed0eef1 (patch)
tree0cd6c587dcbdc066e405f10d07e7e87a67887085
parent83136c4a38879a4e2a6ca1a9361f34d472d2556e (diff)
downloadvotes-for-women-1f1747b893d213cb48372ba3177bd4c3eed0eef1.tar.gz
Set favicon based on who's playing.
-rw-r--r--play.html2
-rw-r--r--play.js6
2 files changed, 7 insertions, 1 deletions
diff --git a/play.html b/play.html
index 57517ee..bfa01a0 100644
--- a/play.html
+++ b/play.html
@@ -6,7 +6,7 @@
<meta name="theme-color" content="#444">
<meta charset="UTF-8">
<title>VOTES FOR WOMEN</title>
-<link rel="icon" href="favicon.svg">
+<link id="favicon" rel="icon" href="images/badge1.png">
<link rel="stylesheet" href="/fonts/fonts.css">
<link rel="stylesheet" href="/common/client.css">
<script defer src="/common/client.js"></script>
diff --git a/play.js b/play.js
index 482a2c4..10c3b84 100644
--- a/play.js
+++ b/play.js
@@ -31,6 +31,7 @@ const green_check_count = 36
const red_x_count = 13
let ui = {
+ favicon: document.getElementById("favicon"),
status: document.getElementById("status"),
turn: document.getElementById("turn"),
congress_box: document.getElementById("congress_box"),
@@ -635,6 +636,11 @@ function layout_cubes(list, xorig, yorig) {
function on_update() { // eslint-disable-line no-unused-vars
console.log("VIEW", view)
+ switch (player) {
+ case SUF_NAME: ui.favicon.href = "images/badge1.png"; break
+ case OPP_NAME: ui.favicon.href = "images/badge5.png"; break
+ }
+
ui.player[SUF].classList.toggle("active", view.active === SUF_NAME)
ui.player[OPP].classList.toggle("active", view.active === OPP_NAME)