]> OzVa Git service - shopping-channel/commitdiff
Added cue values in the JSON
authorwill <greenwoodw50@gmail.com>
Mon, 19 Aug 2024 13:42:48 +0000 (14:42 +0100)
committerwill <greenwoodw50@gmail.com>
Mon, 19 Aug 2024 13:42:48 +0000 (14:42 +0100)
auth/index.php
clock.json
data.json
index.html

index b492c6aeb359c096769ef77eceffe601aab41aa5..86b6fbca7b98743de097abddc37449bb010e9efc 100644 (file)
@@ -25,6 +25,8 @@ $data = json_decode($data, true);
 if (!empty($_POST['update'])) {
        $data['itemId'] = (int)$_POST['item'];
 
+       $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['showingBanner'] = var_export(!empty($_POST['banner']), true);
@@ -161,14 +163,26 @@ for ($i = 0; $i < count($items); $i++) {
        echo "<input type='radio' id='$i' value='$i' name='item'$checked>";
        echo "<label for='$i'> $subtext</label><br>";
 }
-$checked = "";
+$checkedExtra = "";
 if ($data['showingExtra'] == "true") {
-       $checked = " checked='checked' ";
+       $checkedExtra = " checked='checked' ";
+}
+$checkedMain = "";
+if ($data['showingMain'] == "true") {
+       $checkedMain = " checked='checked' ";
+}
+$checkedAll = "";
+if ($data['showingAll'] == "true") {
+       $checkedAll = " checked='checked' ";
 }
 ?>
                                </div><div class='split'>
-                                       <input type='checkbox' id='extra' name='extra' value='true'<?php echo $checked; ?>>
-                                       <label for='extra'> Showing extra information</label>
+                                       <input type='checkbox' id='extra' name='extra' value='true'<?php echo $checkedExtra; ?>>
+                                       <label for='extra'> Showing extra information</label><br>
+                                       <input type='checkbox' id='main' name='main' value='true'<?php echo $checkedMain; ?>>
+                                       <label for='main'> Showing product information</label><br>
+                                       <input type='checkbox' id='all' name='all' value='true'<?php echo $checkedAll; ?>>
+                                       <label for='all'> Showing all components</label>
                                </div>
                        </fieldset>
 
@@ -204,7 +218,7 @@ if ($data['round'] == "true") {
                                </div><div class='split'>
 
                                        <input type='number' name='discount' id='discount' value='<?php echo $data['discount']; ?>'>
-                                       <label for='discount'> Discount (%)</label><br>
+                                       <label for='discount'> Price of origional (%)</label><br>
 
                                        <input type='number' name='priceChange' id='priceChange' value='<?php echo $data['priceChange']; ?>'>
                                        <label for='priceChange'> Discount change (%/s)</label><br>
@@ -319,7 +333,7 @@ echo "</fieldset>";
 <?php
 echo "<fieldset><legend>Doomsday clock</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.2px'/></svg>";
+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) {
        $checked = "";
        if ($clock['currentPosition'] == $i) {
index c36e628b5dd2c95d72ea529407216fb211494a59..1250412aae393b5e2ba11c95c3629481d6be8cf3 100755 (executable)
@@ -1 +1 @@
-{"currentPosition":270,"movementSpeed":10,"function":"ease"}
\ No newline at end of file
+{"currentPosition":270,"movementSpeed":10,"function":"ease","lightingCues":["true", "false", "true"]}
index 0d0c88cfdf8e1b7f9af3e4edfb86cdde495b0425..7d876927ddae489f92de90f3eddb842dc18b4b15 100755 (executable)
--- a/data.json
+++ b/data.json
@@ -1 +1 @@
-{"topText":["It's here!"],"bottomText":["It's here!"],"bannerText":"Buy XMDV!","itemId":1,"currency":{"prefix":"$","postfix":" hairs"},"discount":0,"prefix":"true","round":"true","priceChange":50,"showingExtra":"false","showingTimer":"true","showingBanner":"true","showingSigil":["true","true","false","false"],"timerEnd":1722808645,"timerOffset":-500}
\ No newline at end of file
+{"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","showingTimer":"true","showingBanner":"true","showingSigil":["false","false","false","false"],"timerEnd":1722808645,"timerOffset":-500}
\ No newline at end of file
index 8ddd25d62a7ceae445b405eee311e0ca87263b68..1d2ff3ed97145a7189056b577d325d0b8c45a836 100644 (file)
@@ -3,7 +3,7 @@
        <head>
                <meta http-equiv="refres" content="5">
                <style>
-:root {
+body {
        --background: linear-gradient(#FFFFFF, #EEEEEE);
        --dark: #DEDEDE;
        --feature-dark: #AAAAEE;
@@ -13,6 +13,9 @@
        font-family: sans-serif;
        font-size: 1.6vh;
        color: black;
+
+       opacity: 0;
+       transition: opacity 1.5s;
 }
 @keyframes spin {
        0% {transform: rotate(0turn) scale(1.2);}
@@ -37,6 +40,8 @@
        left: 6vh;
        top: 6vh;
        width: 40vh;
+       opacity: 0;
+       transition: opacity 1.5s;
 }
 .main {
        z-index: 0;
        padding: 0.5vh;
        overflow: hidden;
        opacity: 0;
-       transition: opacity 1.5s, width 1.5s;
+       transition: opacity 1.5s, width 1.5s, left 1.5s;
+}
+.banner.moved {
+       left: 6vh;
 }
 .extra {
        position: relative;
@@ -245,19 +253,11 @@ function update() {
                        secondsString = secondsString.padStart(2, "0");
 
                        //handle all optional elements showing/hiding
-                       const timer = document.getElementsByClassName("timer")[0];
-                       timer.innerHTML = `${minutesString}:${secondsString}`;
-                       if (data.showingTimer == "true") {
-                               timer.classList.add("show");
-                       } else {
-                               timer.classList.remove("show");
-                       }
-
-                       const extra = document.getElementsByClassName("side")[0];
-                       if (data.showingExtra == "true") {
-                               extra.classList.add("showExtra");
+                       const all = document.getElementById("all");
+                       if (data.showingAll == "true") {
+                               all.classList.add("show");
                        } else {
-                               extra.classList.remove("showExtra");
+                               all.classList.remove("show");
                        }
 
                        const banner = document.getElementsByClassName("banner")[0];
@@ -270,6 +270,29 @@ 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 timer = document.getElementsByClassName("timer")[0];
+                       timer.innerHTML = `${minutesString}:${secondsString}`;
+                       if (data.showingTimer == "true") {
+                               timer.classList.add("show");
+                       } else {
+                               timer.classList.remove("show");
+                       }
+
+
                        const badgeContainer = document.getElementsByClassName("badgeContainer")[0];
                        if (discount <= 0.99) {
                                badgeContainer.classList.add("show");
@@ -429,11 +452,11 @@ setInterval(update, 500);
 setInterval(draw, 500)
                </script>
        </head>
-       <body onload="frame();update();draw();">
+       <body id="all" class="show" onload="frame();update();draw();">
 
                <canvas id="canvas" style="display: none;"></canvas>
 
-               <div class="container side">
+               <div class="container side show">
                        <div class="box main">
                                <h1 id="code"></h1>
                                <h2 class="feature" id="subtext"></h2>