-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
33 lines (24 loc) · 1.38 KB
/
script.js
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
//list of sounds as mentioned in index.html. this needs to be in order
const sounds = ['sneaky snitch', 'he he he hah', 'supercell', 'sticky keys', 'sticky keys BASS BOOSTED', 'super idol', 'iphone alarm', 'angry birds', 'bad piggies', 'china 1','vine boom','mc disc stal','skibidi bop mm dada','scatman','samsung notification','ring BASS BOOSTED','red sun in the sky','notification spam','monkeys spinning monkeys','my singing monsters','metal pipe','max verstappen','lego build','lego break','hog rider','ching cheng hanji','carefree ukulele','bruh','bing chilling','better call saul','aughhhhhh','arabic nokia','peppa theme BASS BOOSTED','discord']
//magic that stops sound when 'stop.png is clicked'
function stopSongs() {
sounds.forEach(sound => {
const song = document.getElementById(sound)
song.pause()
song.currentTime = 0;
})
}
//magic that makes the sound work. no need to change this
window.addEventListener("load", (event) => {
sounds.forEach(sound => {
const btn = document.createElement('button')
btn.classList.add('btn')
btn.innerText = sound
btn.addEventListener('click', () => {
stopSongs()
document.getElementById(sound).play()
})
document.getElementById('buttons').appendChild(btn)
})
document.getElementById('loading').style.display = 'none'
}, false);