diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-11-24 14:27:06 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-11-24 14:27:18 +0100 |
commit | 1f1747b893d213cb48372ba3177bd4c3eed0eef1 (patch) | |
tree | 0cd6c587dcbdc066e405f10d07e7e87a67887085 | |
parent | 83136c4a38879a4e2a6ca1a9361f34d472d2556e (diff) | |
download | votes-for-women-1f1747b893d213cb48372ba3177bd4c3eed0eef1.tar.gz |
Set favicon based on who's playing.
-rw-r--r-- | play.html | 2 | ||||
-rw-r--r-- | play.js | 6 |
2 files changed, 7 insertions, 1 deletions
@@ -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> @@ -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) |