File tree Expand file tree Collapse file tree 6 files changed +41
-0
lines changed Expand file tree Collapse file tree 6 files changed +41
-0
lines changed File renamed without changes.
File renamed without changes.
File renamed without changes.
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 name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6+ < title > Digital Clock</ title >
7+ < link rel ="stylesheet " href ="style.css ">
8+ < script src ="script.js " defer > </ script >
9+ </ head >
10+ < body >
11+ < div id ="clock-container "> </ div >
12+ </ body >
13+ </ html >
Original file line number Diff line number Diff line change 1+ const clockContainer = document . getElementById ( 'clock-container' ) ;
2+
3+ function updateTime ( ) {
4+ const currentTime = new Date ( ) . toLocaleTimeString ( ) ;
5+
6+ clockContainer . innerText = currentTime ;
7+ }
8+
9+ setInterval ( updateTime , 1000 ) ;
Original file line number Diff line number Diff line change 1+ * {
2+ margin : 0 ;
3+ padding : 0 ;
4+ }
5+
6+ body {
7+ background-color : black;
8+ color : white;
9+ }
10+
11+ # clock-container {
12+ display : flex;
13+ justify-content : center;
14+ align-items : center;
15+ width : 100vw ;
16+ height : 100vh ;
17+ font-size : 4rem ;
18+ font-weight : bold;
19+ }
You can’t perform that action at this time.
0 commit comments