summaryrefslogtreecommitdiff
path: root/public/join.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-08-22 18:20:50 +0200
committerTor Andersson <tor@ccxvii.net>2024-08-22 18:49:42 +0200
commit66a395d7a2dfdb6a627fe04ec06a7a7a921a739b (patch)
tree44bd5f2da66d3ed5a13041531c6bdd3dce166462 /public/join.js
parentc65510d7efd67070797918531c9ec2d702cc48ec (diff)
downloadserver-66a395d7a2dfdb6a627fe04ec06a7a7a921a739b.tar.gz
Show time left in game box only when it's your turn.
Diffstat (limited to 'public/join.js')
-rw-r--r--public/join.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/public/join.js b/public/join.js
index 81fc665..20a95e7 100644
--- a/public/join.js
+++ b/public/join.js
@@ -2,6 +2,13 @@
/* global game, roles, players, blacklist, user_id */
+const PACE_THRESHOLD = [
+ 14,
+ 3,
+ 5,
+ 10
+]
+
const PACE_TEXT = [
"No time control",
"7+ moves per day",
@@ -367,7 +374,7 @@ function create_player_box(role, player) {
if (player.is_invite)
box.classList = "invite"
- if (game.status === 1 && (game.pace > 0 || player.time_left < 3))
+ if (game.status === 1 && (player.time_left < PACE_THRESHOLD[game.pace]))
td_role_time.textContent = format_time_left(player.time_left)
td_player_name.innerHTML = player_link(player)