diff options
author | RaindropsSys <contact@minteck.org> | 2023-03-21 16:21:21 +0100 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-03-21 16:21:21 +0100 |
commit | 475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd (patch) | |
tree | 2cff46debf9c1e13892e7babff9deb6874ecb4b2 /includes/components | |
parent | 7ccc2de87f9e25c715dc09b9aba4eb5c66f80424 (diff) | |
download | pluralconnect-475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd.tar.gz pluralconnect-475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd.tar.bz2 pluralconnect-475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd.zip |
Updated 26 files and added 1074 files (automated)
Diffstat (limited to 'includes/components')
-rw-r--r-- | includes/components/details.inc | 2 | ||||
-rw-r--r-- | includes/components/emergency.inc | 31 | ||||
-rw-r--r-- | includes/components/header.inc | 29 | ||||
-rw-r--r-- | includes/components/mobilenav.inc | 8 | ||||
-rw-r--r-- | includes/components/navigation.inc | 34 | ||||
-rw-r--r-- | includes/components/pane.inc | 6 | ||||
-rw-r--r-- | includes/components/pleasure.inc | 245 | ||||
-rw-r--r-- | includes/components/wakeup.inc | 28 |
8 files changed, 347 insertions, 36 deletions
diff --git a/includes/components/details.inc b/includes/components/details.inc index 77790de..bc7e408 100644 --- a/includes/components/details.inc +++ b/includes/components/details.inc @@ -12,7 +12,7 @@ <div> <b><?= $lang["details"]["memory"] ?></b><span class="member-small-separator"><br></span> <?= match ($metadata["shared_memory"]) { - 0 => "<span data-bs-toggle='tooltip' title='This pony doesn't directly share memories with this pony's headmates, b, but is able to (slowly) query them if that is needed.'>" . $lang["details"]["memory_states"][0] . "</span>", + 0 => "<span data-bs-toggle='tooltip' title='This pony doesn't directly share memories with this pony's headmates, but is able to (slowly) query them if that is needed.'>" . $lang["details"]["memory_states"][0] . "</span>", 1 => "<span data-bs-toggle='tooltip' title='This pony doesn't directly share memories with this pony's headmates, but may be able to share certain memories and/or share memories at will.'>" . $lang["details"]["memory_states"][1] . "</span>", 2 => "<span data-bs-toggle='tooltip' title='This pony shares all memories with this pony's headmates.'>" . $lang["details"]["memory_states"][2] . "</span>", } ?> diff --git a/includes/components/emergency.inc b/includes/components/emergency.inc index 5490985..ffa19d6 100644 --- a/includes/components/emergency.inc +++ b/includes/components/emergency.inc @@ -22,9 +22,14 @@ .btn-close { filter: invert(1); } + + #btn-on.disabled, #btn-off.disabled { + opacity: .5; + pointer-events: none; + } </style> -<div class="modal fade" id="turn-on"> +<div class="modal" id="turn-on"> <div class="modal-dialog"> <div class="modal-content"> @@ -50,7 +55,7 @@ </div> <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 somecreature if e.g. they are sleeping. Keep that in mind. + 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> <p> @@ -64,7 +69,7 @@ </div> </div> -<div class="modal fade" id="turn-off"> +<div class="modal" id="turn-off"> <div class="modal-dialog"> <div class="modal-content"> @@ -103,10 +108,12 @@ <script> window.alertInterval = null; - window.alertIntervalCounter = 15; 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) { @@ -142,23 +149,23 @@ if (document.getElementById("test-mode").checked) { document.getElementById("next-notification").innerText = "now"; if (document.getElementById("fake-requests").checked) { - window.alertIntervalCounter = 15; - document.getElementById("next-notification").innerText = "15 seconds"; + window.alertIntervalCounter = window.alertIntervalAmount; + document.getElementById("next-notification").innerText = window.alertIntervalAmount + " seconds"; } else { window.fetch("/api/emergency").then(() => { - window.alertIntervalCounter = 15; - document.getElementById("next-notification").innerText = "15 seconds"; + window.alertIntervalCounter = window.alertIntervalAmount; + document.getElementById("next-notification").innerText = window.alertIntervalAmount + " seconds"; }) } } else { document.getElementById("next-notification").innerText = "now"; if (document.getElementById("fake-requests").checked) { - window.alertIntervalCounter = 15; - document.getElementById("next-notification").innerText = "15 seconds"; + window.alertIntervalCounter = window.alertIntervalAmount; + document.getElementById("next-notification").innerText = window.alertIntervalAmount + " seconds"; } else { window.fetch("/api/emergency-real").then(() => { - window.alertIntervalCounter = 15; - document.getElementById("next-notification").innerText = "15 seconds"; + window.alertIntervalCounter = window.alertIntervalAmount; + document.getElementById("next-notification").innerText = window.alertIntervalAmount + " seconds"; }) } } diff --git a/includes/components/header.inc b/includes/components/header.inc index 7c4cfc8..06b9bdb 100644 --- a/includes/components/header.inc +++ b/includes/components/header.inc @@ -218,3 +218,32 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc"; } </style> <?php endif; ?> + +<?php if (isset($_GET["mini"]) || str_contains($_SERVER["HTTP_USER_AGENT"], "+ColdHazeDesktop")) { + ?> + <style> + #navigation-pane, #title-bar, #footer, #titlebar-separator, #mobile-navigation, #global-search-container { + display: none !important; + } + + body { + margin-left: 0 !important; + } + </style> +<?php } if (str_contains($_SERVER["HTTP_USER_AGENT"], "+ColdHazeDesktop")) { ?> +<style> + body { + background: #222 !important; + } + + .container { + margin-left: 10px; + margin-right: 10px; + max-width: calc(100vw - 20px); + } + + h2 { + display: none; + } +</style> +<?php } ?> diff --git a/includes/components/mobilenav.inc b/includes/components/mobilenav.inc index 646738c..f83597f 100644 --- a/includes/components/mobilenav.inc +++ b/includes/components/mobilenav.inc @@ -1,4 +1,4 @@ -<?php global $navigation; global $isLoggedIn; ?> +<?php global $navigation; global $isLoggedIn; global $isLowerLoggedIn; ?> <div id="mobile-navigation"> <div id="mobile-navigation-container" class="container" style="display: grid; grid-template-columns: repeat(<?= count(array_values(array_filter($navigation, function ($item) use ($isLoggedIn) { return !$item["admin"] || $isLoggedIn; @@ -23,16 +23,16 @@ </div> <?php foreach ($item["items"] as $category): ?> - <div class="pane-group-category <?= $category["minimal"] ? "pane-group-category-minimal" : "" ?>" <?= $category["minimal"] ? 'style="display: grid; grid-template-columns: repeat(' . count($category["items"]) . ', 1fr); grid-gap: 10px;"' : "" ?>> + <div class="pane-group-category <?= $category["minimal"] ? "pane-group-category-minimal" : "" ?>" <?= $category["minimal"] ? 'style="display: grid; grid-template-columns: repeat(' . ($isLowerLoggedIn ? 2 : 3) . ', 1fr); grid-gap: 10px;"' : "" ?>> <?php if (isset($category["name"])): ?> <div class="pane-group-category-title"><?= $category["name"] ?></div> <?php endif; ?> - <?php foreach ($category["items"] as $link): ?> + <?php foreach ($category["items"] as $link): if (isset($link)): if (!($isLowerLoggedIn && $link["private"])): ?> <a class="pane-group-item" href="<?= $link["link"] ?>"> <img src="<?= $link["icon"] ?>" <?php if ($link["invert"]): ?>class="dropdown-icon"<?php endif; ?> alt="" style="width:24px; border-radius: 5px; vertical-align: middle;"> <?php if (!$category["minimal"]): ?><span style="vertical-align: middle;<?= isset($link["stepped"]) ? "color: $link[stepped];" : "" ?>"><?= isset($link["stepped"]) ? "<b>$link[name]</b>" : $link["name"] ?></span><?php endif; ?> </a> - <?php endforeach; ?> + <?php endif; endif; endforeach; ?> </div> <?php endforeach; ?> </div> diff --git a/includes/components/navigation.inc b/includes/components/navigation.inc index beb92bb..bd4ea4b 100644 --- a/includes/components/navigation.inc +++ b/includes/components/navigation.inc @@ -4,10 +4,10 @@ $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pa global $navigation; global $toplevel; -global $lang; global $pages; global $app; +global $lang; global $pages; global $app; global $isLowerLoggedIn; $navigation_admin = [ - "admin" => true, + "admin" => !$isLowerLoggedIn, "name" => "Private utilities", "icon" => "/assets/icons/admin.svg", "invert" => true, @@ -21,7 +21,7 @@ $navigation_admin = [ "icon" => "/assets/icons/emergency.svg", "invert" => false, "link" => "/-/emergency", - "stepped" => "rgb(220,53,69)", + "stepped" => null, "private" => false ], [ @@ -29,7 +29,15 @@ $navigation_admin = [ "icon" => "/assets/icons/wakeup.svg", "invert" => false, "link" => "/-/wakeup", - "stepped" => "rgb(13,202,240)", + "stepped" => null, + "private" => true + ], + [ + "name" => $pages["pleasure"]["name"][$lang["_name"]], + "icon" => "/assets/icons/pleasure.svg", + "invert" => false, + "link" => "/-/pleasure", + "stepped" => null, "private" => false ] ] @@ -63,6 +71,14 @@ $navigation_admin = [ "private" => true ], [ + "name" => $pages["schedules"]["name"][$lang["_name"]], + "icon" => "/assets/icons/schedules.svg", + "invert" => true, + "link" => "/-/schedules", + "stepped" => null, + "private" => false + ], + [ "name" => $pages["rules"]["name"][$lang["_name"]], "icon" => "/assets/icons/rules.svg", "invert" => true, @@ -71,6 +87,14 @@ $navigation_admin = [ "private" => true ], [ + "name" => $pages["toys"]["name"][$lang["_name"]], + "icon" => "/assets/icons/toys.svg", + "invert" => true, + "link" => "/-/toys", + "stepped" => null, + "private" => true + ], + [ "name" => $pages["docs"]["name"][$lang["_name"]], "icon" => "/assets/icons/docs.svg", "invert" => true, @@ -279,7 +303,7 @@ $navigation_cloudburst = [ ] ]; $navigation_other = [ - "admin" => true, + "admin" => !$isLowerLoggedIn, "name" => $app["other"]["name"], "icon" => getAsset($app["other"]["id"]), "invert" => false, diff --git a/includes/components/pane.inc b/includes/components/pane.inc index 28ccd71..8a18407 100644 --- a/includes/components/pane.inc +++ b/includes/components/pane.inc @@ -41,8 +41,8 @@ foreach ($list as $color) { <span style="vertical-align: middle;"><?= $item["name"] ?></span> </div> - <?php foreach ($item["items"] as $category): if (!($category["minimal"] && $isLowerLoggedIn)): ?> - <div class="pane-group-category <?= $category["minimal"] ? "pane-group-category-minimal" : "" ?>" <?= $category["minimal"] ? 'style="display: grid; grid-template-columns: repeat(' . count($category["items"]) . ', 1fr); grid-gap: 10px;"' : "" ?>> + <?php foreach ($item["items"] as $category): ?> + <div class="pane-group-category <?= $category["minimal"] ? "pane-group-category-minimal" : "" ?>" <?= $category["minimal"] ? 'style="display: grid; grid-template-columns: repeat(' . ($isLowerLoggedIn ? 2 : 3) . ', 1fr); grid-gap: 10px;"' : "" ?>> <?php if (isset($category["name"])): ?> <div class="pane-group-category-title"><?= $category["name"] ?></div> <?php endif; ?> @@ -53,7 +53,7 @@ foreach ($list as $color) { </a> <?php endif; endif; endforeach; ?> </div> - <?php endif; endforeach; ?> + <?php endforeach; ?> </div> <?php endif; endforeach; ?> diff --git a/includes/components/pleasure.inc b/includes/components/pleasure.inc new file mode 100644 index 0000000..02ce759 --- /dev/null +++ b/includes/components/pleasure.inc @@ -0,0 +1,245 @@ +<?php global $app; global $_PROFILE; $front = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true)["members"]; ?> + +<h2>Sex 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 ($_PROFILE["login"] === "cloudburst"): ?> +<div class="alert alert-danger"> + <b>Notice:</b> Only <?= $app["other"]["name"] ?> can use the sex alert. If you wish to wake somepony up, use the <a href="/-/wakeup" style="filter: invert(1) hue-rotate(180deg);">wake-up alert</a> instead. +</div> +<?php endif; ?> + +<?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"]), 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; ?> + +<?php + +$school = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/school.json"), true); + +if ((int)date('G') > 19) { + $day = date('Y-m-d', time() + 86400); +} else { + $day = date('Y-m-d'); +} + +if (isset($school[$day]) && $school[$day]["firstClass"]["timestamp"] < time() * 1000) { + $day = date('Y-m-d', time() + 86400); +} + +if (!isset($school[$day])) { + echo('<div class="alert alert-secondary">No information about Raindrops\'s school schedule for ' . date('F jS', strtotime($day)) . ' currently, try again later.</div>'); +} elseif (isset($school[$day]["firstClass"]["timestamp"])) { + $tod = round($school[$day]["firstClass"]["timestamp"] / 1000) - strtotime($day); + $hours = $tod / 3600; + $time = date('g:i a', $tod); + + if ($hours < 8.5) { + echo('<div class="alert alert-danger">Raindrops starts school at ' . $time . ' (local time) tomorrow (' . date('F jS', strtotime($day)) . '), it is recommended that you don\'t wake them up to have sex.</div>'); + } else if ($hours < 9.5) { + echo('<div class="alert alert-warning">Raindrops starts school at ' . $time . ' (local time) tomorrow (' . date('F jS', strtotime($day)) . '), they can be wakened up at night to have sex for at most an hour.</div>'); + } else { + echo('<div class="alert alert-success">Raindrops starts school at ' . $time . ' (local time) tomorrow (' . date('F jS', strtotime($day)) . '), they can be wakened up at night to have sex for over an hour.</div>'); + } +} else { + echo('<div class="alert alert-success">Raindrops does not have school tomorrow (' . date('F jS', strtotime($day)) . '), they can be wakened up at night to have sex for as long as you wish.</div>'); +} + +?> + +<span data-bs-toggle="modal" <?php if ($_PROFILE["login"] === "cloudburst"): ?>class="disabled"<?php endif; ?> 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> · Local time for Raindrops: <span id="raindrops-time">--:--</span><br>Make sure you run the <code>/sex</code> command on the server before turning the alert on.</p> + +<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> + .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); + } + + #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 = window.alertIntervalAmount + " seconds"; + } else { + window.fetch("/api/pleasure").then(() => { + window.alertIntervalCounter = window.alertIntervalAmount; + document.getElementById("next-notification").innerText = 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 = window.alertIntervalAmount + " seconds"; + } else { + window.fetch("/api/pleasure-real").then(() => { + window.alertIntervalCounter = window.alertIntervalAmount; + document.getElementById("next-notification").innerText = 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 = 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> + +<?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" && $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" && $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"] && $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"] && $pony["_metadata"]["other4"]): ?> + <li><a href="/<?= $pony["name"] ?>"><?= $pony["display_name"] ?? $pony["name"] ?></a></li> + <?php endif; endforeach; ?> +</ul> +<?php endif; ?> diff --git a/includes/components/wakeup.inc b/includes/components/wakeup.inc index 587e705..d7bceee 100644 --- a/includes/components/wakeup.inc +++ b/includes/components/wakeup.inc @@ -22,9 +22,14 @@ .btn-close { filter: invert(1); } + + #btn-on.disabled, #btn-off.disabled { + opacity: .5; + pointer-events: none; + } </style> -<div class="modal fade" id="turn-on"> +<div class="modal" id="turn-on"> <div class="modal-dialog"> <div class="modal-content"> @@ -39,7 +44,7 @@ <hr> <div class="alert alert-warning"> - This alert system is designed to emit sudden alerts, and may surprise somecreature if e.g. they are sleeping. Keep that in mind. + 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> @@ -55,7 +60,8 @@ <script> window.alertInterval = null; - window.alertIntervalCounter = 15; + window.alertIntervalAmount = 5; + window.alertIntervalCounter = window.alertIntervalAmount; function sendNotification() { window.alertIntervalCounter = -1; @@ -63,23 +69,23 @@ if (document.getElementById("test-mode").checked) { document.getElementById("next-notification").innerText = "now"; if (document.getElementById("fake-requests").checked) { - window.alertIntervalCounter = 15; - document.getElementById("next-notification").innerText = "15 seconds"; + window.alertIntervalCounter = window.alertIntervalAmount; + document.getElementById("next-notification").innerText = window.alertIntervalAmount + " seconds"; } else { window.fetch("/api/wakeup").then(() => { - window.alertIntervalCounter = 15; - document.getElementById("next-notification").innerText = "15 seconds"; + window.alertIntervalCounter = window.alertIntervalAmount; + document.getElementById("next-notification").innerText = window.alertIntervalAmount + " seconds"; }) } } else { document.getElementById("next-notification").innerText = "now"; if (document.getElementById("fake-requests").checked) { - window.alertIntervalCounter = 15; - document.getElementById("next-notification").innerText = "15 seconds"; + window.alertIntervalCounter = window.alertIntervalAmount; + document.getElementById("next-notification").innerText = window.alertIntervalAmount + " seconds"; } else { window.fetch("/api/wakeup-real").then(() => { - window.alertIntervalCounter = 15; - document.getElementById("next-notification").innerText = "15 seconds"; + window.alertIntervalCounter = window.alertIntervalAmount; + document.getElementById("next-notification").innerText = window.alertIntervalAmount + " seconds"; }) } } |