-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.html
36 lines (33 loc) · 1.05 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<meta charset="UTF-8">
<head>
<title>Ah Ah Ah, you didn't say the magic word!</title>
</head>
<html>
<body>
<div class="container" onclick="playSound()">
<div class="nedry">
<img class="nedry-body" src="resources/body.png">
<img class="nedry-head" src="resources/head.png">
<img class="nedry-hand" src="resources/hand.png">
</div>
<audio id="player" autoplay loop>
<source src="resources/ahahah.mp3" type="audio/mp3">
</audio>
<input id="unmuteButton" type="button" onclick="playSound()" value="🔈 Unmute" />
</div>
</body>
<link rel="stylesheet" href="resources/style.css">
<script>
const sound = document.getElementById('player');
sound.addEventListener('play', (event) => {
document.getElementById("unmuteButton").hidden = true;
});
sound.addEventListener('pause', (event) => {
document.getElementById("unmuteButton").hidden = false;
});
function playSound() {
document.getElementById("player").play();
}
</script>
</html>