Skip to content

Commit bdedd60

Browse files
committed
basic functionality, without 'cheating'
1 parent cce8253 commit bdedd60

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

01 - JavaScript Drum Kit/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
keys.forEach(key =>{
7676
key.addEventListener('click', function(e){
7777
var curKey = e.currentTarget.getAttribute('data-key');
78-
playSoundForKey(curKey);
78+
playSoundForKey(cujhrKey);
7979
});
8080
});
8181

02 - JS + CSS Clock/index-START.html

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,28 @@
1414
<div class="hand second-hand"></div>
1515
</div>
1616
</div>
17+
<div>
18+
19+
st ast </div>
20+
<script>
21+
const secondHand = document.querySelector('.second-hand');
22+
const minuteHand = document.querySelector('.min-hand');
23+
const hourHand = document.querySelector('.hour-hand');
1724

25+
var transformCurrentTime = function(){
26+
let currentDate = new Date();
27+
const seconds = currentDate.getSeconds();
28+
const minutes = currentDate.getMinutes();
29+
const hours = currentDate.getHours() - 12;
30+
console.log(seconds);
31+
secondHand.style.transform = "rotate("+((6 * seconds) + 90)+"deg)";
32+
minuteHand.style.transform = "rotate("+((6 * minutes) + 90)+"deg)";
33+
hourHand.style.transform = "rotate("+((30 * hours) + 90)+"deg)";
34+
}
35+
transformCurrentTime();
36+
window.setInterval(transformCurrentTime, 1000);
1837

38+
</script>
1939
<style>
2040
html {
2141
background:#018DED url(http://unsplash.it/1500/1000?image=881&blur=50);
@@ -61,13 +81,10 @@
6181
background:black;
6282
position: absolute;
6383
top:50%;
84+
transform-origin: 100%;
85+
transform:rotate(90deg);
6486
}
6587

6688
</style>
67-
68-
<script>
69-
70-
71-
</script>
7289
</body>
7390
</html>

0 commit comments

Comments
 (0)