This commit is contained in:
Pavel Dobryakov
2017-08-27 19:53:58 +03:00
parent 5a83634224
commit 4a5cad017a
2 changed files with 3 additions and 9 deletions

View File

@@ -8,7 +8,6 @@
<meta property="og:title" content="webgl fluid simulation"> <meta property="og:title" content="webgl fluid simulation">
<meta property="og:url" content="https://paveldogreat.github.io/WebGL-Fluid-Simulation/"> <meta property="og:url" content="https://paveldogreat.github.io/WebGL-Fluid-Simulation/">
<meta property="og:image" content="logo.png"> <meta property="og:image" content="logo.png">
<meta name="apple-mobile-web-app-capable" content="yes">
<script type="text/javascript" src="dat.gui.min.js"></script> <script type="text/javascript" src="dat.gui.min.js"></script>
<style> <style>
* { * {
@@ -73,6 +72,5 @@
<body> <body>
<canvas></canvas> <canvas></canvas>
<script src="./script.js"></script> <script src="./script.js"></script>
<p height="1px"></p>
</body> </body>
</html> </html>

View File

@@ -584,7 +584,7 @@ canvas.addEventListener('touchmove', (e) => {
pointer.x = touches[i].pageX; pointer.x = touches[i].pageX;
pointer.y = touches[i].pageY; pointer.y = touches[i].pageY;
} }
}, false); }, { passive: true });
canvas.addEventListener('mousedown', () => { canvas.addEventListener('mousedown', () => {
pointers[0].down = true; pointers[0].down = true;
@@ -603,7 +603,7 @@ canvas.addEventListener('touchstart', (e) => {
pointers[i].y = touches[i].pageY; pointers[i].y = touches[i].pageY;
pointers[i].color = [Math.random() + 0.2, Math.random() + 0.2, Math.random() + 0.2]; pointers[i].color = [Math.random() + 0.2, Math.random() + 0.2, Math.random() + 0.2];
} }
}); }, { passive: true });
window.addEventListener('mouseup', () => { window.addEventListener('mouseup', () => {
pointers[0].down = false; pointers[0].down = false;
@@ -615,8 +615,4 @@ window.addEventListener('touchend', (e) => {
for (let j = 0; j < pointers.length; j++) for (let j = 0; j < pointers.length; j++)
if (touches[i].identifier == pointers[j].id) if (touches[i].identifier == pointers[j].id)
pointers[j].down = false; pointers[j].down = false;
}); });
window.addEventListener("load", () => {
window.scrollTo(1, 0);
}, false);