]> OzVa Git service - shopping-channel/commitdiff
Implemented clock 2 & 3 into GFX
authorwill <greenwoodw50@gmail.com>
Tue, 27 Aug 2024 18:33:37 +0000 (19:33 +0100)
committerwill <greenwoodw50@gmail.com>
Tue, 27 Aug 2024 18:33:37 +0000 (19:33 +0100)
+ Changed control panel to thirds view
+ Changed banner background
+ Added moving timer 3 to the screen focus
+ Moved control pannel lighting fieldset

auth/index.php
clock.json
data.json
index.html
items.json

index 8acb257b8b809eed055d900ce06643b44fe908d0..5a9ecb829ad33661709ea4115c96c4eb002c2d1c 100644 (file)
@@ -43,6 +43,7 @@ if (!empty($_POST['update'])) {
        $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['timer3Main'] = var_export(!empty($_POST['timer3Main']), true);
        $data['showingBanner'] = var_export(!empty($_POST['banner']), true);
        $data['showingSigil'] = [
                var_export(!empty($_POST['sigilNE']), true),
@@ -180,7 +181,7 @@ for ($i = 0; $i < 360; $i += $clockIncrement) {
        </head>
        <body>
                <form action="./index.php" method="POST">
-               <div class="split">
+               <div class="third">
                        <div class="split entry">
                                <h1>XMDV Interface</h1>
                        </div><div class="split entry">
@@ -293,6 +294,7 @@ for ($i = 0; $i < count($text['bottomText']); $i++) {
        echo "<label for='bottomText'> $line</label></div>";
 }
 echo "</fieldset>";
+echo "</div><div class='third'>";
 echo "<fieldset><legend>Banner text</legend>";
 for ($i = 0; $i < count($text['bannerText']); $i++) {
        $line = $text['bannerText'][$i];
@@ -359,6 +361,10 @@ $timer3Checked = "";
 if ($data['showingTimer3'] == "true") {
        $timer3Checked = " checked='checked' ";
 }
+$timer3MainChecked = "";
+if ($data['timer3Main'] == "true") {
+       $timer3MainChecked = " checked='checked' ";
+}
 $timerOffset = $data["timerOffset"];
 ?>
                                <div class="third">
@@ -405,38 +411,14 @@ $timerOffset = $data["timerOffset"];
                                        <input type='radio' id='1000' value='1000' name='addTime3'>
                                        <label for='1000'> +10:00</label><br>
                                        <input type='checkbox' id='timer3' name='timer3' value='true'<?php echo $timer3Checked; ?>>
-                                       <label for='timer3'> Showing timer</label>
+                                       <label for='timer3'> Showing timer</label><br>
+                                       <input type='checkbox' id='timer3Main' name='timer3Main' value='true'<?php echo $timer3MainChecked; ?>>
+                                       <label for='timer3Main'> Timer focus</label>
                                </div>
                                <input type='number' id='timerOffset' name='timerOffset' min='-5000' max='5000' step='1' value='<?php echo $timerOffset; ?>'>
                                <label for='timerOffset'> Timer offset (ms)</label>
                        </fieldset>
-               </div><div class="split">
-<?php
-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 += $clockIncrement) {
-       $checked = "";
-       if ($clock['currentPosition'] == $i) {
-               $checked = " checked='checked' ";
-       }
-       echo "<input type='radio' class='clockButton angle$i' value='$i' name='doomsday'$checked>";
-}
-?>
-                                       <div>
-                                               <fieldset>
-                                                       <legend>Movement</legend>
-                                                       <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>
+                       <fieldset>
                                                        <legend>Lighting</legend>
                                                        <div class="split">
 <?php
@@ -461,6 +443,32 @@ for ($i = 0; $i < 5; $i ++) {
 }
 ?>
                                                        </div>
+                       </fieldset>
+               </div><div class="third">
+<?php
+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 += $clockIncrement) {
+       $checked = "";
+       if ($clock['currentPosition'] == $i) {
+               $checked = " checked='checked' ";
+       }
+       echo "<input type='radio' class='clockButton angle$i' value='$i' name='doomsday'$checked>";
+}
+?>
+                                       <div>
+                                               <fieldset>
+                                                       <legend>Movement</legend>
+                                                       <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>
                                        </div>
                                </div>
@@ -488,7 +496,6 @@ for ($i = 0; $i < 5; $i ++) {
                                <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.
index 3c56d26d9b9722266916eb48803141315440de54..c29ed80ec3822a0b01f837112ce2d41f113b0760 100755 (executable)
@@ -1 +1 @@
-{"currentPosition":230,"movementSpeed":30,"function":"ease","lightingCues":["false","false","true","false","false","true","false","true","false","true"]}
\ No newline at end of file
+{"currentPosition":230,"movementSpeed":30,"function":"ease","lightingCues":["false","true","false","false","false","true","false","true","false","true"]}
\ No newline at end of file
index 812dfe86bd9dc637719c458dc3f324d4e1c82679..6bdb3fd187ccce696783b2477cbc8eaa9684713f 100755 (executable)
--- a/data.json
+++ b/data.json
@@ -1 +1 @@
-{"topText":["It's here!"],"bottomText":["It's here!"],"bannerText":"The quant we created!","itemId":1,"currency":{"prefix":"$","postfix":" hairs"},"discount":70,"prefix":"false","round":"true","priceChange":50,"showingMain":"true","showingAll":"true","showingExtra":"true","showingTimer1":"true","showingTimer2":"false","showingTimer3":"false","showingBanner":"true","showingSigil":["false","false","false","false"],"timer1End":1724723324,"timer2End":1724720211,"timer3End":1724720386,"timerOffset":0}
\ No newline at end of file
+{"topText":["It's here!"],"bottomText":["It's here!"],"bannerText":"It's here!","itemId":2,"currency":{"prefix":"$","postfix":" hairs"},"discount":70,"prefix":"false","round":"true","priceChange":50,"showingMain":"true","showingAll":"true","showingExtra":"true","showingTimer1":"true","showingTimer2":"true","showingTimer3":"true","timer3Main":"false","showingBanner":"true","showingSigil":["false","false","false","false"],"timer1End":1724723324,"timer2End":1724780836,"timer3End":1724781031,"timerOffset":0}
\ No newline at end of file
index cd8260098c5dada8355c3a85ebc1c50c805946ec..eed82d8ce0ac152de30efe1e502d2dce3c0acc01 100644 (file)
@@ -4,11 +4,17 @@
                <meta http-equiv="refres" content="5">
                <style>
 body {
-       --background: linear-gradient(#FFFFFF, #EEEEEE);
+       --star-light: #FFE0B3;
+       --star-dark: #FFC266;
        --dark: #DEDEDE;
        --feature-dark: #AAAAEE;
        --feature-light: #BBBBEE;
+       --feature-white: #EAEAFA;
+       --background-light: #FFFFFF;
+       --background-dark: #EEEEEE;
        --feature-gradient: linear-gradient(var(--feature-dark), var(--feature-light));
+       --background: linear-gradient(var(--background-light), var(--background-dark));
+       --clock: conic-gradient(var(--background-light) 0deg, var(--background-light) 0deg, rgb(0,0,0,0) 0.1deg), rgb(0,0,0,0) 360deg);
 
        font-family: sans-serif;
        font-size: 1.6vh;
@@ -43,6 +49,17 @@ body {
        opacity: 0;
        transition: opacity 1.5s;
 }
+#raiting {
+       margin: 5px;
+       margin-top: 0;
+       border-radius: 5px;
+       font-size: 2em;
+       line-height: 1em;
+       color: var(--star-dark);
+       text-shadow: -1px -1px 0 var(--star-light), 1px -1px 0 var(--star-light), -1px 1px 0 var(--star-light), 1px 1px 0 var(--star-light), 2px 2px 0 var(--dark);
+       background-image: linear-gradient(var(--background-dark), var(--dark));
+       box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.19) 0px 1px 2px;
+}
 .main {
        z-index: 0;
 }
@@ -55,10 +72,21 @@ body {
        overflow: hidden;
        opacity: 0;
        transition: opacity 1.5s, width 1.5s, left 1.5s;
+       background: linear-gradient(var(--feature-white), rgb(0,0,0,0), var(--feature-white)), var(--background);
+       border: 1px solid var(--feature-dark);
 }
-.banner.moved {
+.banner.moved, .timer2.moved {
        left: 6vh;
 }
+.timer3.moved {
+       bottom: calc(50% - 15vh);
+       right: calc(50% - 15vh);
+       width: 30vh;
+       height: 30vh;
+       border-radius: 15vh;
+       font-size: 6em;
+       line-height: 30vh;
+}
 .extra {
        position: relative;
        top: -2vh;
@@ -172,13 +200,40 @@ h2.badge {
 }
 .timer2 {
        position: absolute;
+       left: calc(48vh + 2px);
+       top: calc(11.5vh + 2px);
+       height: 1.2em;
+       width: 3em;
+       margin: 0;
+       text-align: center;
+       font-size: 2em;
+       font-weight: bold;
+       line-height: 1.2em;
+       border: 2px solid var(--dark);
+       outline: 2px solid var(--feature-dark);
        opacity: 0;
-       transition: opacity 1.5s;
+       transition: opacity 1.5s, left 1.5s;
 }
 .timer3 {
        position: absolute;
+       bottom: 4vh;
+       right: 4vh;
        opacity: 0;
-       transition: opacity 1.5s;
+       width: 12vh;
+       height: 12vh;
+       border-radius: 6vh;
+       margin: 0;
+       text-align: center;
+       vertical-align: center;
+       font-size: 2em;
+       font-weight: bold;
+       line-height: 12vh;
+       background-image: var(--background);
+       border: 2px solid var(--feature-dark);
+       outline: 2px solid var(--dark);
+       opacity: 0;
+       transition: opacity 1.5s, bottom 1.5s, right 1.5s, width 1.5s, height 1.5s, border-radius 1.5s, font-size 1.5s, line-height 1.5s, transform 1.5s;
+       animation: spinText 10s linear 0s infinite;
 }
 .show {
        opacity: 1;
@@ -245,18 +300,33 @@ function makePrice(price) {
 }
 // helper function for creating time strings
 function makeTime(t, o) {
-                       let current = Math.round((Date.now() + o) / 1000);
-                       var time = t - current;
-                       if (Math.sign(time) == -1) {time = 0;}
-                       var minutes = Math.floor(time / 60);
-                       var seconds = (time - (minutes * 60));
-
-                       var minutesString = minutes.toString();
-                       var secondsString = seconds.toString();
-                       minutesString = minutesString.padStart(2, "0");
-                       secondsString = secondsString.padStart(2, "0");
-
-                       return `${minutesString}:${secondsString}`;
+       let current = Math.round((Date.now() + o) / 1000);
+       var time = t - current;
+       if (Math.sign(time) == -1) {time = 0;}
+       var minutes = Math.floor(time / 60);
+       var seconds = (time - (minutes * 60));
+
+       var minutesString = minutes.toString();
+       var secondsString = seconds.toString();
+       minutesString = minutesString.padStart(2, "0");
+       secondsString = secondsString.padStart(2, "0");
+
+       return `${minutesString}:${secondsString}`;
+}
+function makeSeconds(t, o, d) {
+       let current = Math.round((Date.now() + o) / 1000);
+       var time = t - current;
+       if (Math.sign(time) == -1) {time = 0;}
+       var minutes = Math.floor(time / 60);
+       var seconds = (time - (minutes * 60));
+
+       if (d == true) {
+               if (minutes > 0) {return 360;}
+               else {return Math.round(seconds * (360 / 60))}
+       } else {
+               if (minutes > 0) {return 100;}
+               else {return Math.round(seconds * (100 / 60))}
+       }
 }
 // handles all updates from the server data that are not required to be instantanious (2 times per second)
 function update() {
@@ -283,20 +353,6 @@ function update() {
                                banner.classList.remove("show");
                        }
 
-                       const side = document.getElementsByClassName("side")[0];
-                       if (data.showingMain == "true") {
-                               side.classList.add("show");
-                               banner.classList.remove("moved");
-                       } else {
-                               side.classList.remove("show");
-                               banner.classList.add("moved");
-                       }
-                       if (data.showingExtra == "true" && data.showingMain == "true") {
-                               side.classList.add("showExtra");
-                       } else {
-                               side.classList.remove("showExtra");
-                       }
-
                        const timer1 = document.getElementsByClassName("timer1")[0];
                        timer1.innerHTML = makeTime(data.timer1End, data.timerOffset);
                        if (data.showingTimer1 == "true") {
@@ -312,6 +368,9 @@ function update() {
                        } else {
                                timer2.classList.remove("show");
                        }
+                       var angle = makeSeconds(data.timer2End, data.timerOffset, true);
+                       var property = `conic-gradient(rgb(0,0,0,0) 0deg, rgb(0,0,0,0) ${angle}deg, var(--feature-light) ${angle}.1deg, var(--feature-light) 360deg)`;
+                       timer2.style.background = `${property}, var(--background)`;
 
                        const timer3 = document.getElementsByClassName("timer3")[0];
                        timer3.innerHTML = makeTime(data.timer3End, data.timerOffset);
@@ -320,6 +379,30 @@ function update() {
                        } else {
                                timer3.classList.remove("show");
                        }
+                       if (data.timer3Main == "true") {
+                               timer3.classList.add("moved");
+                       } else {
+                               timer3.classList.remove("moved");
+                       }
+                       var radius = makeSeconds(data.timer3End, data.timerOffset, false);
+                       var property = `linear-gradient(rgb(0,0,0,0) 0%, rgb(0,0,0,0) ${radius}%, var(--feature-light) ${radius}.1%, var(--feature-dark) 100%)`;
+                       timer3.style.background = `${property}, var(--background)`;
+
+                       const side = document.getElementsByClassName("side")[0];
+                       if (data.showingMain == "true") {
+                               side.classList.add("show");
+                               banner.classList.remove("moved");
+                               timer2.classList.remove("moved");
+                       } else {
+                               side.classList.remove("show");
+                               banner.classList.add("moved");
+                               timer2.classList.add("moved");
+                       }
+                       if (data.showingExtra == "true" && data.showingMain == "true") {
+                               side.classList.add("showExtra");
+                       } else {
+                               side.classList.remove("showExtra");
+                       }
 
                        const badgeContainer = document.getElementsByClassName("badgeContainer")[0];
                        if (discount <= 0.99) {
@@ -369,6 +452,7 @@ function update() {
                .then(data => data.json())
                .then(data => {
                        document.getElementById("code").innerHTML = data[itemId].code;
+                       document.getElementById("raiting").innerHTML = data[itemId].rating;
                        document.getElementById("subtext").innerHTML = data[itemId].subtext;
                        document.getElementById("description").innerHTML = data[itemId].description;
 
@@ -487,6 +571,7 @@ setInterval(draw, 500)
                <div class="container side show">
                        <div class="box main">
                                <h1 id="code"></h1>
+                               <h3 id="raiting"></h3>
                                <h2 class="feature" id="subtext"></h2>
                                <h3 id="description"></h3>
                                <hr>
@@ -505,8 +590,6 @@ setInterval(draw, 500)
 
                <div class="container box bottom">
                        <h3 class="feature timer1 box"></h3>
-                       <h3 class="timer2"></h3>
-                       <h3 class="timer3"></h3>
                        <h2 id="topText"></h2>
                        <div class="marquee">
                                <h1 class="marqueeText" id="bottomText"></h1>
@@ -516,6 +599,8 @@ setInterval(draw, 500)
                <div class="container box banner">
                        <h1 id="bannerText"></h1>
                </div>
+               <div class="timer2 box"></div>
+               <div class="timer3"></div>
 
                <div class="container box sigilBox show" id="sigilNE">
                        <svg class="sigil" viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg">
index 95539273eb4c7f925c85af53e95d5be61fae70df..3720d37a15b20b5cf85117c8060b29c4a62fbcd4 100755 (executable)
@@ -1,6 +1,7 @@
 [
        {
                "code":"Placeholder item code",
+               "rating":"&#x2726;&#x2726;&#x2726;&#x2726;",
                "subtext":"Test item name",
                "description":"Test item description",
                "origionalPrice":0,
@@ -12,6 +13,7 @@
        },
        {
                "code":"Item 1",
+               "rating":"&#x2736;&#x2736;&#x2736;&#x2736;&#x2736;",
                "subtext":"Gold <em>Stick-Strip</em>&#8482",
                "description":"50m shiny gold <em>Stick-Strip</em>&#8482! Origional beautiful formula! Cannot be broken! Too beautiful! Stuck!",
                "origionalPrice":500,
@@ -23,6 +25,7 @@
        },
        {
                "code":"Item 2",
+               "rating":"&#x2726;&#x2726;&#x2726;",
                "subtext":"Item subtext",
                "description":"Product 2 description. It's really long to see if the badge element moves down the page at all. I f**king hate CSS positioning. Oops family show.",
                "origionalPrice":170,