From: Max Value Date: Mon, 7 Apr 2025 00:37:41 +0000 (+0100) Subject: Added shout and rearranged panels X-Git-Url: https://git.ozva.co.uk/?a=commitdiff_plain;h=180bc833cad2730f3825efb5da9900733eb03d83;p=shopping-channel Added shout and rearranged panels + added shout on the timer panel with sound on activation + star for shout display + number redact switch to admin panels (not implemented into GFX yet) ~ changed discount system to automatically set the 4 discounts (now on the timer pannel) ~ moved some other panels - removed database specified currency in favor of item specified --- diff --git a/data.db b/data.db index 2f81fe0..22d712e 100755 Binary files a/data.db and b/data.db differ diff --git a/schema b/schema index 5869f54..c117b71 100644 --- a/schema +++ b/schema @@ -1,17 +1,16 @@ CREATE TABLE state ( id INTEGER PRIMARY KEY, item_id INTEGER, + discount INTEGER, discount_1 INTEGER, discount_2 INTEGER, discount_3 INTEGER, discount_4 INTEGER, discount_change INTEGER, percent_remaining INTEGER, - currency_symbol TEXT, crawler_top_index INTEGER, list_crawler_bottom TEXT, banner_index INTEGER, - bool_prefix INTEGER, bool_rounding INTEGER, bool_all INTEGER, bool_product INTEGER, @@ -29,6 +28,7 @@ CREATE TABLE state ( end_timer_5 INTEGER, end_timer_6 INTEGER, end_timer_main INTEGER, + end_timer_shout INTEGER, focus_timer_1 INTEGER, focus_timer_2 INTEGER, focus_timer_3 INTEGER, @@ -39,23 +39,23 @@ CREATE TABLE state ( current_position INTEGER, movement_speed INTEGER, movement_function TEXT, + shout TEXT, note TEXT ); INSERT INTO state ( id, item_id, + discount, discount_1, discount_2, discount_3, discount_4, discount_change, percent_remaining, - currency_symbol, crawler_top_index, list_crawler_bottom, banner_index, - bool_prefix, bool_rounding, bool_all, bool_product, @@ -72,6 +72,8 @@ INSERT INTO state ( end_timer_4, end_timer_5, end_timer_6, + end_timer_main, + end_timer_shout, focus_timer_1, focus_timer_2, focus_timer_3, @@ -82,4 +84,5 @@ INSERT INTO state ( current_position, movement_speed, movement_function, - note) VALUES (1, 0, 0.0, 0.0, 0.0, 0.0, 50, 100, '£', 0, '[0,1]', 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 40, 'linear', 'test note'); + shout, + note) VALUES (1, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 50, 100, 0, '[0,1]', 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 40, 'linear', 'test shout', 'test note'); diff --git a/static/assets/star5.svg b/static/assets/star5.svg new file mode 100644 index 0000000..7ad77ec --- /dev/null +++ b/static/assets/star5.svg @@ -0,0 +1,68 @@ + + + + + + + + + + image/svg+xml + + + + + + diff --git a/static/sounds/shout.wav b/static/sounds/shout.wav new file mode 100644 index 0000000..a760531 Binary files /dev/null and b/static/sounds/shout.wav differ diff --git a/static/static.json b/static/static.json index 42b280b..1b2598d 100755 --- a/static/static.json +++ b/static/static.json @@ -111,8 +111,8 @@ "rating":"★★★★★", "subtext":"Starting soon!", "description":"The show will be starting soon!", - "currency":"£", - "prefix":true, + "currency":" Units", + "prefix":false, "origional_price":1, "gallery_price":1, "cost_price":1, diff --git a/teleshopping.py b/teleshopping.py index 5ea6743..cd4b51f 100755 --- a/teleshopping.py +++ b/teleshopping.py @@ -132,6 +132,8 @@ def admin_page(page): WHERE id = 1; """ + print(query) + cursor.execute(query) connection.commit() @@ -265,7 +267,7 @@ def check_database(): cursor.execute(load) connection.commit() - generate_docs() # This might be a bad idea + # generate_docs() # This might be a bad idea first_request = False diff --git a/templates/gfx.html b/templates/gfx.html index ccb8e65..e61f093 100644 --- a/templates/gfx.html +++ b/templates/gfx.html @@ -16,6 +16,8 @@ body { opacity: 0; transition: opacity 1.5s; + + overflow: hidden; } @keyframes spin { 0% {transform: rotate(0turn) scale(1.2);} @@ -24,11 +26,46 @@ body { 75% {transform: rotate(0.75turn) scale(1);} 100% {transform: rotate(1turn) scale(1.2);} } +@keyframes spinOffset { + 0% {transform: perspective(300px) translate(-50%, -50%) rotateY( 15deg ) rotateZ(0turn) scale(1.2);} + 25% {transform: perspective(300px) translate(-50%, -50%) rotateY( 15deg ) rotateZ(0.25turn) scale(1);} + 50% {transform: perspective(300px) translate(-50%, -50%) rotateY( 15deg ) rotateZ(0.5turn) scale(1.2);} + 75% {transform: perspective(300px) translate(-50%, -50%) rotateY( 15deg ) rotateZ(0.75turn) scale(1);} + 100% {transform: perspective(300px) translate(-50%, -50%) rotateY( 15deg ) rotateZ(1turn) scale(1.2);} +} @keyframes spinText { 0% {transform: rotate(-0.01turn);} 50% {transform: rotate(0.01turn);} 100% {transform: rotate(-0.01turn);} } +@keyframes spinTextOffset { + 0% {transform: perspective(400px) translateX(-50%) rotateY( -15deg ) rotateZ(-0.01turn);} + 50% {transform: perspective(400px) translateX(-50%) rotateY( -15deg) rotateZ(0.01turn);} + 100% {transform: perspective(400px) translateX(-50%) rotateY( -15deg ) rotateZ(-0.01turn);} +} +@keyframes flicker { + 0% { + color: black; + text-shadow: -2px -2px 0 #FFF, 2px -2px 0 #FFF, -2px 2px 0 #FFF, 2px 2px 0 #FFF; + } + 49.999% { + color: black; + text-shadow: -2px -2px 0 #FFF, 2px -2px 0 #FFF, -2px 2px 0 #FFF, 2px 2px 0 #FFF; + } + 50% { + color: white; + text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000; + } + 99.999% { + color: white; + text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000; + } + 100% { + color: black; + text-shadow: -2px -2px 0 #FFF, 2px -2px 0 #FFF, -2px 2px 0 #FFF, 2px 2px 0 #FFF; + } +} + .container { position: absolute; } @@ -267,6 +304,49 @@ body { text-align: center; /*text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;*/ } +#shoutContainer { + position: absolute; + top: 50vh; + left: 50vw; + padding: 0; +} +#shoutBadgeContainer { + opacity: 0; + transform: translateX(-30vw); + transition: opacity 2s ease, transform 2s ease; +} +#shoutContainer.show > #shoutBadgeContainer { + opacity: 1; + transform: translateX(0vw); +} +#shoutTextContainer { + position: absolute; + top: 0vh; + opacity: 0; + transform: translateX(30vw); + transition: opacity 2s ease, transform 2s ease; + animation: flicker 1s linear 0s infinite; +} +#shoutContainer.show > #shoutTextContainer { + opacity: 1; + transform: translateX(0vw); +} +#shoutBadgeContainer > img { + width: 40vh; + height: 40vh; + padding: 0; + animation: spinOffset 10s linear 0s infinite; +} +#shout { + position: absolute; + top: -1em; + width: 100vw; + perspective: 400px; + animation: spinTextOffset 10s linear 0s infinite; + rotate: 0.025turn; + font-size: 6em; + text-align: center; +} #currentPrice { line-height: 0.5em; } @@ -457,6 +537,14 @@ circle {
+
+
+ +
+
+

