Browse Source

Attempting to make a statically served continuously updating page

Kirk Trombley 6 years ago
parent
commit
f39f6c1e8f
1 changed files with 34 additions and 0 deletions
  1. 34 0
      staticpage.html

+ 34 - 0
staticpage.html

@@ -0,0 +1,34 @@
+<!doctype html>
+<title>Teamspeak Server Status</title>
+<style>
+    body {
+        margin: 0px 0px 0px 0px;
+        padding: 0px 0px 0px 0px;
+        font-family: verdana, arial, helvetica, sans-serif;
+        color: #ccc;
+        background-color: #333;
+    }
+    h1 {
+        font-size: 24px;
+        line-height: 44px;
+        font-weight: bold;
+        margin-top: 0;
+        margin-bottom: 0;
+    }
+</style>
+<!-- <marquee direction="up" style="height 600px" behavior="alternate"> -->
+    <!-- <marquee direction="right" style="width 600px" behavior="alternate"> -->
+        <div class="page">
+            <h1>TeamSpeak Server Status</h1>
+            <span id="target"/>
+        </div>
+    <!-- </marquee> -->
+<!-- </marquee> -->
+<script type="text/javascript">
+    const update = async () => {
+        const data = await fetch("https://kirkleon.ddns.net/teamspeak/api");
+        document.getElementById("target").textContent = JSON.stringify(data);
+    }
+    await update();
+    setInterval(update, 5);
+</script>