Browse Source

horizontal scroll

Bachir Soussi Chiadmi 1 year ago
parent
commit
6311fa06a6
2 changed files with 24 additions and 1 deletions
  1. 5 1
      assets/css/app.scss
  2. 19 0
      src/App.vue

+ 5 - 1
assets/css/app.scss

@@ -53,8 +53,12 @@ section[role='main-content']{
     margin:0.2em;
     padding:0.2em;
     border-radius: 6px;
+    cursor: pointer;
+    &:hover{
+      background-color: #eee;
+    }
     &:focus, &:active{
-      background-color: #ddd;
+      background-color: #ccc;
     }
   }
 

+ 19 - 0
src/App.vue

@@ -25,6 +25,18 @@
           @click.prevent="onZoom"
           @keyup.enter="onZoom"
         >zoomout</span>
+        <span
+          class="btn scroll"
+          mode="backward"
+          @click.prevent="onScroll"
+          @keyup.enter="onScroll"
+        >go backward</span>
+        <span
+          class="btn scroll"
+          mode="forward"
+          @click.prevent="onScroll"
+          @keyup.enter="onScroll"
+        >go forward</span>
       </div>
     </section>
   </div>
@@ -62,6 +74,13 @@ export default {
       this.$socket.emit('zoom', {
         mode: mode
       })
+    },
+    onScroll (e) {
+      console.log('onScroll', e)
+      let mode = e.originalTarget.getAttribute('mode')
+      this.$socket.emit('scroll', {
+        mode: mode
+      })
     }
   }
 }