Skip to content

Commit ccb71f6

Browse files
committed
docs: add tap
1 parent 957f8bd commit ccb71f6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

docs/index.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,7 @@ <h1 class="sr-only">Half-Life Dedicated Server with Docker</h1>
768768
const clickSound = new Audio("click.mp3");
769769
const noSound = new Audio("no.mp3");
770770
const inputSound = new Audio("input.mp3");
771+
const tapSound = new Audio("tap.mp3");
771772
noSound.volume = 0.6;
772773

773774
// Map data for each game
@@ -1054,12 +1055,20 @@ <h1 class="sr-only">Half-Life Dedicated Server with Docker</h1>
10541055
updateCommand();
10551056

10561057
const interactiveElements = document.querySelectorAll(
1057-
"button:not(.close), a, select, input[type='checkbox'], input[type='radio']"
1058+
"button:not(.close), a, select, input[type='radio']"
10581059
);
10591060
interactiveElements.forEach((element) => {
10601061
element.addEventListener("mousedown", playButtonSound);
10611062
});
10621063

1064+
const checkboxElements = document.querySelectorAll("input[type='checkbox']");
1065+
checkboxElements.forEach((element) => {
1066+
element.addEventListener("click", () => {
1067+
tapSound.currentTime = 0;
1068+
tapSound.play().catch(() => {});
1069+
});
1070+
});
1071+
10631072
const inputElements = document.querySelectorAll(
10641073
"input[type='text'], input[type='password'], input[type='number']"
10651074
);

docs/tap.mp3

2.32 KB
Binary file not shown.

0 commit comments

Comments
 (0)