From ae0c2e6e17b64781d26ffe2b2592c4e9675e9130 Mon Sep 17 00:00:00 2001
From: Olivier Gayot <olivier.gayot@sigexec.com>
Date: Mon, 30 Mar 2020 00:12:13 +0200
Subject: Quick and dirty impl. to get the black card visible after collection

Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
---
 usr/share/swiftstory/www/swiftstory-mobile.html | 6 +++---
 usr/share/swiftstory/www/swiftstory-mobile.js   | 4 ++++
 2 files changed, 7 insertions(+), 3 deletions(-)

(limited to 'usr/share/swiftstory/www')

diff --git a/usr/share/swiftstory/www/swiftstory-mobile.html b/usr/share/swiftstory/www/swiftstory-mobile.html
index a0407d4..ed5c849 100644
--- a/usr/share/swiftstory/www/swiftstory-mobile.html
+++ b/usr/share/swiftstory/www/swiftstory-mobile.html
@@ -23,10 +23,10 @@
           <button id="join-btn" class="bottom" hidden>Join game!</button>
       </div>
       <div id="game" class="page">
+          <div class="card-list read-only">
+              <button id="black-card" class="card black"></button>
+          </div>
           <div data-state="judge-collect">
-              <div class="card-list read-only">
-                  <button id="black-card" class="card black"></button>
-              </div>
               <div class="message">You have <span id="played-card-number">0</span> cards!</div>
           </div>
           <div id="white-cards" class="card-list read-only" disabled='disabled'></div>
diff --git a/usr/share/swiftstory/www/swiftstory-mobile.js b/usr/share/swiftstory/www/swiftstory-mobile.js
index b05193c..65abc54 100644
--- a/usr/share/swiftstory/www/swiftstory-mobile.js
+++ b/usr/share/swiftstory/www/swiftstory-mobile.js
@@ -43,10 +43,12 @@ $(document).ready(function() {
         $home.removeClass("current");
         $game.addClass("current");
         $all.hide();
+        $black_card.hide();
     };
 
     swst.on_change_state = function(state) {
         $all.hide();
+        $black_card.hide();
 
         switch (state) {
             case 'waiting_judge':
@@ -57,6 +59,7 @@ $(document).ready(function() {
             case 'waiting_designation':
                 if (swst.is_judge()) {
                     $judge_choose.show();
+                    $black_card.show();
                     $played_cards.removeAttr('disabled');
                     $played_cards.removeClass('read-only');
                 } else {
@@ -68,6 +71,7 @@ $(document).ready(function() {
             case 'waiting_collection':
                 if (swst.is_judge()) {
                     $judge_collect.show();
+                    $black_card.show();
                     $white_cards.attr('disabled', true);
                     $white_cards.addClass('read-only');
                 } else {
-- 
cgit v1.2.3