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 = [ var filesToCache = [
'./index.html', './index.html',
'./style.css', './style.css',

View File

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

View File

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