diff options
| author | s1n <[email protected]> | 2019-10-20 21:22:49 -0700 |
|---|---|---|
| committer | s1n <[email protected]> | 2019-10-20 21:22:49 -0700 |
| commit | 0ee0d9837e18c8579badff54586b1b383548b6c6 (patch) | |
| tree | 4f10ce2a45382979b4eab13d91542fff17338bbf | |
| parent | replace motd (diff) | |
| download | p.s1n.pw-admin-0ee0d9837e18c8579badff54586b1b383548b6c6.tar.xz p.s1n.pw-admin-0ee0d9837e18c8579badff54586b1b383548b6c6.zip | |
add clock as motd
| -rw-r--r-- | css/style.css | 4 | ||||
| -rw-r--r-- | index.html | 30 |
2 files changed, 30 insertions, 4 deletions
diff --git a/css/style.css b/css/style.css index 8aeacf8..6358fd0 100644 --- a/css/style.css +++ b/css/style.css @@ -43,7 +43,7 @@ html, body { width: 0; } to { - width: 10.5em; + width: 11.5em; } } @@ -53,7 +53,7 @@ html, body { width: 0; } to { - width: 9.5em; + width: 10.5em; } } } @@ -33,7 +33,7 @@ <link rel="shortcut icon" href="/assets/superthumb.jpg" type="image/jpg"> </head> -<body> +<body onload="startTime()"> <div class="wrapper"> <!--------------- navbar starts here ---------------> @@ -74,7 +74,33 @@ <!--------------- hero section starts here ---------------> <div class="hero"> <div class="header"> - <h1 class="line anim-typewriter">I make it happen.</h1> + <script> + function startTime() { + var today = new Date(); + var h = today.getHours(); + var m = today.getMinutes(); + var s = today.getSeconds(); + m = checkTime(m); + s = checkTime(s); + document.getElementById('txt').innerHTML = + h + ":" + m + ":" + s; + var t = setTimeout(startTime, 500); + } + function checkTime(i) { + if (i < 10) { i = "0" + i }; // add zero in front of numbers < 10 + return i; + } + </script> + <h1 class="line anim-typewriter"><script> + var today = new Date(); + var dd = String(today.getDate()).padStart(2, '0'); + var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0! + var yyyy = today.getFullYear(); + // var time = today.getHours() + ":" + today.getMinutes(); + + today = mm + '/' + dd + '/' + yyyy + " "; + document.write(today); + </script><span id="txt"></span></h1> </div> </div> |