From b8b0e5dfb40e1622e8894beac9caa5487b8e139d Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Sat, 19 Aug 2017 13:53:59 -0400 Subject: [PATCH] Fix scrollbar bug on certain viewport sizes --- css/style.css | 12 ++++++++++++ js/proximity.js | 8 ++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/css/style.css b/css/style.css index 08e909b..526244f 100644 --- a/css/style.css +++ b/css/style.css @@ -7,6 +7,18 @@ html { background-color: #1e1e1e; } +html, body, canvas { + overflow: none; +} + +canvas { + position: fixed !important; + left: 0 !important; + right: 0 !important; + bottom: 0 !important; + top: 0 !important; +} + html, button { font-family: "Arial", sans-serif; font-size: 10pt; diff --git a/js/proximity.js b/js/proximity.js index 6b06a6b..f0bc809 100644 --- a/js/proximity.js +++ b/js/proximity.js @@ -702,8 +702,8 @@ function drawPolygon (polygon, points, counter, tweeningFns) { /* MAIN LOOP */ function loop () { - screenWidth = document.body.clientWidth; - screenHeight = document.body.clientHeight; + screenWidth = window.innerWidth; + screenHeight = window.innerHeight; renderer.resize(screenWidth, screenHeight); polygon.clear(); @@ -819,8 +819,8 @@ function loop () { } function loopStart () { - screenWidth = document.body.clientWidth; - screenHeight = document.body.clientHeight; + screenWidth = window.innerWidth; + screenHeight = window.innerHeight; // Create the renderer renderer = window.PIXI.autoDetectRenderer(screenWidth, screenHeight, {antialias: true, resolution: resolution});