Fix clocks + name display on small screens
authorBenjamin Auder <benjamin.auder@somewhere>
Mon, 30 Mar 2020 00:14:17 +0000 (02:14 +0200)
committerBenjamin Auder <benjamin.auder@somewhere>
Mon, 30 Mar 2020 00:14:17 +0000 (02:14 +0200)
client/src/views/Game.vue

index b77f6b0..68afce3 100644 (file)
@@ -96,7 +96,7 @@ main
       )
         img(src="/images/icons/rematch.svg")
       #playersInfo
-        p(v-if="largeScreen")
+        p(v-if="isLargeScreen()")
           span.name(:class="{connected: isConnected(0)}")
             | {{ game.players[0].name || "@nonymous" }}
           span.time(
@@ -284,6 +284,9 @@ export default {
       }
       this.send("losefocus");
     },
+    isLargeScreen: function() {
+      return window.innerWidth >= 500;
+    },
     participateInChat: function(p) {
       return Object.keys(p.tmpIds).some(x => p.tmpIds[x].focus) && !!p.name;
     },