diff options
Diffstat (limited to 'includes/components')
-rw-r--r-- | includes/components/2023ui.inc | 33 | ||||
-rw-r--r-- | includes/components/emergency.inc | 156 | ||||
-rw-r--r-- | includes/components/footer.inc | 4 | ||||
-rw-r--r-- | includes/components/header.inc | 3 | ||||
-rw-r--r-- | includes/components/pleasure.inc | 201 | ||||
-rw-r--r-- | includes/components/sysbanner.inc | 4 |
6 files changed, 9 insertions, 392 deletions
diff --git a/includes/components/2023ui.inc b/includes/components/2023ui.inc index 7b74395..4c1aa5b 100644 --- a/includes/components/2023ui.inc +++ b/includes/components/2023ui.inc @@ -102,17 +102,6 @@ <span style="margin-left: 5px; vertical-align: middle; position: relative; top: -1px; font-weight: bold;">Ponycule</span> </a> </div> - <div style="display: flex; align-items: center;"> - <?php global $isLowerLoggedIn; global $isLoggedIn; global $_PROFILE; if ($isLoggedIn || $isLowerLoggedIn): ?> - <div class="mobile-icon-container mobile-icon-container-left" style="margin-left: auto; margin-right: auto;"> - <a data-bs-toggle="tooltip" data-bs-placement="bottom" title="Alerts" class="ui2023-side-bar-item mobile-hide" href="/-/alerts" style="padding: 10px; height: 48px; width: 48px; display: inline-block; border-radius: 999px;"> - <img src="<?= icon("alerts") ?>" style="max-width: 28px; max-height: 28px;"> - </a><a data-bs-toggle="tooltip" data-bs-placement="bottom" title="Member lists" class="ui2023-side-bar-item mobile-hide" href="/-/lists" style="padding: 10px; height: 48px; width: 48px; display: inline-block; border-radius: 999px;"> - <img src="<?= icon("lists") ?>" style="max-width: 28px; max-height: 28px;"> - </a> - </div> - <?php endif; ?> - </div> </div> <div style="height: 52px; display: flex; align-items: center;"> <!--<form action="/-/search" style="width: 100%;"> @@ -125,24 +114,18 @@ <div style="margin-left: auto; margin-right: auto;" class="mobile-icon-container mobile-icon-container-right"> <a data-bs-toggle="tooltip" data-bs-placement="bottom" title="Jobs" class="ui2023-side-bar-item mobile-hide" href="/-/jobs" style="padding: 10px; height: 48px; width: 48px; display: inline-block; border-radius: 999px;"> <img src="<?= icon("jobs") ?>" style="max-width: 28px; max-height: 28px;"> - </a><a data-bs-toggle="tooltip" data-bs-placement="bottom" title="Account" class="ui2023-side-bar-item mobile-hide" href="/-/account" style="padding: 10px; height: 48px; width: 48px; display: inline-block; border-radius: 999px;"> - <img src="<?= icon("sessions") ?>" style="max-width: 28px; max-height: 28px;"> + </a><a data-bs-toggle="tooltip" data-bs-placement="bottom" title="Logout" class="ui2023-side-bar-item mobile-hide" href="/-/logout" style="padding: 10px; height: 48px; width: 48px; display: inline-block; border-radius: 999px;"> + <img src="<?= icon("logout") ?>" style="max-width: 28px; max-height: 28px;"> </a><div class="ui2023-side-bar-item mobile-show dropdown" style="padding: 10px; height: 48px; width: 48px; display: none; border-radius: 999px;"> <a data-bs-toggle="dropdown" href="#"> <img src="<?= icon("menu") ?>" style="max-width: 28px; max-height: 28px;"> </a> <ul class="dropdown-menu"> - <li><a class="dropdown-item" href="/-/alerts"> - <img src="<?= icon("alerts") ?>" style="vertical-align: middle; width: 24px; height: 24px;"><span style="vertical-align: middle; margin-left: 5px;">Alerts</span> - </a></li> - <li><a class="dropdown-item" href="/-/lists"> - <img src="<?= icon("lists") ?>" style="vertical-align: middle; width: 24px; height: 24px;"><span style="vertical-align: middle; margin-left: 5px;">Lists</span> - </a></li> <li><a class="dropdown-item" href="/-/jobs"> <img src="<?= icon("jobs") ?>" style="vertical-align: middle; width: 24px; height: 24px;"><span style="vertical-align: middle; margin-left: 5px;">Jobs</span> </a></li> - <li><a class="dropdown-item" href="/-/account"> - <img src="<?= icon("sessions") ?>" style="vertical-align: middle; width: 24px; height: 24px;"><span style="vertical-align: middle; margin-left: 5px;">Account</span> + <li><a class="dropdown-item" href="/-/logout"> + <img src="<?= icon("logout") ?>" style="vertical-align: middle; width: 24px; height: 24px;"><span style="vertical-align: middle; margin-left: 5px;">Logout</span> </a></li> </ul> </div> @@ -200,11 +183,5 @@ <img class="antialias" class="antialias" src="<?= getAsset("hrbom") ?>" style="max-width: 32px; max-height: 32px;"> </a> </div> - - <div id="side-bar-options" style="margin-top: 20px;"> - <a data-bs-toggle="tooltip" data-bs-placement="right" title="Relations" class="ui2023-side-bar-item" href="/-/relations" style="padding: 10px; height: 48px; width: 48px; display: block; border-radius: 999px;"> - <img src="<?= icon("relations") ?>" style="max-width: 28px; max-height: 28px;"> - </a> - </div> </div> -</div>
\ No newline at end of file +</div> diff --git a/includes/components/emergency.inc b/includes/components/emergency.inc deleted file mode 100644 index 67f4422..0000000 --- a/includes/components/emergency.inc +++ /dev/null @@ -1,156 +0,0 @@ -<h2>Emergency alert - <details style="display: inline-block;font-size:12px;"> - <summary class="text-muted" style="opacity:.5;"></summary> - <label><input id="test-mode" type="checkbox"> Test Mode</label> · <label><input id="fake-requests" type="checkbox"> Fake Requests</label> - </details> -</h2> - -<span data-bs-toggle="modal" data-bs-target="#turn-on" id="btn-on" style="background: #7f0000;font-size: 48px;padding: 10px 50px;border-radius: 10px;width: max-content;display: block;margin-left: auto;margin-right: auto;cursor: pointer;">Turn <b>ON</b></span> -<span data-bs-toggle="modal" onclick="disableAlert();" id="btn-off" style="display:none;background: #007f0b;font-size: 48px;padding: 10px 50px;border-radius: 10px;width: max-content;margin-left: auto;margin-right: auto;cursor: pointer;">Turn <b>OFF</b></span> -<p style="text-align:center;margin-top:10px;">Sending the next notification <b><span id="next-notification">never</span></b></p> - -<hr> - -<div style="margin-bottom: 10px;"> - <b>Targets:</b> -</div> - -<label style="display: block; margin-left: 10px;"> - <input type="checkbox" checked id="enable-raindrops"> Raindrops System -</label> -<label style="display: block; margin-left: 10px;"> - <input type="checkbox" id="enable-<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>"> <?= $GLOBALS["ColdHazeApp"]["other"]["name"] ?> -</label> -<label style="display: block; margin-left: 10px;"> - <input type="checkbox" id="enable-moonglow"> Moonglow -</label> -<!--<label style="display: block; margin-left: 10px;"> - <input type="checkbox" id="enable-hailstorm"> Hailstorm -</label>--> - -<style> - <?php global $use2023UI; if (!$use2023UI): ?> - .modal-header { - border-bottom: 1px solid #353738; - } - - .modal-content { - border: 1px solid rgba(255, 255, 255, .2); - background-color: #111; - } - - .btn-close { - filter: invert(1); - } - <?php endif; ?> - - #btn-on.disabled, #btn-off.disabled { - opacity: .5; - pointer-events: none; - } -</style> - -<div class="modal fade" id="turn-on"> - <div class="modal-dialog"> - <div class="modal-content"> - - <div class="modal-header"> - <h4 class="modal-title">Important notice</h4> - <button type="button" class="btn-close" data-bs-dismiss="modal"></button> - </div> - - <div class="modal-body"> - <div class="alert alert-danger"> - Keep this page open until you receive help. If you close the page, alert notifications will not be sent. - </div> - - <button onclick="enableAlert();" data-bs-dismiss="modal" class="btn btn-danger" style="font-size:20px;font-weight:bold;display:block;width:100%;">Enable the alert now.</button> - - <div class="alert alert-light" style="margin-top: 20px;"> - <b>Disclaimer:</b> This alert should be used <b>if and only if</b> you are in a situation that requires immediate help from a loved one. If your life is at immediate risk, please do not use this emergency system and call your local emergency services. - </div> - </div> - </div> - </div> -</div> - -<script> - window.alertInterval = null; - window.alertInterval = null; - window.alertIntervalAmount = 15; - window.alertIntervalCounter = window.alertIntervalAmount; - - function buildTargets() { - let targets = [ - document.getElementById("enable-<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>").checked ? "<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>" : null, - document.getElementById("enable-raindrops").checked ? "raindrops" : null, - document.getElementById("enable-moonglow").checked ? "moonglow" : null, - //document.getElementById("enable-hailstorm").checked ? "hailstorm" : null, - ].filter(i => i); - return "?" + targets.join("&"); - } - - function sendNotification() { - window.alertIntervalCounter = -1; - - if (document.getElementById("test-mode").checked) { - document.getElementById("next-notification").innerText = "now"; - if (document.getElementById("fake-requests").checked) { - window.alertIntervalCounter = window.alertIntervalAmount; - document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds"; - } else { - window.fetch("/api/emergency" + buildTargets()).then(() => { - window.alertIntervalCounter = window.alertIntervalAmount; - document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds"; - }) - } - } else { - document.getElementById("next-notification").innerText = "now"; - if (document.getElementById("fake-requests").checked) { - window.alertIntervalCounter = window.alertIntervalAmount; - document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds"; - } else { - window.fetch("/api/emergency-real" + buildTargets()).then(() => { - window.alertIntervalCounter = window.alertIntervalAmount; - document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds"; - }) - } - } - } - - function enableAlert() { - sendNotification(); - document.getElementById("btn-on").style.display = "none"; - document.getElementById("btn-off").style.display = "block"; - document.getElementById("test-mode").disabled = true; - document.getElementById("fake-requests").disabled = true; - document.getElementById("enable-<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>").disabled = true; - document.getElementById("enable-raindrops").disabled = true; - document.getElementById("enable-moonglow").disabled = true; - //document.getElementById("enable-hailstorm").disabled = true; - - window.alertInterval = setInterval(() => { - window.alertIntervalCounter--; - - if (window.alertIntervalCounter === 0) { - sendNotification(); - } else if (window.alertIntervalCounter > -1) { - document.getElementById("next-notification").innerText = "in " + window.alertIntervalCounter + " second" + (window.alertIntervalCounter > 1 ? "s" : ""); - } - }, 1000); - } - - function disableAlert() { - clearInterval(window.alertInterval); - window.alertIntervalCounter = 15; - document.getElementById("next-notification").innerText = "never"; - document.getElementById("btn-on").style.display = "block"; - document.getElementById("btn-off").style.display = "none"; - document.getElementById("test-mode").disabled = false; - document.getElementById("fake-requests").disabled = false; - document.getElementById("enable-<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>").disabled = false; - document.getElementById("enable-raindrops").disabled = false; - document.getElementById("enable-moonglow").disabled = false; - //document.getElementById("enable-hailstorm").disabled = false; - } -</script>
\ No newline at end of file diff --git a/includes/components/footer.inc b/includes/components/footer.inc index c062436..00d74aa 100644 --- a/includes/components/footer.inc +++ b/includes/components/footer.inc @@ -14,8 +14,6 @@ $start = microtime(true); return new bootstrap.Tooltip(tooltipTriggerEl) }); - window.fetch("/api/rename?name=" + encodeURIComponent("Cold Haze Web (" + UAParser().browser.name + " on " + UAParser().os.name + ")")); - if (document.createElement("canvas").getContext("webgl") === null) { let style = document.createElement("style"); style.innerText = "* { backdrop-filter: none !important; }"; @@ -29,4 +27,4 @@ $start = microtime(true); <?php endif; ?> </body> -</html>
\ No newline at end of file +</html> diff --git a/includes/components/header.inc b/includes/components/header.inc index bd85761..7cf626e 100644 --- a/includes/components/header.inc +++ b/includes/components/header.inc @@ -25,7 +25,6 @@ $page = $pages[$toplevel] ?? [ "rail" => false ]; -require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/util/travelling.inc"; global $travelling; require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/util/score.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/banner.inc"; @@ -473,4 +472,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/rainbow.inc"; <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/2023ui.inc"; ?> <?php $GLOBALS["ColdHazePerformance"]["header"] = (microtime(true) - $start) * 1000; $start = microtime(true); ?> -<main id="app" style="background-color: var(--palette-0);">
\ No newline at end of file +<main id="app" style="background-color: var(--palette-0);"> diff --git a/includes/components/pleasure.inc b/includes/components/pleasure.inc deleted file mode 100644 index 6d5f4b1..0000000 --- a/includes/components/pleasure.inc +++ /dev/null @@ -1,201 +0,0 @@ -<?php global $app; global $_PROFILE; $front = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true)["members"]; ?> - -<h2>Pleasure alert - <details style="display: inline-block;font-size:12px;"> - <summary class="text-muted" style="opacity:.5;"></summary> - <label><input id="test-mode" type="checkbox"> Test Mode</label> · <label><input id="fake-requests" type="checkbox"> Fake Requests</label> - </details> -</h2> - -<?php if (isset($front[0])): ?> - <?php if (!parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $front[0]["id"] . ".json"), true))["other"] && !parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $front[0]["id"] . ".json"), true))["other2"]): ?> - <div class="alert alert-warning"> - <?php - - if (count($front) === 1) { - echo("<b>" . ($front[0]["display_name"] ?? $front[0]["name"]) . "</b> is currently at front and you cannot have sex with this pony."); - } elseif (count($front) === 2) { - echo("<b>" . ($front[0]["display_name"] ?? $front[0]["name"]) . " and " . ($front[1]["display_name"] ?? $front[1]["name"]) . "</b> are currently at front and you cannot have sex with them."); - } else { - echo("Ponies are currently at front and you cannot have sex with them."); - } - - ?> However, if you wish, any of the ponies mentioned on this page can take control of the body for the amount of time required for sex. - </div> - <?php elseif (!parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $front[0]["id"] . ".json"), true))["other"]): ?> - <div class="alert alert-warning"> - <?php - - if (count($front) === 1) { - echo("<b>" . ($front[0]["display_name"] ?? $front[0]["name"]) . "</b> is currently at front and may not want to have sex with you."); - } elseif (count($front) === 2) { - echo("<b>" . ($front[0]["display_name"] ?? $front[0]["name"]) . " and " . ($front[1]["display_name"] ?? $front[1]["name"]) . "</b> are currently at front and may not want to have sex with you."); - } else { - echo("Ponies are currently at front and may not want to have sex with you."); - } - - ?> However, if this pony is not wanting to have sex with you, any of the ponies mentioned on this page can take control of the body for the amount of time required for sex. - </div> - <?php endif; ?> -<?php endif; ?> - -<span data-bs-toggle="modal" data-bs-target="#turn-on" id="btn-on" style="background: #7f0000;font-size: 48px;padding: 10px 50px;border-radius: 10px;width: max-content;display: block;margin-left: auto;margin-right: auto;cursor: pointer;">Turn <b>ON</b></span> -<span onclick="disableAlert()" id="btn-off" style="display:none;background: #007f0b;font-size: 48px;padding: 10px 50px;border-radius: 10px;width: max-content;margin-left: auto;margin-right: auto;cursor: pointer;">Turn <b>OFF</b></span> -<p style="text-align:center;margin-top:10px;">Sending the next notification <b><span id="next-notification">never</span></b> · Local time for Raindrops: <span id="raindrops-time">--:--</span></p> - -<hr> - -<div style="margin-bottom: 10px;"> - <b>Targets:</b> -</div> - -<label style="display: block; margin-left: 10px;"> - <input type="radio" name="target" checked id="enable-raindrops"> Raindrops System -</label> -<label style="display: block; margin-left: 10px;"> - <input type="radio" name="target" id="enable-<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>"> <?= $GLOBALS["ColdHazeApp"]["other"]["name"] ?> -</label> -<label style="display: block; margin-left: 10px;"> - <input type="radio" name="target" id="enable-moonglow"> Moonglow -</label> - -<script> - function updateTime() { - let time = (new Intl.DateTimeFormat("en-US", { - timeZone: 'Europe/Paris', - hour: 'numeric', - minute: 'numeric', - hour12: true - })).format(new Date()); - - document.getElementById("raindrops-time").innerText = time; - } - - updateTime(); - - setInterval(() => { - updateTime(); - }, 10000); -</script> - -<style> - <?php global $use2023UI; if (!$use2023UI): ?> - .modal-header { - border-bottom: 1px solid #353738; - } - - .modal-content { - border: 1px solid rgba(255, 255, 255, .2); - background-color: #111; - } - - .btn-close { - filter: invert(1); - } - <?php endif; ?> - - #btn-on.disabled, #btn-off.disabled { - opacity: .5; - pointer-events: none; - } -</style> - -<div class="modal fade" id="turn-on"> - <div class="modal-dialog"> - <div class="modal-content"> - - <div class="modal-header"> - <h4 class="modal-title">Important notice</h4> - <button type="button" class="btn-close" data-bs-dismiss="modal"></button> - </div> - - <div class="modal-body"> - <div class="alert alert-danger"> - Keep this page open until your pony wakes up. If you close the page, alert notifications will not be sent. - </div> - - <button onclick="enableAlert();" data-bs-dismiss="modal" class="btn btn-danger" style="font-size:20px;font-weight:bold;display:block;width:100%;">Enable the alert now.</button> - - <div class="alert alert-light" style="margin-top: 20px;"> - <b>Disclaimer:</b> This alert is not to be used in an emergency. If you need immediate help, use the <a href="/-/emergency">Emergency alert</a> instead. - </div> - </div> - </div> - </div> -</div> - -<script> - window.alertInterval = null; - window.alertIntervalAmount = 5; - window.alertIntervalCounter = window.alertIntervalAmount; - - function buildTargets() { - let targets = [ - document.getElementById("enable-<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>").checked ? "<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>" : null, - document.getElementById("enable-raindrops").checked ? "raindrops" : null, - document.getElementById("enable-moonglow").checked ? "moonglow" : null, - ].filter(i => i); - return "?" + targets.join("&"); - } - - function sendNotification() { - window.alertIntervalCounter = -1; - - if (document.getElementById("test-mode").checked) { - document.getElementById("next-notification").innerText = "now"; - if (document.getElementById("fake-requests").checked) { - window.alertIntervalCounter = window.alertIntervalAmount; - document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds"; - } else { - window.fetch("/api/pleasure" + buildTargets()).then(() => { - window.alertIntervalCounter = window.alertIntervalAmount; - document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds"; - }) - } - } else { - document.getElementById("next-notification").innerText = "now"; - if (document.getElementById("fake-requests").checked) { - window.alertIntervalCounter = window.alertIntervalAmount; - document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds"; - } else { - window.fetch("/api/pleasure-real" + buildTargets()).then(() => { - window.alertIntervalCounter = window.alertIntervalAmount; - document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds"; - }) - } - } - } - - function enableAlert() { - sendNotification(); - document.getElementById("btn-on").style.display = "none"; - document.getElementById("btn-off").style.display = "block"; - document.getElementById("test-mode").disabled = true; - document.getElementById("fake-requests").disabled = true; - document.getElementById("enable-<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>").disabled = true; - document.getElementById("enable-raindrops").disabled = true; - document.getElementById("enable-moonglow").disabled = true; - - window.alertInterval = setInterval(() => { - window.alertIntervalCounter--; - - if (window.alertIntervalCounter === 0) { - sendNotification(); - } else if (window.alertIntervalCounter > -1) { - document.getElementById("next-notification").innerText = "in " + window.alertIntervalCounter + " second" + (window.alertIntervalCounter > 1 ? "s" : ""); - } - }, 1000); - } - - function disableAlert() { - clearInterval(window.alertInterval); - document.getElementById("next-notification").innerText = "never"; - document.getElementById("btn-on").style.display = "block"; - document.getElementById("btn-off").style.display = "none"; - document.getElementById("test-mode").disabled = false; - document.getElementById("fake-requests").disabled = false; - document.getElementById("enable-<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>").disabled = false; - document.getElementById("enable-raindrops").disabled = false; - document.getElementById("enable-moonglow").disabled = false; - } -</script>
\ No newline at end of file diff --git a/includes/components/sysbanner.inc b/includes/components/sysbanner.inc index 6a66ab4..c6f9579 100644 --- a/includes/components/sysbanner.inc +++ b/includes/components/sysbanner.inc @@ -8,7 +8,7 @@ global $systemID; global $system; global $lang; global $pages; global $app; -$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true); +$travelling = []; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); ?> @@ -62,4 +62,4 @@ $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pa </a> <div></div> </div> -</div>
\ No newline at end of file +</div> |