]> OzVa Git service - shopping-channel/commitdiff
Added lighting and clock movement controls
authorwill <greenwoodw50@gmail.com>
Tue, 27 Aug 2024 00:02:30 +0000 (01:02 +0100)
committerwill <greenwoodw50@gmail.com>
Tue, 27 Aug 2024 00:02:30 +0000 (01:02 +0100)
+ refactored sigil.json
+ Added notes to the control pannel

auth/index.php
clock.json
sigil.json

index 86b6fbca7b98743de097abddc37449bb010e9efc..eb226405428231c457e765ba865472565cbfc8b7 100644 (file)
@@ -22,8 +22,20 @@ $data = fread($file, filesize("../data.json"));
 fclose($file);
 $data = json_decode($data, true);
 
+$clockIncrement = 10;
+
 if (!empty($_POST['update'])) {
-       $data['itemId'] = (int)$_POST['item'];
+
+       for ($i = 0; $i < 5; $i ++) {
+               if ($i == (int)$_POST['sceneCue']) {
+                       $clock['lightingCues'][$i] = "true";
+               } else {
+                       $clock['lightingCues'][$i] = "false";
+               }
+       }
+       for ($i = 0; $i < 5; $i ++) {
+               $clock['lightingCues'][$i + 5] = var_export(!empty($_POST["triggerCue$i"]), true);
+       }
 
        $data['showingMain'] = var_export(!empty($_POST['main']), true);
        $data['showingAll'] = var_export(!empty($_POST['all']), true);
@@ -38,9 +50,12 @@ if (!empty($_POST['update'])) {
        ];
        $data['round'] = var_export(!empty($_POST['round']), true);
 
+       $clock['movementSpeed'] = (int)$_POST['movementSpeed'];
+       $clock['currentPosition'] = (int)$_POST["doomsday"];
        $data['timerOffset'] = (int)$_POST['timerOffset'];
        $data['priceChange'] = (int)$_POST['priceChange'];
        $data['discount'] = (int)$_POST['discount'];
+       $data['itemId'] = (int)$_POST['item'];
        $data['prefix'] = $_POST['prefix'];
 
        $data['currency']['prefix'] = $_POST['prefixString'];
@@ -74,8 +89,6 @@ if (!empty($_POST['update'])) {
        fwrite($file, $json);
        fclose($file);
 
-       $clock['currentPosition'] = (int)$_POST["doomsday"];
-
        $json = json_encode($clock);
        $file = fopen("../clock.json", "w");
        fwrite($file, $json);
@@ -105,6 +118,16 @@ fieldtext > .split {
        width: 50%;
        margin: 0;
 }
+.floating {
+       position: fixed;
+       bottom: 25px;
+       right: 25px;
+       max-width: min(900px, calc(100% - 74px));
+       padding: 10px;
+       color: red;
+       border: 2px solid red;
+       background-color: rgba(255, 255, 255, 0.7);
+}
 .clock {
        position: relative;
        width: 100%;
@@ -123,10 +146,10 @@ fieldtext > .split {
        margin: 0;
 }
 <?php
-for ($i = 0; $i < 360; $i += 10) {
+for ($i = 0; $i < 360; $i += $clockIncrement) {
        $radius = 45;
-       $x = $radius * cos(deg2rad($i)) + 50;
-       $y = $radius * sin(deg2rad($i)) + 50;
+       $x = $radius * cos(deg2rad($i - 90)) + 50;
+       $y = $radius * sin(deg2rad($i - 90)) + 50;
        echo ".angle$i {top: calc($y% - 7px); left: calc($x% - 7px);}";
 }
 ?>
@@ -331,10 +354,10 @@ echo "</fieldset>";
 ?>
                </div><div class="split">
 <?php
-echo "<fieldset><legend>Doomsday clock</legend>";
+echo "<fieldset><legend>Doomsday clock <em>(Incr. $clockIncrement deg)</em></legend>";
 echo "<div class=clock>";
 echo "<svg class='clockFace' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'><circle r='45' cx='50' cy='50' fill='none' stroke='#a0a0a0' stroke-width='0.15px'/></svg>";
-for ($i = 0; $i < 360; $i += 10) {
+for ($i = 0; $i < 360; $i += $clockIncrement) {
        $checked = "";
        if ($clock['currentPosition'] == $i) {
                $checked = " checked='checked' ";
@@ -345,23 +368,41 @@ for ($i = 0; $i < 360; $i += 10) {
                                        <div>
                                                <fieldset>
                                                        <legend>Movement</legend>
-                                                       <input type="checkbox">
-                                                       <label>Movement setting here!</label><br>
-                                                       <input type="checkbox">
-                                                       <label>Movement setting here!</label><br>
-                                                       <input type="checkbox">
-                                                       <label>Movement setting here!</label><br>
-                                                       <input type="checkbox">
-                                                       <label>Movement setting here!</label>
+                                                       <input type='number' name='movementSpeed' id='movementSpeed' value='<?php echo $clock['movementSpeed']; ?>'>
+                                                       <label for='movementSpeed'> Movement speed (ms/tick)</label><br>
+                                                       <div class="split">
+                                                               <input type='radio' value='ease' name='function'>
+                                                               <label>Ease function</label>
+                                                       </div><div class="split">
+                                                               <input type='radio' value='linear' name='function' checked='checked'>
+                                                               <label>Linear function</label>
+                                                       </div>
                                                </fieldset>
                                                <fieldset>
                                                        <legend>Lighting</legend>
-                                                       <input type="checkbox">
-                                                       <label>Lighting setting here!</label><br>
-                                                       <input type="checkbox">
-                                                       <label>Lighting setting here!</label><br>
-                                                       <input type="checkbox">
-                                                       <label>Lighting setting here!</label>
+                                                       <div class="split">
+<?php
+for ($i = 0; $i < 5; $i ++) {
+       $checked = "";
+       if ($clock['lightingCues'][$i] == "true") {
+               $checked = " checked='checked'";
+       }
+       echo "<input type='radio' value='$i' name='sceneCue'$checked>";
+       echo "<label>Scene $i</label><br>";
+}
+?>
+                                                       </div><div class="split">
+<?php
+for ($i = 0; $i < 5; $i ++) {
+       $checked = "";
+       if ($clock['lightingCues'][$i + 5] == "true") {
+               $checked = " checked='checked'";
+       }
+       echo "<input type='checkbox' value='true' name='triggerCue$i'$checked>";
+       echo "<label>Trigger $i</label><br>";
+}
+?>
+                                                       </div>
                                                </fieldset>
                                        </div>
                                </div>
@@ -375,5 +416,25 @@ for ($i = 0; $i < 360; $i += 10) {
                        </details>
                </div>
                </form>
+               <details class="floating">
+                       <summary>Notes</summary>
+                       <p>
+                               Still need to do plenty to both the GFX overlay and this page (and the actual clock):
+                       </p>
+                       <ul>
+                               <li>Make this notes section a little better? it might actually be useful during the show. Although the arrow is quite difficult to click on</li>
+                               <li>Add the controls for persentage sold and the relevant display on the GFX side of things</li>
+                               <li>Add 2 more timers on both the controls and the GFX page</li>
+                               <li>Add the timers and the % sold to the autocue so the presenter can atually see what theyre doing</li>
+                               <li>Add a clock display to the GFX page and the autocue (could just be a gereric time?)</li>
+                               <li>Make the top banner look better</li>
+                               <li>Add some kind of rating into the item file and make it display</li>
+                               <li>add marquee of the current buyers of the product and figure out how to do this (potentially hard?)</li>
+                               <li></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, arrange screentest with Jack.
+                       </p>
+               </details>
        </body>
 </html>
index c595aa42d946a9063681f5dce92953bbb8934491..3c56d26d9b9722266916eb48803141315440de54 100755 (executable)
@@ -1 +1 @@
-{"currentPosition":270,"movementSpeed":10,"function":"ease","lightingCues":["true", "false", "true", "true"]}
+{"currentPosition":230,"movementSpeed":30,"function":"ease","lightingCues":["false","false","true","false","false","true","false","true","false","true"]}
\ No newline at end of file
index d9a05af41f3467d91903bcb8b49565fa9eb69770..4eb374c2649d672048bbf24c95828bd41886f464 100755 (executable)
@@ -2,40 +2,40 @@
        "square":[
                "110,10",
                "90,110",
-                "50,10",
-                "70,110",
-                "30,110",
-                "10,10",
-                "10,30",
-                "90,30",
-                "70,90",
-                "50,90",
-                "30,30",
-                "110,90",
-                "110,70",
-                "30,50",
-                "70,50",
-                "50,50",
-                "90,70",
-                "10,70",
-                "10,50",
-                "30,70",
-                "70,70",
-                "50,70",
-                "90,50",
-                "110,50",
-                "10,90",
-                "90,90",
-                "50,30",
-                "70,30",
-                "30,90",
-                "110,30",
-                "110,110",
-                "30,10",
-                "50,110",
-                "70,10",
-                "90,10",
-                "10,110"
+               "50,10",
+               "70,110",
+               "30,110",
+               "10,10",
+               "10,30",
+               "90,30",
+               "70,90",
+               "50,90",
+               "30,30",
+               "110,90",
+               "110,70",
+               "30,50",
+               "70,50",
+               "50,50",
+               "90,70",
+               "10,70",
+               "10,50",
+               "30,70",
+               "70,70",
+               "50,70",
+               "90,50",
+               "110,50",
+               "10,90",
+               "90,90",
+               "50,30",
+               "70,30",
+               "30,90",
+               "110,30",
+               "110,110",
+               "30,10",
+               "50,110",
+               "70,10",
+               "90,10",
+               "10,110"
        ],
        "phrases":[
                "anchor",