File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {
2+ "liveServer.settings.port" : 5501
3+ }
Original file line number Diff line number Diff line change 1+
2+ html {
3+ background-size : cover;
4+ font-family : 'helvetica neue' ;
5+ text-align : center;
6+ font-size : 10px ;
7+ }
8+
9+ body {
10+ margin : 0 ;
11+ font-size : 2rem ;
12+ flex : 1 ;
13+ min-height : 100vh ;
14+ align-items : center;
15+ }
16+
17+ .clock {
18+ position : relative;
19+ margin : auto;
20+ height : 30vw ;
21+ width : 30vw ;
22+ background : url (clock.png) no-repeat;
23+ background-size : 100% ;
24+ }
25+
26+ # hour , # minute , # second {
27+ position : absolute;
28+ background : black;
29+ border-radius : 10px ;
30+ transform-origin : bottom;
31+ }
32+
33+ # hour {
34+ width : 1.8% ;
35+ height : 25% ;
36+ top : 25% ;
37+ left : 48.85% ;
38+ opacity : 0.8 ;
39+ }
40+ # minute {
41+ width : 1.6% ;
42+ height : 30% ;
43+ top : 19% ;
44+ left : 48.9% ;
45+ opacity : 0.8 ;
46+ }
47+ # second {
48+ width : 1% ;
49+ height : 40% ;
50+ top : 9% ;
51+ left : 49.25% ;
52+ opacity : 0.8 ;
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+
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7+ < title > clock</ title >
8+ < link rel ="stylesheet " href ="index.css ">
9+ </ head >
10+ < body >
11+ < h1 class ="heading "> The Time</ h1 >
12+ < div class ="clock ">
13+ < div id ="hour "> </ div >
14+ < div id ="minute "> </ div >
15+ < div id ="second "> </ div >
16+ </ div >
17+ </ body >
18+ < script src ="index.js "> </ script >
19+ </ html >
Original file line number Diff line number Diff line change 1+ setInterval ( ( ) => {
2+ d = new Date ( ) ;
3+ htime = d . getHours ( ) ;
4+ mtime = d . getMinutes ( ) ;
5+ stime = d . getSeconds ( ) ;
6+ hrotation = 30 * htime + mtime / 2 ;
7+ mrotation = 6 * mtime ;
8+ srotation = 6 * stime ;
9+
10+ hour . style . transform = `rotate(${ hrotation } deg)` ;
11+ minute . style . transform = `rotate(${ mrotation } deg)` ;
12+ second . style . transform = `rotate(${ srotation } deg)` ;
13+ } , 1000 ) ;
You can’t perform that action at this time.
0 commit comments