From de93f1fff26d4dbe837c0f92cad6afc5209b9794 Mon Sep 17 00:00:00 2001 From: will Date: Tue, 27 Aug 2024 01:55:54 +0100 Subject: [PATCH] Implemented 2 more clocks Note: Not yet implemented in the GFX display --- auth/index.php | 122 ++++++++++++++++++++++++++++++++++----------- autocue/index.html | 33 +++++++++++- clock.json | 2 +- data.json | 2 +- 4 files changed, 128 insertions(+), 31 deletions(-) diff --git a/auth/index.php b/auth/index.php index eb22640..9d6b1ee 100644 --- a/auth/index.php +++ b/auth/index.php @@ -40,7 +40,9 @@ if (!empty($_POST['update'])) { $data['showingMain'] = var_export(!empty($_POST['main']), true); $data['showingAll'] = var_export(!empty($_POST['all']), true); $data['showingExtra'] = var_export(!empty($_POST['extra']), true); - $data['showingTimer'] = var_export(!empty($_POST['timer']), true); + $data['showingTimer1'] = var_export(!empty($_POST['timer1']), true); + $data['showingTimer2'] = var_export(!empty($_POST['timer2']), true); + $data['showingTimer3'] = var_export(!empty($_POST['timer3']), true); $data['showingBanner'] = var_export(!empty($_POST['banner']), true); $data['showingSigil'] = [ var_export(!empty($_POST['sigilNE']), true), @@ -52,7 +54,9 @@ if (!empty($_POST['update'])) { $clock['movementSpeed'] = (int)$_POST['movementSpeed']; $clock['currentPosition'] = (int)$_POST["doomsday"]; - $data['timerOffset'] = (int)$_POST['timerOffset']; + $data['timer1Offset'] = (int)$_POST['timer1Offset']; + $data['timer2Offset'] = (int)$_POST['timer2Offset']; + $data['timer3Offset'] = (int)$_POST['timer3Offset']; $data['priceChange'] = (int)$_POST['priceChange']; $data['discount'] = (int)$_POST['discount']; $data['itemId'] = (int)$_POST['item']; @@ -78,10 +82,20 @@ if (!empty($_POST['update'])) { $data['bannerText'] = $text['bannerText'][(int)$_POST['bannerText']]; - if (!empty($_POST['addTime'])) { - $minutes = (int)substr($_POST['addTime'], 0, 2); - $seconds = (int)substr($_POST['addTime'], 2, 4) + ($minutes * 60); - $data['timerEnd'] = time() + $seconds; + if (!empty($_POST['addTime1'])) { + $minutes = (int)substr($_POST['addTime1'], 0, 2); + $seconds = (int)substr($_POST['addTime1'], 2, 4) + ($minutes * 60); + $data['timer1End'] = time() + $seconds; + } + if (!empty($_POST['addTime2'])) { + $minutes = (int)substr($_POST['addTime2'], 0, 2); + $seconds = (int)substr($_POST['addTime2'], 2, 4) + ($minutes * 60); + $data['timer2End'] = time() + $seconds; + } + if (!empty($_POST['addTime3'])) { + $minutes = (int)substr($_POST['addTime3'], 0, 2); + $seconds = (int)substr($_POST['addTime3'], 2, 4) + ($minutes * 60); + $data['timer3End'] = time() + $seconds; } $json = json_encode($data); @@ -107,6 +121,12 @@ h1 { margin: 10px; vertical-align: top; } +.third { + display: inline-block; + width: calc((100% / 3) - 20px); + margin: 10px; + vertical-align: top; +} .entry { width: 50%; margin: 0; @@ -328,30 +348,76 @@ if ($data['showingSigil'][1] == "true") {
Timer -
-
-
-
-
-
-
-
-
-
-
-
"; -echo ""; -echo "
"; -echo ""; -echo "
"; +$timer1Checked = ""; +if ($data['showingTimer1'] == "true") { + $timer1Checked = " checked='checked' "; +} +$timer1Offset = $data["timer1Offset"]; +$timer2Checked = ""; +if ($data['showingTimer2'] == "true") { + $timer2Checked = " checked='checked' "; +} +$timer2Offset = $data["timer2Offset"]; +$timer3Checked = ""; +if ($data['showingTimer3'] == "true") { + $timer3Checked = " checked='checked' "; +} +$timer3Offset = $data["timer3Offset"]; ?> +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
> + +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
> + +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
> + +
+
Doomsday clock (Incr. $clockIncrement deg)"; diff --git a/autocue/index.html b/autocue/index.html index f7a2e6e..2ea8df4 100644 --- a/autocue/index.html +++ b/autocue/index.html @@ -13,16 +13,38 @@ body { } #notes { margin: 40px; +} +#timer { + position: absolute; + bottom: 0; + left: 0; }