File tree 3 files changed +51
-0
lines changed
3 files changed +51
-0
lines changed 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
+ < title > Javascript Digital Clock</ title >
6
+ < link rel ="stylesheet " href ="style.css ">
7
+ </ head >
8
+ < body >
9
+ < div class ="container ">
10
+ jjj
11
+ </ div >
12
+ < script src ="script.js "> </ script >
13
+ </ body >
14
+ </ html >
Original file line number Diff line number Diff line change
1
+ ( function ( ) {
2
+ function addZeroBefore ( v ) {
3
+ return + v < 10 ? "0" + + v : v ;
4
+ }
5
+
6
+ function showTime ( ) {
7
+
8
+ var today = new Date ( ) ;
9
+ var textTime = addZeroBefore ( today . getHours ( ) ) + " : " + addZeroBefore ( today . getMinutes ( ) ) + " : " + addZeroBefore ( today . getSeconds ( ) ) ;
10
+
11
+ document . getElementById ( "time" ) . innerHTML = textTime ;
12
+
13
+ setTimeout ( function ( ) {
14
+ showTime ( )
15
+ } , 1000 ) ;
16
+ }
17
+
18
+ showTime ( ) ;
19
+ } ) ( ) ;
Original file line number Diff line number Diff line change
1
+ * {
2
+ padding : 0 ;
3
+ margin : 0 ;
4
+ }
5
+
6
+
7
+ .container {
8
+ background-color : # 3030bb ;
9
+ height : 100vh ;
10
+ padding : 30px 40px ;
11
+ display : flex;
12
+ font-size : 10em ;
13
+ justify-content : center;
14
+ align-items : center;
15
+ color : whitesmoke;
16
+ font-family : courier;
17
+ }
18
+
You can’t perform that action at this time.
0 commit comments