summaryrefslogtreecommitdiff
path: root/includes/components/timeline.inc
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2024-03-30 23:40:33 +0100
committerRaindropsSys <raindrops@equestria.dev>2024-03-30 23:40:33 +0100
commit6b796258d413f00e498ce7f80f73a9f6c061f29c (patch)
tree49e64a5dd4cde2acff7f0a93ed3f8e20e1cb2dc8 /includes/components/timeline.inc
parent5860551daa0f60103ad24e93da29f401a653f144 (diff)
downloadpluralconnect-6b796258d413f00e498ce7f80f73a9f6c061f29c.tar.gz
pluralconnect-6b796258d413f00e498ce7f80f73a9f6c061f29c.tar.bz2
pluralconnect-6b796258d413f00e498ce7f80f73a9f6c061f29c.zip
Updated 5 files, added 2 files, deleted 495 files and renamed 7 files (automated)
Diffstat (limited to 'includes/components/timeline.inc')
-rw-r--r--includes/components/timeline.inc119
1 files changed, 0 insertions, 119 deletions
diff --git a/includes/components/timeline.inc b/includes/components/timeline.inc
deleted file mode 100644
index 21e82a2..0000000
--- a/includes/components/timeline.inc
+++ /dev/null
@@ -1,119 +0,0 @@
-<?php
-
-
-function displayTimeline($systems) { global $app; $showIcons = count($systems) > 1; ?>
- <table style="margin-top: 10px; width: 100%; margin-bottom: 10px;table-layout:fixed;">
- <thead>
- <tr class="row-desktop">
- <?php if ($showIcons): ?><th colspan="20"></th><?php endif; ?>
- <th class="dynamic-time timeline-indicator" data-time="<?= time() - 3600 * 6 ?>" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);"><?= date('H:i', time() - 3600 * 6) ?></th>
- <th class="dynamic-time timeline-indicator" data-time="<?= time() - 3600 * 5 ?>" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);"><?= date('H:i', time() - 3600 * 5) ?></th>
- <th class="dynamic-time timeline-indicator" data-time="<?= time() - 3600 * 4 ?>" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);"><?= date('H:i', time() - 3600 * 4) ?></th>
- <th class="dynamic-time timeline-indicator" data-time="<?= time() - 3600 * 3 ?>" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);"><?= date('H:i', time() - 3600 * 3) ?></th>
- <th class="dynamic-time timeline-indicator" data-time="<?= time() - 3600 * 2 ?>" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);"><?= date('H:i', time() - 3600 * 2) ?></th>
- <th class="dynamic-time timeline-indicator" data-time="<?= time() - 3600 * 1 ?>" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);"><?= date('H:i', time() - 3600 * 1) ?></th>
- <th class="dynamic-time timeline-indicator" data-time="<?= time() ?>" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);"><?= date('H:i', time()) ?></th>
- </tr>
- <tr class="row-mobile">
- <?php if ($showIcons): ?><th colspan="20"></th><?php endif; ?>
- <th class="dynamic-time-mobile timeline-indicator" data-time="<?= time() - 3600 * 6 ?>" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);"><?= date('H:', time() - 3600 * 6) ?></th>
- <th class="dynamic-time-mobile timeline-indicator" data-time="<?= time() - 3600 * 5 ?>" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);"><?= date('H:', time() - 3600 * 5) ?></th>
- <th class="dynamic-time-mobile timeline-indicator" data-time="<?= time() - 3600 * 4 ?>" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);"><?= date('H:', time() - 3600 * 4) ?></th>
- <th class="dynamic-time-mobile timeline-indicator" data-time="<?= time() - 3600 * 3 ?>" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);"><?= date('H:', time() - 3600 * 3) ?></th>
- <th class="dynamic-time-mobile timeline-indicator" data-time="<?= time() - 3600 * 2 ?>" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);"><?= date('H:', time() - 3600 * 2) ?></th>
- <th class="dynamic-time-mobile timeline-indicator" data-time="<?= time() - 3600 * 1 ?>" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);"><?= date('H:', time() - 3600 * 1) ?></th>
- <th class="dynamic-time-mobile timeline-indicator" data-time="<?= time() ?>" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);"><?= date('H:', time()) ?></th>
- </tr>
- </thead>
- <tbody>
- <?php foreach ($systems as $system): ?>
- <tr style="height: <?= count($systems) === 1 ? 50 : 30 ?>px;">
- <?php if ($showIcons): ?><td colspan="20">
- <a href="/<?= $system === "gdapd" ? "raindrops" : ($system === "hrbom" ? "moonglow" : $app["other"]["slug"]) ?>" style="width: 100%; height: 30px; display: flex; align-items: center; justify-content: center;">
- <img alt="" style="border-radius: 5px; height: 24px; text-align: center;" src="<?= getAsset($system) ?>">
- </a>
- </td><?php endif; ?>
- <?php
-
- $leftCols = 420;
-
- $time = time() - 3600 * 7;
- $switches = [
- ...array_reverse(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json"), true)),
- [
- 'id' => '00000000-0000-0000-0000-000000000000',
- 'timestamp' => date('c', time() + 3600),
- 'members' => []
- ]
- ];
-
- foreach ($switches as $index => $switch) {
- if (strtotime($switch["timestamp"]) >= $time) {
- $correct = $switches[$index - 1] ?? [
- "members" => [],
- "timestamp" => date('c', 0)
- ];
- $v = floor((strtotime($switch["timestamp"]) - $time) / 60);
-
- if (count($correct["members"]) > 0) {
- echo('<td style="max-width: 100%; overflow: hidden; text-align: left; white-space: nowrap; padding: 0 15px; height: ' . 50 / count($systems) . 'px; background-color: #' . (getMemberWithoutSystem($correct["members"][0])["color"] ?? "000000") . '80;" colspan="' . ($v > $leftCols ? $leftCols : $v) . '"><a style="color: white; cursor: pointer; text-decoration: none; width: 100%; display: flex; height: ' . 50 / count($systems) . 'px; align-items: center; justify-content: left;" href="/' . getMemberWithoutSystem($correct["members"][0])["name"] . '">' . implode(", ", array_map(function ($i) {
- return getMemberWithoutSystem($i)["display_name"] ?? getMemberWithoutSystem($i)["name"] ?? $i;
- }, $correct["members"])) . '</a></td>');
- } else {
- echo('<td style="max-width: 100%; overflow: hidden; text-align: left; white-space: nowrap; padding: 0 15px; height: ' . 50 / count($systems) . 'px; background-color: transparent;" colspan="' . ($v > $leftCols ? $leftCols : $v) . '"></td>');
- }
-
- $leftCols -= $v; if ($leftCols < 0) $leftCols = 0;
- $time = strtotime($switch["timestamp"]);
- }
- }
-
- ?>
- </tr>
- <?php endforeach; ?>
- <tr class="row-desktop">
- <?php if ($showIcons): ?><td colspan="20"></td><?php endif; ?>
- <td class="timeline-indicator" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);">6 hours ago</td>
- <td class="timeline-indicator" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);">5 hours ago</td>
- <td class="timeline-indicator" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);">4 hours ago</td>
- <td class="timeline-indicator" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);">3 hours ago</td>
- <td class="timeline-indicator" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);">2 hours ago</td>
- <td class="timeline-indicator" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);">1 hour ago</td>
- <td class="timeline-indicator" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);">Now</td>
- </tr>
- <tr class="row-mobile">
- <?php if ($showIcons): ?><td colspan="20"></td><?php endif; ?>
- <td class="timeline-indicator" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);">-6h</td>
- <td class="timeline-indicator" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);">-5h</td>
- <td class="timeline-indicator" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);">-4h</td>
- <td class="timeline-indicator" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);">-3h</td>
- <td class="timeline-indicator" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);">-2h</td>
- <td class="timeline-indicator" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);">-1h</td>
- <td class="timeline-indicator" colspan="60" style="text-align: right; padding-right: 10px; border-right: 1px solid rgba(255, 255, 255, 0.5);">Now</td>
- </tr>
- <tr>
- <?php for ($i = 0; $i < 420; $i++): ?><td></td><?php endfor; ?>
- </tr>
- </tbody>
- </table>
-
- <style>
- .row-mobile {
- display: none !important;
- }
-
- .row-desktop {
- display: table-row !important;
- }
-
- @media (max-width: 991px) {
- .row-desktop {
- display: none !important;
- }
-
- .row-mobile {
- display: table-row !important;
- }
- }
- </style>
-<?php } \ No newline at end of file