MCPcopy Create free account
hub / github.com/codemistic/Web-Development / Click

Function Click

Implementation of DOM(Document Object Module)/index.js:27–64  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

25
26//fuctions
27function Click(key){
28
29
30 switch (key) {
31 case "w":
32 var tom1=new Audio('sounds/tom-1.mp3');
33 tom1.play();
34 break;
35 case "a":
36 var tom2=new Audio('sounds/tom-2.mp3');
37 tom2.play();
38 break;
39 case "s":
40 var tom3=new Audio('sounds/tom-3.mp3');
41 tom3.play();
42 break;
43 case "d":
44 var tom4=new Audio('sounds/tom-4.mp3');
45 tom4.play();
46 break;
47 case "j":
48 var snare=new Audio('sounds/snare.mp3');
49 snare.play();
50 break;
51 case "k":
52 var crash=new Audio('sounds/crash.mp3');
53 crash.play();
54 break;
55 case "l":
56 var kick=new Audio('sounds/kick-bass.mp3');
57 kick.play();
58 break;
59
60 default:
61 alert("Oppsie!wrong pressed.")
62 break;
63 }
64}
65
66function buttonAnimation(currentKey){
67 var activeKey=document.querySelector("."+ currentKey);

Callers 2

virtualclickFunction · 0.85
index.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected