File tree Expand file tree Collapse file tree 3 files changed +88
-0
lines changed Expand file tree Collapse file tree 3 files changed +88
-0
lines changed Original file line number Diff line number Diff line change 1+ const monthEl = document . getElementById ( "month" ) ;
2+ const dayNameEl = document . getElementById ( "day" ) ;
3+ const dayNumEl = document . getElementById ( "day-number" ) ;
4+ const yearEl = document . getElementById ( "year" ) ;
5+
6+ const date = new Date ( ) ;
7+
8+ const month = date . getMonth ( ) ;
9+
10+ monthEl . innerHTML = date . toLocaleDateString ( "en" , {
11+ month : "long" ,
12+ } ) ;
13+
14+ dayNameEl . innerHTML = date . toLocaleDateString ( "en" , {
15+ weekday : "long" ,
16+ } ) ;
17+
18+ dayNumEl . innerHTML = date . getDate ( ) ;
19+ yearEl . innerHTML = date . getFullYear ( ) ;
Original file line number Diff line number Diff line change 1+ < html lang ="en ">
2+ < head >
3+ < meta charset ="UTF-8 " />
4+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge " />
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6+ < title > Mini Calendar</ title >
7+ < link rel ="stylesheet " href ="style.css " />
8+ </ head >
9+ < body >
10+ < div class ="calendar ">
11+ < p class ="month " id ="month "> April</ p >
12+ < p class ="day " id ="day "> Sunday</ p >
13+ < p class ="day-number " id ="day-number "> 12</ p >
14+ < p class ="year " id ="year "> 2021</ p >
15+ </ div >
16+
17+ < script src ="app.js "> </ script >
18+ </ body >
19+ </ html >
Original file line number Diff line number Diff line change 1+ * {
2+ margin : 0 ;
3+ padding : 0 ;
4+ box-sizing : border-box;
5+ font-family : sans-serif;
6+ }
7+
8+ body {
9+ height : 100vh ;
10+ display : flex;
11+ justify-content : center;
12+ align-items : center;
13+ background-color : cyan;
14+ }
15+
16+ .calendar {
17+ background-color : white;
18+ width : 40% ;
19+ text-align : center;
20+ border-radius : 10px ;
21+ box-shadow : 0 4px 8px rgba (0 , 0 , 0 , 0.3 );
22+ overflow : hidden;
23+ }
24+
25+ .month {
26+ margin : 0 ;
27+ background-color : blue;
28+ color : # fff ;
29+ font-weight : bold;
30+ padding : 10px ;
31+ margin-bottom : 10px ;
32+ }
33+
34+ .day {
35+ font-size : 20px ;
36+ color : darkgray;
37+ }
38+
39+ .day-number {
40+ font-size : 80px ;
41+ margin : 0 ;
42+ font-weight : bold;
43+ }
44+
45+ .year {
46+ margin : 20px 0 ;
47+ font-size : 20px ;
48+ color : darkgray;
49+ font-weight : 500 ;
50+ }
You can’t perform that action at this time.
0 commit comments