summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-07-09 12:54:36 +0200
committerTor Andersson <tor@ccxvii.net>2023-07-13 14:10:20 +0200
commit9479b226f6cbfb53d66123a397f46cca0f682d45 (patch)
tree2d3bbe189f72e400f477ec1e910c21f12fd42ab7 /public
parentf6397dca9091cba8057f62815a9eabacf02ad098 (diff)
downloadserver-9479b226f6cbfb53d66123a397f46cca0f682d45.tar.gz
Use status constants.
Diffstat (limited to 'public')
-rw-r--r--public/join.js7
-rw-r--r--public/style.css4
2 files changed, 9 insertions, 2 deletions
diff --git a/public/join.js b/public/join.js
index 72da646..85445dc 100644
--- a/public/join.js
+++ b/public/join.js
@@ -155,6 +155,9 @@ function update() {
if (player) {
element.classList.remove("is_invite")
switch (game.status) {
+ case 3:
+ element.innerHTML = player.name
+ break
case 2:
if (player.user_id === user_id)
element.innerHTML = play_link(player)
@@ -236,8 +239,8 @@ function update() {
message.innerHTML = `<a href="/${game.title_id}/play.html?game=${game.game_id}">Observe</a>`
} else if (game.status === 2) {
message.innerHTML = `<a href="/${game.title_id}/play.html?game=${game.game_id}">Review</a>`
- } else {
- message.innerHTML = `<a href="/${game.title_id}/play.html?game=${game.game_id}">Enter</a>`
+ } else if (game.status === 3) {
+ message.innerHTML = "Archived"
}
if (game.owner_id === user_id) {
diff --git a/public/style.css b/public/style.css
index bcac7fe..f3b4493 100644
--- a/public/style.css
+++ b/public/style.css
@@ -193,6 +193,10 @@ article hr + p { font-style: italic; }
.game_item.finished .game_main { background-color: gainsboro }
.game_item.finished a:hover { color: mediumblue }
+.game_item.archived .game_head { background-color: silver }
+.game_item.archived .game_main { background-color: gainsboro }
+.game_item.archived a:hover { color: mediumblue }
+
.game_item.your_turn .game_head { background-color: gold }
.game_item.your_turn .game_main { background-color: lightyellow }
.game_item.your_turn a:hover { color: #860 }