Try to disable refresh on overscroll in chrome

This commit is contained in:
2019-04-20 18:11:19 +02:00
parent ecb9ea25f7
commit 36dab80de8
3 changed files with 31 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
var cacheName = 'CandyFucker-v2';
var cacheName = 'CandyFucker-v3';
var filesToCache = [
'./index.html',
'./style.css',

View File

@@ -59,6 +59,7 @@ Mouse.prototype = {
this.StartPosition.Y = position.Y;
this.EndPosition.X = position.X;
this.EndPosition.Y = position.Y;
event.preventDefault();
},
OnMouseMove: function (event) {
if (this.RealDown === false) {
@@ -72,6 +73,7 @@ Mouse.prototype = {
this.Down = true;
this.EndPosition.X = position.X;
this.EndPosition.Y = position.Y;
event.preventDefault();
},
OnMouseUp: function (event) {
var position = this.GetEventPoistion({
@@ -81,10 +83,12 @@ Mouse.prototype = {
this.RealDown = false;
this.EndPosition.X = position.X;
this.EndPosition.Y = position.Y;
event.preventDefault();
},
OnMouseLeave: function () {
this.RealDown = false;
this.Down = false;
event.preventDefault();
},
OnTouchStart: function (event) {
var position = this.GetEventPoistion({
@@ -97,6 +101,7 @@ Mouse.prototype = {
this.StartPosition.Y = position.Y;
this.EndPosition.X = position.X;
this.EndPosition.Y = position.Y;
event.preventDefault();
},
OnTouchMove: function (event) {
if (this.RealDown === false) {
@@ -110,9 +115,11 @@ Mouse.prototype = {
this.Down = true;
this.EndPosition.X = position.X;
this.EndPosition.Y = position.Y;
event.preventDefault();
},
OnTouchEnd: function () {
this.RealDown = false;
event.preventDefault();
},
Update: function () {
if (this.RealDown === false) {

View File

@@ -1,6 +1,7 @@
html {
height: 100%;
}
body {
background-color: rgb(20, 20, 20);
color: grey;
@@ -9,7 +10,9 @@ body{
padding: 0;
text-align: center;
height: 100%;
overscroll-behavior: contain;
}
#divLogo {
display: block;
height: auto;
@@ -17,10 +20,12 @@ body{
padding: 0;
margin: 0;
}
#divLogo img {
max-width: 100%;
height: auto;
}
#divInfoDisplay {
display: block;
height: 20px;
@@ -31,6 +36,7 @@ body{
padding: 0;
margin: 0;
}
#divScreen {
display: block;
position: relative;
@@ -39,11 +45,15 @@ body{
height: 70%;
overflow: visible;
}
#cnvScreen {
display: block;
position: absolute;
margin: auto;
top: 0; left: 0; bottom: 0; right: 0;
top: 0;
left: 0;
bottom: 0;
right: 0;
max-width: 100%;
max-height: 100%;
box-shadow: 0 0 20px rgb(0, 0, 0);