-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelogio.css
120 lines (110 loc) · 1.98 KB
/
relogio.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
* {
box-sizing: border-box;
padding: 0;
margin: 0;
font-family: "Poppins", sans-serif;
}
body {
background-image: linear-gradient(
43deg,
#4158d0 0%,
#c450c0 46%,
#ffcc70 100%
);
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.relogio {
width: 500px;
height: 500px;
background-color: rgba(255, 255, 255, 0.8);
border-radius: 50%;
border: 2px solid black;
position: relative;
}
.relogio .number {
--rotation: 0;
position: absolute;
width: 100%;
height: 100%;
text-align: center;
transform: rotate(var(--rotation));
font-size: 1.8rem;
font-weight: 500;
padding: 15px;
}
.relogio .number.number-1 {
--rotation: 30deg;
}
.relogio .number.number-2 {
--rotation: 60deg;
}
.relogio .number.number-3 {
--rotation: 90deg;
}
.relogio .number.number-4 {
--rotation: 120deg;
}
.relogio .number.number-5 {
--rotation: 150deg;
}
.relogio .number.number-6 {
--rotation: 180deg;
}
.relogio .number.number-7 {
--rotation: 210deg;
}
.relogio .number.number-8 {
--rotation: 240deg;
}
.relogio .number.number-9 {
--rotation: 270deg;
}
.relogio .number.number-10 {
--rotation: 300deg;
}
.relogio .number.number-11 {
--rotation: 330deg;
}
/* Ponteiros */
.relogio::after {
content: "";
position: absolute;
width: 10px;
height: 10px;
border-radius: 50%;
top: 50%;
left: 50%;
z-index: 11;
background-color: black;
transform: translate(-50%, -50%);
}
.relogio .ponteiros {
--rotation: 0;
position: absolute;
bottom: 50%;
left: 50%;
background-color: black;
z-index: 10;
transform: translateX(-50%) rotate(calc(var(--rotation) * 1deg));
transform-origin: bottom;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.relogio .ponteiros.segundos {
width: 3px;
height: 40%;
background-color: red;
}
.relogio .ponteiros.minutos {
width: 7px;
height: 35%;
background-color: black;
}
.relogio .ponteiros.horas {
width: 10px;
height: 25%;
background-color: black;
}