-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclock.css
100 lines (92 loc) · 2.08 KB
/
clock.css
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
body{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
overflow: hidden;
background:linear-gradient(to right,rgb(136, 162, 239),rgb(69, 209, 247));
}
.clock{
width:300px;
height:300px;
background-color: rgb(255,255,255,.8);
border-radius: 50%;
border: 2px solid green;
position: absolute;
}
.clock::after{
content: '';
position: absolute;
background-color: blue;
z-index: 11;
width: 15px;height: 15px;
top: 50%;left: 50%;
transform: translate(-50%, -50%);
border-radius: 50%;
}
.clock .number{
--rotation:0;
position: absolute;
width: 100%;
height: 100%;
text-align: center;
transform: rotate(var(--ratation));
font-size: 1.5rem;
}
.clock .number1{--ratation:30deg;}
.clock .number2{--ratation:60deg;}
.clock .number3{--ratation:90deg;}
.clock .number4{--ratation:120deg;}
.clock .number5{--ratation:150deg;}
.clock .number6{--ratation:180deg;}
.clock .number7{--ratation:210deg;}
.clock .number8{--ratation:240deg;}
.clock .number9{--ratation:270deg;}
.clock .number10{--ratation:300deg;}
.clock .number11{--ratation:330deg;}
.clock .hand{
position: absolute;
bottom: 50%;
left: 50%;
background-color: black;
border: 1px solid yellow;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
transform-origin: bottom;
transform:translateX(-50%) rotate(calc(var(--rotation) * 1deg));
z-index: 10;
}
.clock .hand.second{
width: 5px;
height: 45%;
color: red;
background-color: green;
}
.clock .hand.minutes{
width: 7px;
height: 40%;
color:blue;
background-color:orange;
}
.clock .hand.hour{
width: 9px;
height: 35%;
color: black;
background-color: red;
}
p{
font-family: 'Times New Roman';
font-size: 8vh;
text-shadow: 8px magenta;
margin-bottom: auto;
margin-right: 20px;
text-align: left;
position: relative;
}
#digital-clock{
font-size: 8vh;
text-align: right;
background-color: maroon;
margin-bottom: -400px;
position: absolute;
}