diff options
| author | Yuval Adam <_@yuv.al> | 2021-10-05 00:14:08 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2021-10-05 00:14:08 +0300 |
| commit | 16d56899cf5c690bbb242da8a5fdeba8723a548e (patch) | |
| tree | 31be1fa3ba7eb19f9e084ef4ffc8864d5a7c0539 /index.html | |
| parent | e074eb7614f6dd789e91d3de7635242e55f7dd79 (diff) | |
Initial counter:
Diffstat (limited to 'index.html')
| -rw-r--r-- | index.html | 30 |
1 files changed, 29 insertions, 1 deletions
@@ -21,11 +21,39 @@ justify-content: center; align-items: center; } + + h1 { + display: block; + } </style> + <script src="https://code.jquery.com/jquery-3.6.0.slim.min.js" + integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI=" crossorigin="anonymous"></script> </head> <body> - <h1>Facebook Downtime</h1> + <div> + <h1>Facebook Downtime</h1> + <h2>2021 yearly uptime is <span id="ut">99.99%</span></h2> + </div> + <script type="text/javascript"> + function getDowntime() { + var d = new Date(2021, 9, 4, 16, 00, 0, 0).getTime(); + var now = new Date(); + var off = now.getTimezoneOffset() * 60000; + now = now.getTime(); + var downtime = (100 - (((now + off) - d) / 31536000000) * 100); + return (Math.round(downtime * 1000000) / 1000000).toFixed(6) + "%"; + } + + $(document).ready(function () { + update(); + }); + + function update() { + $("#ut").text(getDowntime()); + setTimeout('update()', 1000); + } + </script> </body> </html> |
