1+ * , * ::after , * ::before {
2+ box-sizing : border-box;
3+ font-family : Gotham Rounded, sans-serif;
4+
5+ }
6+
7+ body {
8+ background : linear-gradient (to right, hsl (200 , 100% , 50% ), hsl (175 , 100% , 50% ));
9+ display : flex;
10+ justify-content : center;
11+ align-items : center;
12+ min-height : 100vh ;
13+ overflow : hidden;
14+
15+ }
16+
17+ .clock {
18+ width : 300px ;
19+ height : 300px ;
20+ background-color : rgba (255 , 255 , 255 , 0.8 );
21+ border-radius : 50% ;
22+ border : 2px solid black;
23+ position : relative;
24+
25+ }
26+
27+ .clock .number {
28+ --rotation : 0 ;
29+ position : absolute;
30+ width : 100% ;
31+ height : 100% ;
32+ text-align : center;
33+ transform : rotate (var (--rotation ));
34+ font-size : 1.5rem ;
35+
36+ }
37+
38+ .clock .number1 {--rotation : 30deg ;}
39+ .clock .number2 {--rotation : 60deg ;}
40+ .clock .number3 {--rotation : 90deg ;}
41+ .clock .number4 {--rotation : 120deg ;}
42+ .clock .number5 {--rotation : 150deg ;}
43+ .clock .number6 {--rotation : 180deg ;}
44+ .clock .number7 {--rotation : 210deg ;}
45+ .clock .number8 {--rotation : 240deg ;}
46+ .clock .number9 {--rotation : 270deg ;}
47+ .clock .number10 {--rotation : 300deg ;}
48+ .clock .number11 {--rotation : 330deg ;}
49+
50+ .clock .hand {
51+ --rotation : 0 ;
52+ position : absolute;
53+ bottom : 50% ;
54+ left : 50% ;
55+ width : 10px ;
56+ height : 50% ;
57+ background-color : black;
58+ border : 1px solid white;
59+ border-top-left-radius : 10px ;
60+ border-top-right-radius : 10px ;
61+ transform-origin : bottom;
62+ z-index : 10 ;
63+ transform : translateX (-50% ) rotate ( calc (var (--rotation )* 1deg ));
64+
65+ }
66+
67+
68+ .clock ::after {
69+ content : '' ;
70+ position : absolute;
71+ background-color : black;
72+ z-index : 11 ;
73+ width : 15px ;
74+ height : 15px ;
75+ top : 50% ;
76+ left : 50% ;
77+ transform : translate (-50% , -50% );
78+ border-radius : 50% ;
79+
80+ }
81+
82+ .clock .hand .second {
83+ width : 3px ;
84+ height : 45% ;
85+ background-color : red;
86+
87+ }
88+
89+ .clock .hand .minute {
90+ width : 7px ;
91+ height : 40% ;
92+ background-color : black;
93+
94+ }
95+
96+ .clock .hand .hour {
97+ width : 10px ;
98+ height : 35% ;
99+ background-color : black;
100+ }
0 commit comments