diff --git a/src/front/index.tsx b/src/front/index.tsx index 636b1c0..4ae4865 100644 --- a/src/front/index.tsx +++ b/src/front/index.tsx @@ -1,7 +1,5 @@ import "tsx-dom"; -import "./utilities/clicker"; - import App from "./App"; import colors from "./utilities/colors.module.css"; import { snacker } from "./utilities/snackbar"; @@ -12,10 +10,15 @@ document.body.appendChild(); let clicks = 0; let resetCount = ""; + + document.onclick = () => { + "vibrate" in navigator && navigator.vibrate(1); + new Audio("https://no.ipv4.army/raw/Effect_Tick.ogg").play(); + clicks++; - if (clicks % 5 === 0) { + if (clicks % 10 === 0) { snacker({ message: `Please stop.${resetCount}`, }); diff --git a/src/front/utilities/clicker/index.ts b/src/front/utilities/clicker/index.ts deleted file mode 100644 index 210ba0a..0000000 --- a/src/front/utilities/clicker/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -const effectTick = new Audio("https://no.ipv4.army/raw/Effect_Tick.ogg"); - -const whitelistedTags = ["button", "icon", "item", "tooltip", "avatar"]; - -document.onclick = (event: MouseEvent) => { - const target = event.target as HTMLElement; - - if (!target) return; - - const tagName = target.tagName.toLowerCase(); - const isWhitelisted = whitelistedTags.some((tag) => tagName.includes(tag)); - - if (!isWhitelisted) return; - - "vibrate" in navigator && navigator.vibrate(1); - effectTick.currentTime = 0; - effectTick.play(); -};