summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/join.js9
-rw-r--r--views/head.pug13
2 files changed, 15 insertions, 7 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)
diff --git a/views/head.pug b/views/head.pug
index 00e0ada..4262408 100644
--- a/views/head.pug
+++ b/views/head.pug
@@ -119,12 +119,13 @@ mixin gamelist(list,hide_title=0)
div Created: #{item.ctime}
when 1
div Last move: #{item.mtime}
- if item.time_left <= 0
- div Time left: none.
- else if item.time_left <= 2
- div Time left: #{ item.time_left * 24 | 0 } hours
- else if item.time_left <= 5
- div Time left: #{ item.time_left | 0 } days
+ if item.your_turn
+ if item.time_left <= 0
+ div Time left: none.
+ else if item.time_left <= 2
+ div Time left: #{ item.time_left * 24 | 0 } hours
+ else if item.time_left <= 5
+ div Time left: #{ item.time_left | 0 } days
when 2
div Finished: #{item.mtime}
div Result: !{item.result}