summaryrefslogtreecommitdiff
path: root/includes/wakeup.inc
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-03-12 19:16:53 +0100
committerRaindropsSys <contact@minteck.org>2023-03-12 19:16:53 +0100
commiteb89b15c0f044673c1206a418a21d0baba1a675e (patch)
tree39ac31a576d8b8392cbd9baf8d67621bf2cefa86 /includes/wakeup.inc
parent5385f0ed8fbb4325203a222a75e6700ffb519349 (diff)
downloadpluralconnect-eb89b15c0f044673c1206a418a21d0baba1a675e.tar.gz
pluralconnect-eb89b15c0f044673c1206a418a21d0baba1a675e.tar.bz2
pluralconnect-eb89b15c0f044673c1206a418a21d0baba1a675e.zip
Updated 104 files, added 3 files, deleted 4 files and renamed 36 files (automated)
Diffstat (limited to 'includes/wakeup.inc')
-rw-r--r--includes/wakeup.inc114
1 files changed, 0 insertions, 114 deletions
diff --git a/includes/wakeup.inc b/includes/wakeup.inc
deleted file mode 100644
index 587e705..0000000
--- a/includes/wakeup.inc
+++ /dev/null
@@ -1,114 +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>
- .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);
- }
-</style>
-
-<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>
- <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 somecreature 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.alertIntervalCounter = 15;
-
- 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 = 15;
- document.getElementById("next-notification").innerText = "15 seconds";
- } else {
- window.fetch("/api/wakeup").then(() => {
- window.alertIntervalCounter = 15;
- document.getElementById("next-notification").innerText = "15 seconds";
- })
- }
- } else {
- document.getElementById("next-notification").innerText = "now";
- if (document.getElementById("fake-requests").checked) {
- window.alertIntervalCounter = 15;
- document.getElementById("next-notification").innerText = "15 seconds";
- } else {
- window.fetch("/api/wakeup-real").then(() => {
- window.alertIntervalCounter = 15;
- document.getElementById("next-notification").innerText = "15 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> \ No newline at end of file