diff --git a/01 - JavaScript Drum Kit/index-FINISHED.html b/01 - JavaScript Drum Kit/index-FINISHED.html
old mode 100644
new mode 100755
diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html
old mode 100644
new mode 100755
index 4070d32767..659df91288
--- a/01 - JavaScript Drum Kit/index-START.html
+++ b/01 - JavaScript Drum Kit/index-START.html
@@ -1,65 +1,63 @@
-
- JS Drum Kit
-
+
+ JS Drum Kit
+
-
-
- A
- clap
-
-
- S
- hihat
-
-
- D
- kick
-
-
- F
- openhat
-
-
- G
- boom
-
-
- H
- ride
-
-
- J
- snare
-
-
- K
- tom
-
-
- L
- tink
-
-
+
+
+ A
+ clap
+
+
+ S
+ hihat
+
+
+ D
+ kick
+
+
+ F
+ openhat
+
+
+ G
+ boom
+
+
+ H
+ ride
+
+
+ J
+ snare
+
+
+ K
+ tom
+
+
+ L
+ tink
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
diff --git a/01 - JavaScript Drum Kit/index.html b/01 - JavaScript Drum Kit/index.html
deleted file mode 100644
index a18f2bc2ca..0000000000
--- a/01 - JavaScript Drum Kit/index.html
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
- JS Drum Kit
-
-
-
-
-
-
-
- A
- clap
-
-
- S
- hihat
-
-
- D
- kick
-
-
- F
- openhat
-
-
- G
- boom
-
-
- H
- ride
-
-
- J
- snare
-
-
- K
- tom
-
-
- L
- tink
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/01 - JavaScript Drum Kit/main.js b/01 - JavaScript Drum Kit/main.js
new file mode 100644
index 0000000000..2f14dda419
--- /dev/null
+++ b/01 - JavaScript Drum Kit/main.js
@@ -0,0 +1,22 @@
+window.addEventListener('keydown', function(e){
+ const audio = document.querySelector(`audio[data-key="${e.keyCode}"]`);
+ const key = document.querySelector(`.key[data-key="${e.keyCode}"]`)
+ if(!audio) return; // stops the audio from running all together
+ audio.currentTime = 0; // rewinds to the start
+ audio.play(); // plays keys over and over again\
+ // key.classList.toggle('playing');
+ key.classList.add('playing');
+});
+
+const keys = Array.from(document.querySelectorAll('.key'));
+// cannot listen for events on an array
+keys.forEach(key => key.addEventListener('transitionend', removeTransition));
+console.log(keys);
+
+function removeTransition(e) {
+ console.log(e);
+ if(e.propertyName !== 'transform') {
+ return; // skip if it's not a transform
+ }
+ this.classList.remove('playing');
+}
\ No newline at end of file
diff --git a/01 - JavaScript Drum Kit/style.css b/01 - JavaScript Drum Kit/style.css
old mode 100644
new mode 100755
index 3e0a320b37..075578c930
--- a/01 - JavaScript Drum Kit/style.css
+++ b/01 - JavaScript Drum Kit/style.css
@@ -1,6 +1,6 @@
html {
font-size: 10px;
- background:url(http://i.imgur.com/b9r5sEL.jpg) bottom center;
+ background: url(http://i.imgur.com/b9r5sEL.jpg) bottom center;
background-size: cover;
}
body,html {
@@ -10,41 +10,41 @@ body,html {
}
.keys {
- display:flex;
- flex:1;
- min-height:100vh;
+ display: flex;
+ flex: 1;
+ min-height: 100vh;
align-items: center;
justify-content: center;
}
.key {
- border:4px solid black;
- border-radius:5px;
- margin:1rem;
+ border: .4rem solid black;
+ border-radius: .5rem;
+ margin: 1rem;
font-size: 1.5rem;
- padding:1rem .5rem;
- transition:all .07s;
- width:100px;
+ padding: 1rem .5rem;
+ transition: all .07s ease;
+ width: 10rem;
text-align: center;
- color:white;
- background:rgba(0,0,0,0.4);
- text-shadow:0 0 5px black;
+ color: white;
+ background: rgba(0,0,0,0.4);
+ text-shadow: 0 0 .5rem black;
}
.playing {
- transform:scale(1.1);
- border-color:#ffc600;
- box-shadow: 0 0 10px #ffc600;
+ transform: scale(1.1);
+ border-color: #ffc600;
+ box-shadow: 0 0 1rem #ffc600;
}
kbd {
display: block;
- font-size: 40px;
+ font-size: 4rem;
}
.sound {
font-size: 1.2rem;
text-transform: uppercase;
- letter-spacing: 1px;
- color:#ffc600;
+ letter-spacing: .1rem;
+ color: #ffc600;
}
diff --git a/02 - JS + CSS Clock/index-START.html b/02 - JS + CSS Clock/index-START.html
index 259280d228..ae776a5806 100644
--- a/02 - JS + CSS Clock/index-START.html
+++ b/02 - JS + CSS Clock/index-START.html
@@ -61,13 +61,37 @@
background:black;
position: absolute;
top:50%;
+ transform-origin: 100%;
+ transform: rotate(90deg);
+ transition: 0.05s all;
+ transition-timing-function: cubic-bezier(0.1, 2.7, 0.58, 1);
}