-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
137 lines (122 loc) · 3.92 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
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Drum Kit</title>
<link rel="stylesheet" href="hemanthstyles.css">
</head>
<style>
.th {
position: absolute;
transition: transform .2s;
top: 40px;
font-family:Segoe Print;
left: 20px;
color:black;
-ms-transform: rotate(278deg); /* IE 9 */
transform: rotate(342deg);
text-shadow: 1px 3px #8CF7F2;
font-size: 25px;
-webkit-animation: glow 1s ease-in-out infinite alternate;
-moz-animation: glow 1s ease-in-out infinite alternate;
animation: glow 1s ease-in-out infinite alternate;
}
.th:hover{
transform: scale(1.1);
-ms-transform: rotate(278deg); /* IE 9 */
transform: rotate(350deg);
font-size: 40px
}
.blink {
animation: blinker 0.6s linear infinite;
color: #3c00ff;
font-size: 26px;
font-weight: bold;
font-family:cursive;
}
@keyframes blinker {
50% { opacity: 0; }
}
@-webkit-keyframes glow {
from {
text-shadow: 0 0 10px #F4F967, 0 0 20px #F4F967 , 0 0 30px #F4F967, 0 0 40px #F4F967, 0 0 50px red, 0 0 60px white, 0 0 70px 0C0A0A;
}
to {
text-shadow: 0 0 20px red, 0 0 30px #ff4da6, 0 0 40px #EEE972, 0 0 50px red, 0 0 60px #EEE972, 0 0 70px red, 0 0 80px #F4F967;
}}
</style>
<body >
<br><br>
<div class="keys">
<div data-key="65" class="key">
<hem>A</hem>
<span class="sound">clap</span>
</div>
<div data-key="83" class="key">
<hem>S</hem>
<span class="sound">hihat</span>
</div>
<div data-key="68" class="key">
<hem>D</hem>
<span class="sound">kick</span>
</div>
<div data-key="70" class="key">
<hem>F</hem>
<span class="sound">openhat</span>
</div>
<div data-key="32" class="key">
<hem>Sp</hem>
<span class="sound">boom</span>
</div>
<div data-key="72" class="key">
<hem>H</hem>
<span class="sound">ride</span>
</div>
<div data-key="74" class="key">
<hem>J</hem>
<span class="sound">snare</span>
</div>
<div data-key="75" class="key">
<hem>K</hem>
<span class="sound">tom</span>
</div>
<div data-key="76" class="key">
<hem>L</hem>
<span class="sound">tink</span>
</div>
</div>
<audio data-key="65" src="clap.wav"></audio>
<audio data-key="83" src="hihat.wav"></audio>
<audio data-key="68" src="kick.wav"></audio>
<audio data-key="70" src="openhat.wav"></audio>
<audio data-key="32" src="boom.wav"></audio>
<audio data-key="72" src="ride.wav"></audio>
<audio data-key="74" src="snare.wav"></audio>
<audio data-key="75" src="tom.wav"></audio>
<audio data-key="76" src="tink.wav"></audio>
<script>
function removeTransition(e) {
if (e.propertyName !== 'transform') return;
e.target.classList.remove('playing');
}
function playSound(e) {
const audio = document.querySelector(`audio[data-key="${e.keyCode}"]`);
const key = document.querySelector(`div[data-key="${e.keyCode}"]`);
if (!audio) return;
key.classList.add('playing');
audio.currentTime = 0;
audio.play();
}
const keys = Array.from(document.querySelectorAll('.key'));
keys.forEach(key => key.addEventListener('transitionend', removeTransition));
window.addEventListener('keydown', playSound);
</script>
<b>
<div class="th">
<p class="blink">DRUM SIMULATION <br>Developed by <br> HEMANTH N</p>
</div>
</b>
</body>
</html>