mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-28 10:54:18 +00:00
Added mobile zoom suppression
This commit is contained in:
+29
-1
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, user-scalable=no"
|
||||
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
|
||||
/>
|
||||
<title>OpenFront (ALPHA)</title>
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
@@ -43,6 +43,11 @@
|
||||
html {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
body {
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
html.preload {
|
||||
@@ -492,6 +497,29 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// Block pinch zoom and double-tap zoom on mobile
|
||||
(() => {
|
||||
const prevent = (e) => e.preventDefault();
|
||||
["gesturestart", "gesturechange", "gestureend"].forEach((evt) => {
|
||||
document.addEventListener(evt, prevent, { passive: false });
|
||||
});
|
||||
|
||||
let lastTouch = 0;
|
||||
document.addEventListener(
|
||||
"touchend",
|
||||
(e) => {
|
||||
const now = Date.now();
|
||||
if (now - lastTouch < 300) {
|
||||
e.preventDefault();
|
||||
}
|
||||
lastTouch = now;
|
||||
},
|
||||
{ passive: false },
|
||||
);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!-- Analytics -->
|
||||
<script
|
||||
defer
|
||||
|
||||
Reference in New Issue
Block a user