From: Max Value Date: Sun, 20 Apr 2025 09:49:56 +0000 (+0100) Subject: Small tweaks and housekeeping X-Git-Url: https://git.ozva.co.uk/?a=commitdiff_plain;h=caf14c0d786dac5d204af7ef267819a0aff40d04;p=shopping-channel Small tweaks and housekeeping + added submit on enter for the pricing form ~ reversed direction of the crawler - removed pacifico font in monthy payments and description - removed "remove shout" button (messes with sounds) --- diff --git a/templates/gfx.html b/templates/gfx.html index b298261..7efa9aa 100644 --- a/templates/gfx.html +++ b/templates/gfx.html @@ -159,7 +159,6 @@ body { } #subtext { color: white; - font-family: "Pacifico"; background-color: var(--blue); } #banner { @@ -213,7 +212,7 @@ body { font-weight: bold; text-align: center; } -#origionalPrice { +#currentPrice { color: var(--red); font-size: 2em; } @@ -372,12 +371,11 @@ body { font-size: 10em; text-align: center; } -#currentPrice { +#origionalPrice { line-height: 0.5em; } #monthlyPrice { line-height: 1em; - font-family: "Pacifico"; } .main > hr, .extra > hr { margin: 0 1vh; @@ -511,7 +509,7 @@ body { - + @@ -522,7 +520,7 @@ body {

Subtext

Description


-

Origional Price

+

Current Price

Percent off

@@ -541,7 +539,7 @@ body {
-

Current Price

+

Origional Price

Monthly Price

In stock: Sold:

@@ -831,7 +829,7 @@ function update() { else {origionalString = `${origionalPrice}${item.currency}`}; origional.innerHTML = `WAS: ${origionalString}`.replaceAll(rep, "█"); } else { - origional.innerHTML = `NOW: ${priceString}`.replaceAll(rep, "█"); + origional.innerHTML = "Amazing offer!"; } if (data.percent_remaining == 0) { @@ -854,6 +852,7 @@ function update() { let marqueeOffset = 0; let bottomTextIndex = 0; +let bottomTextWidth = 0; // function handles all animated events that are required to look smooth (marquee movement / price changes) (200 times per second) function frame() { @@ -866,10 +865,11 @@ function frame() { } bottomTextElement.style.transform = `translateX(${marqueeOffset}px)`; - marqueeOffset += 0.2; + marqueeOffset -= 0.2; // only replace text where neccicary or where the page has just loaded - if (marqueeOffset >= marqueeContainer.offsetWidth || (topTextElement.innerHTML == "" && bottomTextElement.innerHTML == "")) { + if (marqueeOffset < -bottomTextWidth || (topTextElement.innerHTML == "" && bottomTextElement.innerHTML == "")) { + if (bottomText.length == 0) {return} topTextElement.innerHTML = topText.replaceAll(rep, "█"); @@ -889,7 +889,9 @@ function frame() { ctx.font = `bold ${fontSize}px sans-serif`; let text = ctx.measureText(bottomTextElement.innerHTML); - marqueeOffset = -1.1 * text.width; // place text just before its end-point + bottomTextWidth = text.width; + + marqueeOffset = window.innerHeight ; // place text just before its end-point } } @@ -903,9 +905,10 @@ function sigil () { document.getElementById(`sigil${sigilCounter}`).classList.add("show"); } -setInterval(frame, 5); + setInterval(sigil, 100); setInterval(update, 500); +setInterval(frame, 5); diff --git a/templates/price.html b/templates/price.html index 6203b2d..802413b 100644 --- a/templates/price.html +++ b/templates/price.html @@ -102,11 +102,21 @@ {% endfor %}
- +