Finished. Now some last styling
[vchess.git] / client / src / components / BaseGame.vue
index f490043..2bf1fbd 100644 (file)
@@ -1,7 +1,8 @@
 <template lang="pug">
-div#baseGame(tabindex=-1 @click="() => focusBg()" @keydown="handleKeys")
+div#baseGame(tabindex=-1 @click="() => focusBg()"
+    @keydown="handleKeys" @wheel="handleScroll")
   input#modalEog.modal(type="checkbox")
-  div(role="dialog" aria-labelledby="eogMessage")
+  div(role="dialog" data-checkbox="modalEog" aria-labelledby="eogMessage")
     .card.smallpad.small-modal.text-center
       label.modal-close(for="modalEog")
       h3#eogMessage.section {{ endgameMessage }}
@@ -118,6 +119,12 @@ export default {
           break;
       }
     },
+    handleScroll: function(e) {
+      if (e.deltaY < 0)
+        this.undo();
+      else if (e.deltaY > 0)
+        this.play();
+    },
     re_setVariables: function() {
       this.endgameMessage = "";
       this.orientation = this.game.mycolor || "w"; //default orientation for observed games
@@ -387,6 +394,4 @@ export default {
         padding: 0
         td
           text-align: left
-.clearer
-  clear: both
 </style>