This commit is contained in:
parent
b76e879350
commit
9a1564cdb5
10 changed files with 212 additions and 57 deletions
|
@ -2,20 +2,21 @@ const effectTick = new Audio("https://no.ipv4.army/u/Effect_Tick.ogg");
|
|||
|
||||
effectTick.volume = 0.1;
|
||||
|
||||
const whitelistedTags = ["mdui-button", "mdui-icon"];
|
||||
const whitelistedTags = ["button", "icon", "item"];
|
||||
|
||||
document.onclick = (event: MouseEvent) => {
|
||||
const target = event.target as HTMLElement;
|
||||
const target = event.target as HTMLElement;
|
||||
|
||||
if (!target) return;
|
||||
if (!target) return;
|
||||
|
||||
const tagName = target.tagName.toLowerCase();
|
||||
const isWhitelisted = whitelistedTags.some((tag) => tagName.startsWith(tag));
|
||||
const tagName = target.tagName.toLowerCase();
|
||||
const isWhitelisted = whitelistedTags.some((tag) => tagName.includes(tag));
|
||||
|
||||
console.log(tagName, isWhitelisted);
|
||||
console.log(tagName, isWhitelisted);
|
||||
|
||||
if (!isWhitelisted) return;
|
||||
if (!isWhitelisted) return;
|
||||
|
||||
effectTick.currentTime = 0;
|
||||
effectTick.play();
|
||||
("vibrate" in navigator && navigator.vibrate(1));
|
||||
effectTick.currentTime = 0;
|
||||
effectTick.play();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue