-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjavascriptcopy.js
68 lines (60 loc) · 2.58 KB
/
javascriptcopy.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// document.getElementById('audio').play();
// document.getElementById('audioSpace').play();
//Assigning sounds to key presses
// document.addEventListener('keydown', function(e) {
// if (e.keyCode == 49 || e.keyCode == 50 ||e.keyCode == 51 ||e.keyCode == 52 ||
// e.keyCode == 53 || e.keyCode == 54 ||e.keyCode == 55 ||e.keyCode == 56||
// e.keyCode == 57 || e.keyCode == 48 ||e.keyCode == 106 || e.keyCode == 107 ||
// e.keyCode == 49 ||e.keyCode == 67 ||e.keyCode == 188 || e.keyCode == 109 || e.keyCode == 191 ) {
// document.getElementById('audio').play();
// }
// });
// document.addEventListener('keydown', function(e) {
// if (e.keyCode == 187 ) {
// document.getElementById('audioSpace').play();
// }
// });
//Assigning sounds to clicks
// let ScreenDisplay = () => {
// switch(this.classList.contains()) {
// case 'key':
// document.getElementById('audio').play();
// this.keyCode = 48 ? screen.textContent = 0 :
// this.keyCode = 49 ? screen.textContent = 1 :
// this.keyCode = 50 ? screen.textContent = 2 :
// this.keyCode = 51 ? screen.textContent = 3 :
// this.keyCode = 52 ? screen.textContent = 4 :
// this.keyCode = 53 ? screen.textContent = 5 :
// this.keyCode = 54 ? screen.textContent = 6 :
// this.keyCode = 55 ? screen.textContent = 7 :
// this.keyCode = 56 ? screen.textContent = 8 :
// screen.textContent = 9
// }
// }
//Create a function to populate the display
// const btn = document.querySelectorAll('button');
// for (i = 0 ; i< btn.length ; i++) {
// if (!btn[i].classList.contains('result')) {
// btn[i].addEventListener('click', function(e) {
// switch(e.target.classList.contains()) {
// case 'key':
// document.getElementById('audio').play();
// this.keyCode = 48 ? screen.textContent = 0 :
// this.keyCode = 49 ? screen.textContent = 1 :
// this.keyCode = 50 ? screen.textContent = 2 :
// this.keyCode = 51 ? screen.textContent = 3 :
// this.keyCode = 52 ? screen.textContent = 4 :
// this.keyCode = 53 ? screen.textContent = 5 :
// this.keyCode = 54 ? screen.textContent = 6 :
// this.keyCode = 55 ? screen.textContent = 7 :
// this.keyCode = 56 ? screen.textContent = 8 :
// screen.textContent = 9
// break ;
// }
// })
// }else {
// btn[i].addEventListener('click',function(){
// document.getElementById('audioSpace').play();
// })
// }
// }