feat(frontend): better stealth overlay
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
let stealthMode = $state(false);
|
||||
let lastTap = $state({ time: 0, x: 0, y: 0 });
|
||||
|
||||
onMount(() => {
|
||||
document.body.style.touchAction = 'manipulation';
|
||||
return () => {
|
||||
document.body.style.touchAction = '';
|
||||
};
|
||||
});
|
||||
|
||||
function isInCenterZone(x: number, y: number): boolean {
|
||||
const w = window.innerWidth;
|
||||
const h = window.innerHeight;
|
||||
@@ -25,7 +34,7 @@
|
||||
const distX = Math.abs(x - lastTap.x);
|
||||
const distY = Math.abs(y - lastTap.y);
|
||||
|
||||
if (timeDiff < 300 && distX < 50 && distY < 50) {
|
||||
if (timeDiff < 500 && distX < 50 && distY < 50) {
|
||||
stealthMode = !stealthMode;
|
||||
lastTap = { time: 0, x: 0, y: 0 };
|
||||
e.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user