forked from seth/ipv4.army
fix
This commit is contained in:
parent
0d268d2660
commit
ab71bc828a
2 changed files with 6 additions and 21 deletions
|
@ -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(<App />);
|
|||
|
||||
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}`,
|
||||
});
|
||||
|
|
|
@ -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();
|
||||
};
|
Loading…
Add table
Reference in a new issue