Skip to content

Commit 987fe0e

Browse files
committed
prettier formating
1 parent 7f8c5f5 commit 987fe0e

File tree

3 files changed

+70
-67
lines changed

3 files changed

+70
-67
lines changed

01 - JavaScript Drum Kit/index-START.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,18 @@
5353
if (!audio) return; // stop the function from running all together
5454
audio.currentTime = 0; // rewind to the start
5555
audio.play();
56-
console.log(key);
56+
key.classList.add("playing");
5757
});
58+
59+
function removeTransition(e) {
60+
if (e.propertyName !== "transform") return; // skip it if it's not a transform
61+
console.log(e.propertyName);
62+
}
63+
64+
const keys = document.querySelectorAll(".key");
65+
keys.forEach(key =>
66+
key.addEventListener("transitionend", removeTransition)
67+
);
5868
</script>
5969
</body>
6070
</html>

01 - JavaScript Drum Kit/style.css

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ html {
44
background-size: cover;
55
}
66

7-
body,html {
7+
body,
8+
html {
89
margin: 0;
910
padding: 0;
1011
font-family: sans-serif;
@@ -19,17 +20,17 @@ body,html {
1920
}
2021

2122
.key {
22-
border: .4rem solid black;
23-
border-radius: .5rem;
23+
border: 0.4rem solid black;
24+
border-radius: 0.5rem;
2425
margin: 1rem;
2526
font-size: 1.5rem;
26-
padding: 1rem .5rem;
27-
transition: all .07s ease;
27+
padding: 1rem 0.5rem;
28+
transition: all 0.07s ease;
2829
width: 10rem;
2930
text-align: center;
3031
color: white;
31-
background: rgba(0,0,0,0.4);
32-
text-shadow: 0 0 .5rem black;
32+
background: rgba(0, 0, 0, 0.4);
33+
text-shadow: 0 0 0.5rem black;
3334
}
3435

3536
.playing {
@@ -46,6 +47,6 @@ kbd {
4647
.sound {
4748
font-size: 1.2rem;
4849
text-transform: uppercase;
49-
letter-spacing: .1rem;
50+
letter-spacing: 0.1rem;
5051
color: #ffc600;
5152
}
Lines changed: 50 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8">
5-
<title>JS + CSS Clock</title>
6-
</head>
7-
<body>
8-
9-
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>JS + CSS Clock</title>
6+
</head>
7+
<body>
108
<div class="clock">
119
<div class="clock-face">
1210
<div class="hand hour-hand"></div>
@@ -15,60 +13,54 @@
1513
</div>
1614
</div>
1715

16+
<style>
17+
html {
18+
background: #018ded url(http://unsplash.it/1500/1000?image=881&blur=50);
19+
background-size: cover;
20+
font-family: "helvetica neue";
21+
text-align: center;
22+
font-size: 10px;
23+
}
1824

19-
<style>
20-
html {
21-
background: #018DED url(http://unsplash.it/1500/1000?image=881&blur=50);
22-
background-size: cover;
23-
font-family: 'helvetica neue';
24-
text-align: center;
25-
font-size: 10px;
26-
}
27-
28-
body {
29-
margin: 0;
30-
font-size: 2rem;
31-
display: flex;
32-
flex: 1;
33-
min-height: 100vh;
34-
align-items: center;
35-
}
36-
37-
.clock {
38-
width: 30rem;
39-
height: 30rem;
40-
border: 20px solid white;
41-
border-radius: 50%;
42-
margin: 50px auto;
43-
position: relative;
44-
padding: 2rem;
45-
box-shadow:
46-
0 0 0 4px rgba(0,0,0,0.1),
47-
inset 0 0 0 3px #EFEFEF,
48-
inset 0 0 10px black,
49-
0 0 10px rgba(0,0,0,0.2);
50-
}
51-
52-
.clock-face {
53-
position: relative;
54-
width: 100%;
55-
height: 100%;
56-
transform: translateY(-3px); /* account for the height of the clock hands */
57-
}
58-
59-
.hand {
60-
width: 50%;
61-
height: 6px;
62-
background: black;
63-
position: absolute;
64-
top: 50%;
65-
}
25+
body {
26+
margin: 0;
27+
font-size: 2rem;
28+
display: flex;
29+
flex: 1;
30+
min-height: 100vh;
31+
align-items: center;
32+
}
6633

67-
</style>
34+
.clock {
35+
width: 30rem;
36+
height: 30rem;
37+
border: 20px solid white;
38+
border-radius: 50%;
39+
margin: 50px auto;
40+
position: relative;
41+
padding: 2rem;
42+
box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.1), inset 0 0 0 3px #efefef,
43+
inset 0 0 10px black, 0 0 10px rgba(0, 0, 0, 0.2);
44+
}
6845

69-
<script>
46+
.clock-face {
47+
position: relative;
48+
width: 100%;
49+
height: 100%;
50+
transform: translateY(
51+
-3px
52+
); /* account for the height of the clock hands */
53+
}
7054

55+
.hand {
56+
width: 50%;
57+
height: 6px;
58+
background: black;
59+
position: absolute;
60+
top: 50%;
61+
}
62+
</style>
7163

72-
</script>
73-
</body>
64+
<script></script>
65+
</body>
7466
</html>

0 commit comments

Comments
 (0)