toggle active based on which player is active
authorGeoffrey Allott <geoffrey@allott.email>
Wed, 7 Jun 2023 21:52:57 +0000 (22:52 +0100)
committerGeoffrey Allott <geoffrey@allott.email>
Wed, 7 Jun 2023 21:52:57 +0000 (22:52 +0100)
site/modules/cribbage.js

index 939a37313a7f4a2263a99a917e71c6861fc31b2a..ea84c5cbc570b139c32b735a763d6c9c316074bd 100644 (file)
@@ -34,6 +34,7 @@ export class Cribbage extends GameWithChat {
 
     redraw_players() {
         const active_player = this.active;
+        this.pass_control.classList.toggle("active", active_player === this.username && this.community.length !== 0 && this.hands.has(this.username) && this.hands.get(this.username).length !== 0);
         for (const [username, [icon, score, active]] of this.user_icons) {
             if (!this.seats.has(username)) {
                 this.svg.removeChild(icon);