Browse Source

Fix scrollbar bug on certain viewport sizes

Tyler Hallada 6 years ago
parent
commit
b8b0e5dfb4
2 changed files with 16 additions and 4 deletions
  1. 12 0
      css/style.css
  2. 4 4
      js/proximity.js

+ 12 - 0
css/style.css

@@ -7,6 +7,18 @@ html {
7 7
   background-color: #1e1e1e;
8 8
 }
9 9
 
10
+html, body, canvas {
11
+  overflow: none;
12
+}
13
+
14
+canvas {
15
+  position: fixed !important;
16
+  left: 0 !important;
17
+  right: 0 !important;
18
+  bottom: 0 !important;
19
+  top: 0 !important;
20
+}
21
+
10 22
 html, button {
11 23
   font-family: "Arial", sans-serif;
12 24
   font-size: 10pt;

+ 4 - 4
js/proximity.js

@@ -702,8 +702,8 @@ function drawPolygon (polygon, points, counter, tweeningFns) {
702 702
 /* MAIN LOOP */
703 703
 
704 704
 function loop () {
705
-    screenWidth = document.body.clientWidth;
706
-    screenHeight = document.body.clientHeight;
705
+    screenWidth = window.innerWidth;
706
+    screenHeight = window.innerHeight;
707 707
     renderer.resize(screenWidth, screenHeight);
708 708
 
709 709
     polygon.clear();
@@ -819,8 +819,8 @@ function loop () {
819 819
 }
820 820
 
821 821
 function loopStart () {
822
-    screenWidth = document.body.clientWidth;
823
-    screenHeight = document.body.clientHeight;
822
+    screenWidth = window.innerWidth;
823
+    screenHeight = window.innerHeight;
824 824
     // Create the renderer
825 825
     renderer = window.PIXI.autoDetectRenderer(screenWidth, screenHeight, {antialias: true, resolution: resolution});
826 826