diff options
Diffstat (limited to 'includes/components')
-rw-r--r-- | includes/components/2023ui.inc | 6 | ||||
-rw-r--r-- | includes/components/emergency.inc | 129 | ||||
-rw-r--r-- | includes/components/pleasure.inc | 90 | ||||
-rw-r--r-- | includes/components/wakeup.inc | 122 |
4 files changed, 80 insertions, 267 deletions
diff --git a/includes/components/2023ui.inc b/includes/components/2023ui.inc index d0792ec..40c2d00 100644 --- a/includes/components/2023ui.inc +++ b/includes/components/2023ui.inc @@ -210,15 +210,9 @@ </a> <?php if ($isLoggedIn): ?> - <div class="mobile-hide" style="margin: 10px 0; width: 48px; height: 2px; background-color: var(--palette-2);"></div> - <div class="mobile-show" style="display: none; margin: 0 10px; height: 48px; width: 2px; background-color: var(--palette-2); vertical-align: middle;"></div> - <a data-bs-toggle="tooltip" data-bs-placement="right" title="Money tracker" class="ui2023-side-bar-item" href="/-/money" style="padding: 10px; height: 48px; width: 48px; display: block; border-radius: 999px;"> <img src="<?= icon("money") ?>" style="max-width: 28px; max-height: 28px;"> </a> - <a data-bs-toggle="tooltip" data-bs-placement="right" title="Documents" class="ui2023-side-bar-item" href="/-/docs" style="padding: 10px; height: 48px; width: 48px; display: block; border-radius: 999px;"> - <img src="<?= icon("documents") ?>" style="max-width: 28px; max-height: 28px;"> - </a> <a data-bs-toggle="tooltip" data-bs-placement="right" title="System travelling" class="ui2023-side-bar-item" href="/-/travelling" style="padding: 10px; height: 48px; width: 48px; display: block; border-radius: 999px;"> <img src="<?= icon("travelling") ?>" style="max-width: 28px; max-height: 28px;"> </a> diff --git a/includes/components/emergency.inc b/includes/components/emergency.inc index 0a1401c..03d468c 100644 --- a/includes/components/emergency.inc +++ b/includes/components/emergency.inc @@ -6,9 +6,25 @@ </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" data-bs-target="#turn-off" 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> +<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 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> + <style> <?php global $use2023UI; if (!$use2023UI): ?> .modal-header { @@ -31,78 +47,25 @@ } </style> -<div class="modal" id="turn-on"> +<div class="modal fade" id="turn-on"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> - <h4 class="modal-title">This is to be treated seriously.</h4> + <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"> - <b>WARNING:</b> This alert should be used IF AND ONLY IF 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 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%;">I understand the risk, enable the alert now.</button> - - <hr> - - <div class="alert alert-danger"> - Once enabled, disable the alert system ONLY once you are safe. <b>Your mental health is more important than sleep.</b> - </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-warning"> - This emergency alert system is designed to make sure a loved one can get in touch with you as soon as possible. Therefore, it will emit sudden alerts, and may surprise somepony if e.g. they are sleeping. Keep that in mind. + <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> - - <p> - <b>Disclaimer:</b> This emergency alert system MUST NOT be used in life-threatening situations. Although it has been extensively tested in multiple conditions, it may stop working correctly or stop working at all at any time and without warning. If your life is at immediate risk, call your local emergency services. - </p> - <p> - © <?= date('Y') ?> Equestria.dev - </p> - </div> - </div> - </div> -</div> - -<div class="modal" id="turn-off"> - <div class="modal-dialog"> - <div class="modal-content"> - - <div class="modal-header"> - <h4 class="modal-title">Make sure you are safe.</h4> - <button type="button" class="btn-close" data-bs-dismiss="modal"></button> - </div> - - <div class="modal-body"> - <div class="alert alert-danger"> - Make sure you are safe, and you got in touch with a loved one before disabling this alert system. It can be re-enabled later at any time. Remember, <b>your mental health is more important than sleep.</b> - </div> - - <p class="text-muted"> - Scroll until the bottom of the page to disable the alert. - </p> - - <p> - <b>Read this if you want to disable the alert before receiving help:</b> Remember you are loved, cared for. Ponies rely on you, need you, love you. We never want to lose any of you, so please, keep the alert enabled until you are safe. If you are unsure, always keep the alert enabled. - </p> - <p> - <b>Disclaimer:</b> This emergency alert system MUST NOT be used in life-threatening situations. Although it has been extensively tested in multiple conditions, it may stop working correctly or stop working at all at any time and without warning. If your life is at immediate risk, call your local emergency services. - </p> - <p> - This service makes use of the ntfy platform, provided by a third party. Do note that their privacy policy applies when delivering the notifications; although they should not contain personal information in any way. - </p> - <p> - © <?= date('Y') ?> Equestria.dev - </p> - - <button id="disable-button" onclick="disableAlert();" data-bs-dismiss="modal" class="btn btn-success disabled" style="display:block;width:100%;">I am safe, disable the alert now. <span id="disable-timer">(X)</span></button> </div> </div> </div> @@ -110,40 +73,18 @@ <script> window.alertInterval = null; - window.alertDisablerCounter = 9; - window.alertDisablerEnabled = false; - window.alertDisablerCounterInterval = null; window.alertInterval = null; window.alertIntervalAmount = 15; window.alertIntervalCounter = window.alertIntervalAmount; - setInterval(() => { - if (document.getElementById("turn-off").offsetWidth > 0 || document.getElementById("turn-off").offsetHeight > 0) { - if (!window.alertDisablerEnabled) { - window.alertDisablerEnabled = true; - window.alertDisablerCounter = 9; - - document.getElementById("disable-timer").innerText = "(" + window.alertDisablerCounter + ")"; - document.getElementById("disable-button").classList.add("disabled"); - - window.alertDisablerCounterInterval = setInterval(() => { - window.alertDisablerCounter--; - - if (window.alertDisablerCounter > 0) { - document.getElementById("disable-timer").innerText = "(" + window.alertDisablerCounter + ")"; - document.getElementById("disable-button").classList.add("disabled"); - } else { - document.getElementById("disable-timer").innerText = ""; - document.getElementById("disable-button").classList.remove("disabled"); - } - }, 1000); - } - } else { - window.alertDisablerEnabled = false; - try { clearInterval(window.alertDisablerCounterInterval) } catch (e) {} - window.alertDisablerCounter = 9; - } - }); + 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; @@ -154,7 +95,7 @@ window.alertIntervalCounter = window.alertIntervalAmount; document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds"; } else { - window.fetch("/api/emergency").then(() => { + window.fetch("/api/emergency" + buildTargets()).then(() => { window.alertIntervalCounter = window.alertIntervalAmount; document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds"; }) @@ -165,7 +106,7 @@ window.alertIntervalCounter = window.alertIntervalAmount; document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds"; } else { - window.fetch("/api/emergency-real").then(() => { + window.fetch("/api/emergency-real" + buildTargets()).then(() => { window.alertIntervalCounter = window.alertIntervalAmount; document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds"; }) @@ -179,6 +120,9 @@ 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--; @@ -199,5 +143,8 @@ 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/pleasure.inc b/includes/components/pleasure.inc index 5749bd7..9d2825c 100644 --- a/includes/components/pleasure.inc +++ b/includes/components/pleasure.inc @@ -49,6 +49,22 @@ <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 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", { @@ -90,30 +106,25 @@ } </style> -<div class="modal" id="turn-on"> +<div class="modal fade" id="turn-on"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> - <h4 class="modal-title">Somepony will be awoken.</h4> + <h4 class="modal-title">Important notice</h4> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body"> - <button onclick="enableAlert();" data-bs-dismiss="modal" class="btn btn-success" style="font-size:20px;font-weight:bold;display:block;width:100%;">I wish to proceed.</button> + <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> - <hr> + <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-warning"> - This alert system is designed to emit sudden alerts, and may surprise somepony if e.g. they are sleeping. Keep that in mind. + <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> - - <p> - <b>Disclaimer:</b> This is NOT an emergency alert system, use the "Emergency alert" option is you need immediate help and comfort. - </p> - <p> - © <?= date('Y') ?> Equestria.dev - </p> </div> </div> </div> @@ -124,6 +135,15 @@ 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; @@ -133,7 +153,7 @@ window.alertIntervalCounter = window.alertIntervalAmount; document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds"; } else { - window.fetch("/api/pleasure").then(() => { + window.fetch("/api/pleasure" + buildTargets()).then(() => { window.alertIntervalCounter = window.alertIntervalAmount; document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds"; }) @@ -144,7 +164,7 @@ window.alertIntervalCounter = window.alertIntervalAmount; document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds"; } else { - window.fetch("/api/pleasure-real").then(() => { + window.fetch("/api/pleasure-real" + buildTargets()).then(() => { window.alertIntervalCounter = window.alertIntervalAmount; document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds"; }) @@ -158,6 +178,9 @@ 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--; @@ -177,37 +200,8 @@ 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> - -<?php if ($_PROFILE["login"] !== "cloudburst"): ?> -<hr> - -<p><?= $_PROFILE["login"] === "raindrops" ? "These ponies will have sex with " . $app["other"]["name"] : "These ponies will have sex with you" ?>:</p> -<ul> - <?php foreach (scoreOrderGlobal() as $pony): if ($pony["system"] === "gdapd" && isset($pony["_metadata"]["other"]) && $pony["_metadata"]["other"]): ?> - <li><a href="/<?= $pony["name"] ?>"><?= $pony["display_name"] ?? $pony["name"] ?></a> (<?= $pony["_metadata"]["sexually_active"] ? "no consent is required" : "consent is mandatory" ?>)</li> - <?php endif; endforeach; ?> -</ul> - -<p><?= $_PROFILE["login"] === "raindrops" ? "These ponies may have sex with " . $app["other"]["name"] . " but are unsure about it" : "These ponies may have sex with you but are unsure about it" ?>:</p> -<ul> - <?php foreach (scoreOrderGlobal() as $pony): if ($pony["system"] === "gdapd" && isset($pony["_metadata"]["other2"]) && $pony["_metadata"]["other2"]): ?> - <li><a href="/<?= $pony["name"] ?>"><?= $pony["display_name"] ?? $pony["name"] ?></a></li> - <?php endif; endforeach; ?> -</ul> - -<p><?= $_PROFILE["login"] === "raindrops" ? "These ponies will have sex with you" : "These ponies will have sex with Raindrops" ?>:</p> -<ul> - <?php foreach (scoreOrderGlobal() as $pony): if ($pony["system"] === $app["other"]["id"] && isset($pony["_metadata"]["other3"]) && $pony["_metadata"]["other3"]): ?> - <li><a href="/<?= $pony["name"] ?>"><?= $pony["display_name"] ?? $pony["name"] ?></a></li> - <?php endif; endforeach; ?> -</ul> - -<p><?= $_PROFILE["login"] === "raindrops" ? "These ponies may have sex with you but are unsure about it" : "These ponies may have sex with Raindrops but are unsure about it" ?>:</p> -<ul> - <?php foreach (scoreOrderGlobal() as $pony): if ($pony["system"] === $app["other"]["id"] && isset($pony["_metadata"]["other4"]) && $pony["_metadata"]["other4"]): ?> - <li><a href="/<?= $pony["name"] ?>"><?= $pony["display_name"] ?? $pony["name"] ?></a></li> - <?php endif; endforeach; ?> -</ul> -<?php endif; ?> +</script>
\ No newline at end of file diff --git a/includes/components/wakeup.inc b/includes/components/wakeup.inc deleted file mode 100644 index 994bbdc..0000000 --- a/includes/components/wakeup.inc +++ /dev/null @@ -1,122 +0,0 @@ -<h2>Wake-up 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 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 next notification <b><span id="next-notification">never</span></b></p> - -<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" id="turn-on"> - <div class="modal-dialog"> - <div class="modal-content"> - - <div class="modal-header"> - <h4 class="modal-title">Somepony will be awoken.</h4> - <button type="button" class="btn-close" data-bs-dismiss="modal"></button> - </div> - - <div class="modal-body"> - <button onclick="enableAlert();" data-bs-dismiss="modal" class="btn btn-success" style="font-size:20px;font-weight:bold;display:block;width:100%;">I wish to proceed.</button> - - <hr> - - <div class="alert alert-warning"> - This alert system is designed to emit sudden alerts, and may surprise somepony if e.g. they are sleeping. Keep that in mind. - </div> - - <p> - <b>Disclaimer:</b> This is NOT an emergency alert system, use the "Emergency alert" option is you need immediate help and comfort. - </p> - <p> - © <?= date('Y') ?> Equestria.dev - </p> - </div> - </div> - </div> -</div> - -<script> - window.alertInterval = null; - window.alertIntervalAmount = 5; - window.alertIntervalCounter = window.alertIntervalAmount; - - 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/wakeup").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/wakeup-real").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; - - 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; - } -</script>
\ No newline at end of file |