Skip to content

Commit 583cfac

Browse files
committed
Build JS for 02-Clock
1 parent 88a5e68 commit 583cfac

File tree

5 files changed

+3384
-0
lines changed

5 files changed

+3384
-0
lines changed

02 - JS and CSS Clock/index.html

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>JS + CSS Clock</title>
6+
</head>
7+
<body>
8+
9+
10+
<div class="clock">
11+
<div class="clock-face">
12+
<div class="hand hour-hand"></div>
13+
<div class="hand min-hand"></div>
14+
<div class="hand second-hand"></div>
15+
</div>
16+
</div>
17+
18+
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+
position: absolute;
63+
background: black;
64+
top: 50%;
65+
transform: rotateZ(-110deg);
66+
transform-origin: calc(100% - 3px) calc(100% - 3px);
67+
border-radius: 6px;
68+
transition: transform 0.3s cubic-bezier(0,1.38,.19,1.04);
69+
}
70+
71+
</style>
72+
73+
<script src="script.js"></script>
74+
</body>
75+
</html>

0 commit comments

Comments
 (0)