From c0e0e5e1a9da05b7187fdf9a7e4ee7d3868f1a85 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 25 May 2022 02:16:29 +0200 Subject: Underline active player. --- play.css | 5 +++-- play.js | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/play.css b/play.css index 0ba06d0..70599e4 100644 --- a/play.css +++ b/play.css @@ -107,10 +107,11 @@ body.shift #tooltip.focus { display: block; } .role { position: relative; + cursor: pointer; } -.role_name { - cursor: pointer; +.role.active span { + text-decoration: underline; } .role_rupees_icon, diff --git a/play.js b/play.js index 99c6f66..379c810 100644 --- a/play.js +++ b/play.js @@ -598,7 +598,7 @@ function on_update() { ce.classList.remove("card_back"); } - if (p == player_index[player]) { + if (p === player_index[player]) { ui.player[p].gift_2.classList.toggle('action', is_place_gift_action(2)); ui.player[p].gift_4.classList.toggle('action', is_place_gift_action(4)); ui.player[p].gift_6.classList.toggle('action', is_place_gift_action(6)); @@ -623,14 +623,14 @@ function on_update() { me.appendChild(ce); } - if (view.players[p].coins == 0) { + if (view.players[p].coins === 0) { ui.player[p].coin.classList.add("hide"); } else { ui.player[p].coin.classList.remove("hide"); ui.player[p].coin.textContent = view.players[p].coins; } - if (view.players[p].prizes == 0) { + if (view.players[p].prizes === 0) { ui.player[p].prize.classList.add("hide"); } else { ui.player[p].prize.classList.remove("hide"); @@ -640,6 +640,8 @@ function on_update() { ui.player[p].prize.textContent = view.players[p].prizes + " prizes"; } + ui.player[p].role.classList.toggle("active", p === player_index[view.active]) + ui.player[p].dial.className = "player_dial " + view.players[p].loyalty + " p" + p; ui.player[p].role_loy_icon.className = "role_loyalty_icon " + view.players[p].loyalty; -- cgit v1.2.3