Experimental symmetric randomness + deterministic option
[vchess.git] / client / src / components / BaseGame.vue
index 2a54cbb..4af4e15 100644 (file)
@@ -23,11 +23,16 @@ div#baseGame
       )
       #turnIndicator(v-if="showTurn") {{ turn }}
       #controls
-        button(@click="gotoBegin()") <<
-        button(@click="undo()") <
-        button(v-if="canFlip" @click="flip()") &#8645;
-        button(@click="play()") >
-        button(@click="gotoEnd()") >>
+        button(@click="gotoBegin()")
+          img.inline(src="/images/icons/fast-forward_rev.svg")
+        button(@click="undo()")
+          img.inline(src="/images/icons/play_rev.svg")
+        button(v-if="canFlip" @click="flip()")
+          img.inline(src="/images/icons/flip.svg")
+        button(@click="play()")
+          img.inline(src="/images/icons/play.svg")
+        button(@click="gotoEnd()")
+          img.inline(src="/images/icons/fast-forward.svg")
       #belowControls
         #downloadDiv(v-if="allowDownloadPGN")
           a#download(href="#")
@@ -45,7 +50,6 @@ div#baseGame
           | {{ st.tr["Rules"] }}
     #movesList
       MoveList(
-        v-if="showMoves != 'none'"
         :show="showMoves"
         :score="game.score"
         :message="game.scoreMsg"
@@ -223,11 +227,13 @@ export default {
         this.lastMove = null;
     },
     analyzePosition: function() {
-      const newUrl =
+      let newUrl =
         "/analyse/" +
         this.game.vname +
         "/?fen=" +
         this.vr.getFen().replace(/ /g, "_");
+      if (this.game.mycolor)
+        newUrl += "&side=" + this.game.mycolor;
       // Open in same tab in live games (against cheating)
       if (this.game.type == "live") this.$router.push(newUrl);
       else window.open("#" + newUrl);
@@ -333,7 +339,7 @@ export default {
         }
       };
       const playMove = () => {
-        const animate = V.ShowMoves == "all" && received;
+        const animate = V.ShowMoves == "all" && (received || navigate);
         if (!Array.isArray(move)) move = [move];
         let moveIdx = 0;
         let self = this;
@@ -355,8 +361,6 @@ export default {
         })();
       };
       const afterMove = (smove, initurn) => {
-        if (this.st.settings.sound == 2)
-          new Audio("/sounds/move.mp3").play().catch(() => {});
         if (this.vr.turn != initurn) {
           // Turn has changed: move is complete
           if (!smove.fen) {
@@ -370,8 +374,9 @@ export default {
             const message = getScoreMessage(score);
             if (!navigate && this.game.mode != "analyze")
               this.$emit("gameover", score, message);
-            // Just show score on screen (allow undo)
-            else this.showEndgameMsg(score + " . " + this.st.tr[message]);
+            else if (this.game.mode == "analyze")
+              // Just show score on screen (allow undo)
+              this.showEndgameMsg(score + " . " + this.st.tr[message]);
           }
           if (!navigate && this.game.mode != "analyze") {
             const L = this.moves.length;
@@ -440,8 +445,6 @@ export default {
         if (light) this.cursor--;
         else {
           this.positionCursorTo(this.cursor - 1);
-          if (this.st.settings.sound == 2)
-            new Audio("/sounds/undo.mp3").play().catch(() => {});
           this.incheck = this.vr.getCheckSquares(this.vr.turn);
           this.emitFenIfAnalyze();
         }
@@ -508,10 +511,17 @@ export default {
 #controls
   margin: 0 auto
   text-align: center
+  display: flex
   button
     display: inline-block
     width: 20%
     margin: 0
+    img.inline
+      height: 24px
+      padding-top: 5px
+    @media screen and (max-width: 767px)
+      img.inline
+        height: 18px
 
 #turnIndicator
   text-align: center