forked from bgiudicid/BoomGirlsProject
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
39 lines (36 loc) · 1.07 KB
/
Copy pathindex.js
File metadata and controls
39 lines (36 loc) · 1.07 KB
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
37
38
39
const crash = document.querySelector('#crash');
const bombo = document.querySelector('#bombo');
const tom1 = document.querySelector('#tom1');
const tom2 = document.querySelector('#tom2');
const tom3 = document.querySelector('#tom3');
const tom4 = document.querySelector('#tom4');
const hit = document.querySelector('#hit');
const redoblante = document.querySelector('#redoblante');
function sound(nameSound){
const dom = new Audio(nameSound);
dom.play();
}
crash.addEventListener('click', () => {
sound("./sounds/crash.wav");
});
bombo.addEventListener('click', () => {
sound("./sounds/bombo (1).wav");
});
tom1.addEventListener('click', () => {
sound("./sounds/tom1.wav");
});
tom2.addEventListener('click', () => {
sound("./sounds/tom2.wav");
});
tom3.addEventListener('click', () => {
sound("./sounds/tom3.wav");
});
tom4.addEventListener('click', () => {
sound("./sounds/tom4.wav");
});
hit.addEventListener('click', () => {
sound("./sounds/hit-hat.wav");
});
redoblante.addEventListener('click', () => {
sound("./sounds/redoblante.wav");
});