diff --git a/src/templates/infokiosk.html b/src/templates/infokiosk.html index b2e63ea..1e08dc4 100644 --- a/src/templates/infokiosk.html +++ b/src/templates/infokiosk.html @@ -1,112 +1,164 @@ - + - - - Informacje - + .num-inline { + display: inline-block; + margin-left: 1vh; + padding: 1.6vh 1.2vh; + border: 0.4vh solid #000; + border-radius: 0.8vh; + background: transparent; + line-height: 1; + vertical-align: middle; + } - + async function fetchCurrent() { + try { + const r = await fetch('/current', { cache: 'no-store' }); + const j = await r.json(); + + const nums = j.current || []; + const waitingCount = j.waiting != null ? j.waiting : '0'; + + const infoText = 'Chcesz spróbować swoich sił w lutowaniu? Odbierz numer i sprawdzaj kolejkę na queue.hswro.org'; + const numsFormatted = nums.map(n => `${n}`).join(' '); + const numList = nums.length > 0 ? `| Zapraszamy z numerami: ${numsFormatted}` : ''; + const combinedText = `${infoText} | Oczekujących: ${waitingCount} ${numList}`; + + const scrollContentElement = document.getElementById('scroll-content'); + + scrollContentElement.style.animationPlayState = 'paused'; + updateAnimation(scrollContentElement, combinedText); + setTimeout(() => { + scrollContentElement.style.animationPlayState = 'running'; + }, 50); + + + } catch (e) { + console.error('fetchCurrent error', e); + const scrollContentElement = document.getElementById('scroll-content'); + scrollContentElement.style.animationPlayState = 'running'; + } + } + + window.addEventListener('load', () => { + fetchCurrent(); + setInterval(fetchCurrent, 5000); + }); + -
+
- +
-
-
+
+ - +   + - +
-
+
- + \ No newline at end of file