]> OzVa Git service - shopping-channel/commitdiff
Added % left to the autocue
authorwill <greenwoodw50@gmail.com>
Wed, 28 Aug 2024 14:47:50 +0000 (15:47 +0100)
committerwill <greenwoodw50@gmail.com>
Wed, 28 Aug 2024 14:47:50 +0000 (15:47 +0100)
auth/index.php
autocue/index.html

index 9b169cfc4ea3ab5f36c8693d972b015deeb18ec5..3bdccab3f4ddff029fd27cb3b257a77bcd817327 100644 (file)
@@ -157,7 +157,9 @@ fieldtext > .split {
        border: 2px solid red;
        background-color: rgba(255, 255, 255, 0.7);
 }
-s {color: green;}
+s {
+       color: green;
+}
 .clock {
        position: relative;
        width: 100%;
@@ -515,7 +517,7 @@ for ($i = 0; $i < 360; $i += $clockIncrement) {
                                <li><s>Make this notes section a little better? it might actually be useful during the show. Although the arrow is quite difficult to click on</s></li>
                                <li><s>Add the controls for persentage sold and the relevant display on the GFX side of things</s></li>
                                <li><s>Add 2 more timers on both the controls and the GFX page</s></li>
-                               <li>Add the <s>timers and the</s> % sold to the autocue so the presenter can atually see what theyre doing</li>
+                               <li><s>Add the timers and the % sold to the autocue so the presenter can atually see what theyre doing</s></li>
                                <li>Add a clock display to the GFX page and the autocue (could just be a gereric time?)</li>
                                <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>
index 4d7a858c0cc77017e3ba0911594fdab9d9d3c0bc..cb23a146b4ff8bb57cf66ac046ac5d5d9cb7c29f 100644 (file)
@@ -22,6 +22,7 @@ body {
                </style>
                <script>
 var itemId = 0;
+var unsold = 1;
 
 function makeTime(t, o, s) {
        let current = Math.round((Date.now() + o) / 1000);
@@ -51,21 +52,28 @@ function frame() {
 }
 
 function update() {
-        fetch("../data.json", {cache: "no-store"})
-                .then(data => data.json())
-                .then(data => {
+       fetch("../data.json", {cache: "no-store"})
+               .then(data => data.json())
+               .then(data => {
                        itemId = data.itemId;
                        var timers = document.getElementsByClassName("time");
                        timers[0].innerHTML = makeTime(data.timer1End, data.timerOffset, data.showingTimer1);
                        timers[1].innerHTML = makeTime(data.timer2End, data.timerOffset, data.showingTimer2);
                        timers[2].innerHTML = makeTime(data.timer3End, data.timerOffset, data.showingTimer3);
+                       unsold = data.percentLeft / 100;
                })
        fetch("../items.json", {cache: "no-store"})
-                .then(data => data.json())
-                .then(data => {
-                        const noteContainer = document.getElementById("notes");
+               .then(data => data.json())
+               .then(data => {
+                       const noteContainer = document.getElementById("notes");
                        noteContainer.innerHTML = data[itemId].notes;
-                })
+
+                       const left = document.getElementById("left");
+                       const stock = document.getElementById("stock");
+                       left.innerHTML = Math.round(data[itemId].stockCount * unsold);
+                       stock.innerHTML = data[itemId].stockCount;
+
+               })
 }
 
 setInterval(frame, 50);
@@ -78,7 +86,8 @@ setInterval(update, 1000);
                <div id="timer">
                        T1: <span style="background-color: red;" class="time"></span> -
                        T2: <span style="background-color: green;" class="time"></span> -
-                       T3: <span style="background-color: blue;" class="time"></span>
+                       T3: <span style="background-color: blue; margin-right: 40px;" class="time"></span>
+                       Left: <span id="left"></span>/<span id="stock"></span>
                </div>
        </body>
 </html>