SHOUT TEXT

+
+
@@ -612,6 +700,7 @@ function update() { topText = dataStatic.text.crawler_top[data.crawler_top_index] bottomText = []; for (let i of data.list_crawler_bottom) {bottomText.push(dataStatic.text.crawler_bottom[i])} + shout // handle all optional elements showing/hiding if (data.bool_all) {all.classList.add("show");} @@ -710,6 +799,16 @@ function update() { badgeContainer.classList.remove("show"); } + // Shout + document.getElementById("shout").innerHTML = data.shout; + let current = Math.round((Date.now() + data['timer_offset']) / 1000); + var time = data[`end_timer_shout`] - current; + if (time > 0) { + document.getElementById("shoutContainer").classList.add("show"); + } else { + document.getElementById("shoutContainer").classList.remove("show"); + } + // Sigil handling for (let s = 0; s < 4; s++) { if (data[`bool_sigil_${s+1}`]) { @@ -749,13 +848,16 @@ function update() { price = Math.round(price * 100) / 100; } + console.log(item.currency); + console.log(item.prefix); + let priceString; let ezString; - if (data.bool_prefix) {priceString = `${data.currency_symbol}${price}`} - else {priceString = `${price}${data.currency_symbol}`}; + if (item.prefix) {priceString = `${item.currency}${price}`} + else {priceString = `${price}${item.currency}`}; let ezPrice = Math.round((price * 1.1) / 12); - if (data.bool_prefix) {ezString = `${data.currency_symbol}${ezPrice}`} - else {ezString = `${ezPrice}${data.currency_symbol}`}; + if (item.prefix) {ezString = `${item.currency}${ezPrice}`} + else {ezString = `${ezPrice}${item.currency}`}; // set discount, pricing and ez pay document.getElementById("currentPrice").innerHTML = `Now only: ${priceString}`; @@ -769,8 +871,8 @@ function update() { if (discount.reduce((a, b)=> a*b, 1) <= 0.99) { let origionalPrice = Math.round(item.origional_price); - if (data.bool_prefix) {origionalString = `${data.currency_symbol}${origionalPrice}`} - else {origionalString = `${origionalPrice}${data.currency_symbol}`}; + if (item.prefix) {origionalString = `${item.currency}${origionalPrice}`} + else {origionalString = `${origionalPrice}${item.currency}`}; origional.innerHTML = `WAS: ${origionalString}`; } else { origional.innerHTML = `NOW: ${priceString}`; diff --git a/templates/price.html b/templates/price.html index c4b7d4e..f456b01 100644 --- a/templates/price.html +++ b/templates/price.html @@ -62,29 +62,21 @@
Pricing - - - {% if data.bool_prefix %} - - - - - {% else %} - - - - - {% endif %} -


+ + +
+ Individual discounts (automatic)
{% for d in (1,2,3,4) %} - -
+ + +
{% endfor %} +
@@ -103,7 +95,73 @@ {% endif %}
- +
+ {% for d in (1,2,3,4) %} + + {% endfor %} +
+ + + + diff --git a/templates/sounds.html b/templates/sounds.html index fbbd440..0420681 100644 --- a/templates/sounds.html +++ b/templates/sounds.html @@ -14,27 +14,29 @@ - Timer 1 + Timer 2 - Timer 1 + Timer 3 - Timer 1 + Timer 4 - Timer 1 + Timer 5 - Timer 1 + Timer 6

Doomsday

+

Shout

+
@@ -61,6 +63,7 @@ let pastTime = [ 0 ]; let pastClock = 0; +let pastShout = 0; let timersPlaying = 0; const context = new AudioContext(); @@ -96,6 +99,7 @@ const timers = [ document.getElementById("clock") ]; const clock = document.getElementById("clock"); +const shout = document.getElementById("shout"); for (let t = 0; t < 6; t++) { let timer = timers[t]; @@ -132,6 +136,17 @@ function getTimes() { clock.play(); } + if (pastShout != data["end_timer_shout"]) { + pastShout = data["end_timer_shout"] + if (context.state === "suspended") { + context.resume(); + } + + console.log(`Shout!`); + shout.currentTime = 0.0; + shout.play(); + } + timersPlaying = 0; for (let t = 0; t < 6; t++) { // if the timer is playing @@ -187,9 +202,11 @@ function updateLeveler() { targetLevel = 1 / timersPlaying; } if (clock.currentTime > 0 && !clock.paused && !clock.ended) { - //targetLevel *= 0.75; targetWet = 0.75; } + if (shout.currentTime > 0 && !shout.paused && !shout.ended) { + targetLevel *= 0.75; + } if (Math.abs(targetLevel - amp.gain.value) < 0.1 / levelLength) { amp.gain.value = targetLevel; diff --git a/templates/text.html b/templates/text.html index 25218a7..71140a5 100644 --- a/templates/text.html +++ b/templates/text.html @@ -78,6 +78,21 @@ {% endfor %} +
+ Number + {% if data.bool_number %} + + + + + {% else %} + + + + + {% endif %} +
+
Note diff --git a/templates/timer.html b/templates/timer.html index efe7ae6..a91a98b 100644 --- a/templates/timer.html +++ b/templates/timer.html @@ -51,6 +51,19 @@ +
+ +
+
+ Shout text + + + + +
+ +
+