From: will <greenwoodw50@gmail.com>
Date: Wed, 28 Aug 2024 15:25:12 +0000 (+0100)
Subject: Added producer note to the interface and the autocue
X-Git-Url: https://git.ozva.co.uk/?a=commitdiff_plain;h=b756cf48d6d26eeb5960534cf76f3eccb52495a2;p=shopping-channel

Added producer note to the interface and the autocue
---

diff --git a/auth/index.php b/auth/index.php
index 37a572b..ee10732 100644
--- a/auth/index.php
+++ b/auth/index.php
@@ -22,6 +22,10 @@ $data = fread($file, filesize("../data.json"));
 fclose($file);
 $data = json_decode($data, true);
 
+$file = fopen("../note", "r") or die("unable to open file!");
+$note = fread($file, filesize("../note"));
+fclose($file);
+
 $clockIncrement = 10;
 
 if (!empty($_POST['update'])) {
@@ -107,6 +111,16 @@ if (!empty($_POST['update'])) {
 		$data['timer3End'] = time() + $seconds;
 	}
 
+	if (!empty($_POST['notes'])) {
+		$note = $_POST['notes'];
+	} else {
+		$note = "";
+	}
+
+	$file = fopen("../note", "w");
+	fwrite($file, $note);
+	fclose($file);
+
 	$json = json_encode($data);
 	$file = fopen("../data.json", "w");
 	fwrite($file, $json);
@@ -310,6 +324,13 @@ for ($i = 0; $i < count($text['bottomText']); $i++) {
 	echo "<label for='bottomText'> $line</label></div>";
 }
 echo "</fieldset>";
+
+echo "<fieldset><legend>Notes</legend>";
+echo "<textarea name='notes' rows='10' style='width: 100%;'>";
+echo $note;
+echo "</textarea>";
+echo "</fieldset>";
+
 echo "</div><div class='third'>";
 echo "<fieldset><legend>Banner text</legend>";
 for ($i = 0; $i < count($text['bannerText']); $i++) {
@@ -522,6 +543,7 @@ for ($i = 0; $i < 360; $i += $clockIncrement) {
 				<li><s>Make the top banner look better</s></li>
 				<li><s>Add some kind of rating into the item file and make it display</s></li>
 				<li>add marquee of the current buyers of the product and figure out how to do this (potentially hard?)</li>
+				<li><s>Add producer notes to the interface and autocue</s></li>
 			</ul>
 			<p>
 				and then still to do in the admin department: Talk to Joe about the GFX system, ask Ash about the lighting desk sAcn input and to setup things, makerspace the clock, text people about things, <s>arrange screentest with Jack</s>.
diff --git a/autocue/index.html b/autocue/index.html
index cb23a14..4b53a5c 100644
--- a/autocue/index.html
+++ b/autocue/index.html
@@ -11,13 +11,14 @@ body {
 	top: 10px;
 	left: 10px;
 }
-#notes {
-	margin: 40px;
+#notes, #message {
+	margin: 20px;
 }
 #timer {
 	position: absolute;
 	bottom: 0;
 	left: 0;
+	margin: 20px;
 }
 		</style>
 		<script>
@@ -45,9 +46,11 @@ function makeTime(t, o, s) {
 function frame() {
 	var slider = document.getElementById("slider");
 	var notes = document.getElementById("notes");
+	var message = document.getElementById("message");
 	var timers = document.getElementById("timer");
 
 	notes.style.fontSize = `${slider.value}px`;
+	message.style.fontSize = `${slider.value}px`;
 	timers.style.fontSize = `${slider.value}px`;
 }
 
@@ -74,15 +77,22 @@ function update() {
 			stock.innerHTML = data[itemId].stockCount;
 
 		})
+	fetch("../note", {cache: "no-store"})
+		.then(data => data.text())
+		.then(data => {
+			const messageContainer = document.getElementById("message");
+			messageContainer.innerHTML = data.replaceAll("\n", "<br>");
+		})
 }
 
 setInterval(frame, 50);
 setInterval(update, 1000);
 		</script>
 	</head>
-	<body>
+	<body onload="frame(); update();">
 		<input type="range" min="30" max="100" value="45" id="slider">
 		<div style="font-size: 50px;" id="notes">some test text!</div>
+		<div style="font-size: 50px; color: yellow;" id="message">Producer Notes!</div>
 		<div id="timer">
 			T1: <span style="background-color: red;" class="time"></span> -
 			T2: <span style="background-color: green;" class="time"></span> -
diff --git a/note b/note
new file mode 100644
index 0000000..fdd0d69
--- /dev/null
+++ b/note
@@ -0,0 +1,4 @@
+8 blue
+6 bat
+2 crystals
+7 cat lookin' things
\ No newline at end of file