mirror of
https://github.com/kou029w/pucchinglgl.git
synced 2025-01-18 16:18:00 +00:00
feat: スマホのピンチ/スワイプ無効化
This commit is contained in:
parent
9d54c18876
commit
d18496ff30
2 changed files with 4 additions and 2 deletions
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>ぷっちんぐるぐる</title>
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<meta name="viewport" content="width=device-width,user-scalable=no" />
|
||||
<link rel="icon" href="data:," />
|
||||
<style>
|
||||
body {
|
||||
|
|
|
@ -71,6 +71,7 @@ function handleMouseMove(event: { clientX: number; clientY: number }) {
|
|||
}
|
||||
|
||||
function handleTouchmove(event: TouchEvent) {
|
||||
event.preventDefault();
|
||||
[...event.touches].map(handleMouseMove);
|
||||
}
|
||||
|
||||
|
@ -107,7 +108,7 @@ function setup() {
|
|||
|
||||
function main() {
|
||||
renderer.setSize(window.innerWidth, window.innerHeight);
|
||||
Object.assign(canvas.style, { width: "100vw", height: "100vh" });
|
||||
Object.assign(canvas.style, { width: "100%", height: "100%" });
|
||||
root.addEventListener("keydown", handleKeydown);
|
||||
root.addEventListener("touchmove", handleTouchmove);
|
||||
root.addEventListener("keyup", handleMouseMoveEnd);
|
||||
|
@ -122,6 +123,7 @@ function main() {
|
|||
});
|
||||
}
|
||||
root.appendChild(canvas);
|
||||
Object.assign(root.style, { overflow: "hidden", overscrollBehavior: "none" });
|
||||
window.addEventListener("resize", adjustCanvasSize);
|
||||
setup();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue