-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclock.css
More file actions
200 lines (186 loc) · 5.24 KB
/
clock.css
File metadata and controls
200 lines (186 loc) · 5.24 KB
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/*
developed by Anubhav Gupta
https://github.com/anubhavgupta/PurceCSSClock
contact: anubhav200@gmail.com
*/
div, body, html {
padding: 0;
border: none;
margin: 0;
outline: 0;
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
flex-direction: column;
}
.clock-container{
width: 400px;
height: 400px;
}
.clock {
background-color: #023A02;
width: 100%;
height: 100%;
border-radius: 100%;
position: relative;
box-shadow: 0 0 10px #333;
}
.outer-rim {
border: 10px dotted yellowgreen;
width: 99%;
height: 99%;
border-radius: 100%;
box-shadow: 0 0 65px -6px inset;
left: 2px;
position: absolute;
top: 2px;
border-style: double;
}
.numbers {
font-size: 60px;
color: yellow;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
font-family: sans-serif;
letter-spacing: -4px;
font-weight: lighter;
z-index: 0;
text-shadow: 0 0 7px black;
}
.clock-num{
position: relative;
}
.clock-num.top {
left: 43%;
top: 2%;
}
.clock-num.right {
left: 85%;
top: 22%;
}
.clock-num.bottom {
left: 44%;
top: 47%;
}
.clock-num.left {
left: 4%;
top: -13%;
}
/*CENTER PIN*/
.center-pin {
width: 5%;
height: 5%;
background: #B50101;
border-radius: 100%;
position: absolute;
left: 47.5%;
top: 47.5%;
z-index: 1;
box-shadow: inset 0 0 30px -10px black;
}
/*NEEDLES*/
.needle-hr {
width: 8px;
height: 30%;
background: white;
position: absolute;
left: calc(50% - 4px);
transform-origin: center bottom;
transform: rotateZ(0deg);
top: 20%;
animation: time 43200s infinite steps(60);
box-shadow: 0 0 7px;
}
.needle-hr:after {
content: "";
width: 1px;
height: 1px;
position: absolute;
border-right: 3px solid transparent;
border-bottom: 13px solid white;
border-left: 4px solid transparent;
top: -14px;
left: 0px;
}
.needle-min {
width: 8px;
height: 40%;
background: white;
position: absolute;
left: calc(50% - 4px);
transform-origin: center bottom;
transform: rotateZ(0deg);
top: 10%;
animation: time 3600s infinite steps(60);
box-shadow: 0 0 7px;
}
.needle-min:after {
content: "";
border-right: 4px solid transparent;
position: absolute;
height: 1px;
width: 1px;
border-bottom: 14px solid white;
border-left: 3px solid transparent;
top: -14px;
left: 0px;
}
.needle-sec,.needle-hr-24,.needle-mil-sec {
width: 2px;
height: 53%;
background: #B50101;
position: absolute;
left: calc(50% - 1px);
transform-origin: 50% 85%;
transform: rotateZ(0deg);
top: 5%;
animation: time 60s infinite steps(60);
box-shadow: 0 0 10px -3px black;
}
.needle-hr-24 {
animation: time 86400s infinite steps(24);
}
.needle-mil-sec{
animation: time 1s infinite linear;
}
/*SMALL VERSION*/
.clock.small{
width: 20%;
height: 20%;
background-color: white;
box-shadow: inset 0 0 16px yellowgreen;
}
.clock.small.small-btm {
left: 41%;
top: 59%;
}
.clock.small.small-right {
left: 62%;
top: 18%;
}
.clock.small.small-left {
left: 18%;
top: -2%;
}
.clock.small > .numbers {
font-size: 12px;
color: black;
letter-spacing: -2px;
}
body div > a {
margin-top: 40px;
display: inline-block;
}
/*KEYFRAMES*/
@keyframes time {
100%{
transform: rotateZ(360deg);
}
}