summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
Diffstat (limited to 'pages')
-rw-r--r--pages/api/timeline.php12
-rw-r--r--pages/home.inc23
2 files changed, 34 insertions, 1 deletions
diff --git a/pages/api/timeline.php b/pages/api/timeline.php
new file mode 100644
index 0000000..392d5de
--- /dev/null
+++ b/pages/api/timeline.php
@@ -0,0 +1,12 @@
+<?php
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc"; global $app;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn; global $_PROFILE;
+
+$systems = array_filter(array_keys($_GET), function ($i) {
+ global $isLowerLoggedIn; global $isLoggedIn; global $app;
+ return $i === "gdapd" || $i === "ynmuc" || (($isLowerLoggedIn || $isLoggedIn) && $i === $app["other"]["id"]);
+});
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/timeline.inc";
+displayTimeline($systems); \ No newline at end of file
diff --git a/pages/home.inc b/pages/home.inc
index 62474d3..6e2c073 100644
--- a/pages/home.inc
+++ b/pages/home.inc
@@ -17,7 +17,7 @@ function banner() { global $isLoggedIn; global $isLowerLoggedIn; $byColor = getM
<span style="display: inline-block;background: transparent;position:absolute;width: 0;height: 0;margin-top: 17px;box-shadow: 0 6px 20px 20px #<?= $member["color"] ?>;z-index: 9;margin-left: 8px;opacity: .75;"></span>
</div><?php endforeach; ?>
</div>
- <div style="padding:5px 10px;background:#3332328a;border-bottom-left-radius: 10px;border-bottom-right-radius: 10px;position:relative;z-index: 999;backdrop-filter: blur(30px);">
+ <div style="padding:5px 10px;background:#3332328a;position:relative;z-index: 999;backdrop-filter: blur(30px);">
<h2 style="margin-top: 20px;">Cold Haze</h2>
<?php if ($isLoggedIn || $isLowerLoggedIn): ?>
<p><?= count($byColor) ?> ponies in 3 plural systems</p>
@@ -156,6 +156,27 @@ function members() { global $isLoggedIn; global $isLowerLoggedIn; global $app; ?
}
?>
+ <div style="background: #3332328a;padding: 5px 10px;border-top:1px solid rgba(255,255,255,.1);border-bottom-left-radius: 10px;border-bottom-right-radius: 10px;">
+ <div id="timeline"></div>
+ <script>
+ async function refreshTimeline() {
+ document.getElementById("timeline").innerHTML = await (await fetch("/api/timeline?gdapd&ynmuc<?= ($isLowerLoggedIn || $isLoggedIn) ? "&" . $app["other"]["id"] : "" ?>")).text();
+
+ Array.from(document.getElementsByClassName("dynamic-time")).forEach((el) => {
+ let time = el.getAttribute("data-time");
+ el.innerText = new Date(parseInt(time) * 1000).toTimeString().split(":").splice(0, 2).join(":");
+ });
+
+ Array.from(document.getElementsByClassName("dynamic-time-mobile")).forEach((el) => {
+ let time = el.getAttribute("data-time");
+ el.innerText = new Date(parseInt(time) * 1000).toTimeString().split(":")[0] + ":";
+ });
+ }
+
+ setInterval(refreshTimeline, 10000);
+ refreshTimeline();
+ </script>
+ </div>
<!--<div class="alert alert-warning" style="margin-top:20px;">
<b>Notice:</b> The administrators are currently trying a new optimisation technique based on a virtual file system (chvfs). Data loss, corruption or inconsistency may happen and should be reported on <a href="https://bugs.equestria.dev/issues/CH" target="_blank">bugs.equestria.dev</a>.