summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2021-10-05 00:14:08 +0300
committerYuval Adam <_@yuv.al>2021-10-05 00:14:08 +0300
commit16d56899cf5c690bbb242da8a5fdeba8723a548e (patch)
tree31be1fa3ba7eb19f9e084ef4ffc8864d5a7c0539
parente074eb7614f6dd789e91d3de7635242e55f7dd79 (diff)
Initial counter:
-rw-r--r--index.html30
1 files changed, 29 insertions, 1 deletions
diff --git a/index.html b/index.html
index 4ad0eb0..0057db0 100644
--- a/index.html
+++ b/index.html
@@ -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>