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);
];
$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'];
fwrite($file, $json);
fclose($file);
- $clock['currentPosition'] = (int)$_POST["doomsday"];
-
$json = json_encode($clock);
$file = fopen("../clock.json", "w");
fwrite($file, $json);
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%;
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);}";
}
?>
?>
</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' ";
<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>
</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>