Compare commits
No commits in common. "d8086030918a3d6cbdf00ddf64f2b672cc9dbd88" and "1415f2a8f05c24ff26254a30e1a2b0fec92496d3" have entirely different histories.
d808603091
...
1415f2a8f0
|
|
@ -1,45 +1,39 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="pl">
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>Informacje</title>
|
<title>Informacje</title>
|
||||||
<style>
|
<style>
|
||||||
:root { height: 100%; }
|
:root { height: 100%; }
|
||||||
html, body { height: 100%; margin: 0; font-family: Helvetica, Arial, sans-serif; color: #000; overflow-x: hidden; background: #fdb515; }
|
html, body { height: 100%; margin: 0; font-family: Helvetica, Arial; color: #000; }
|
||||||
.viewport { display: flex; flex-direction: column; height: 100vh; min-height: 100%; }
|
.viewport { display: flex; flex-direction: column; height: 100vh; min-height: 100%; }
|
||||||
.video-area { flex: 0 0 85%; position: relative; overflow: hidden; background: #000; }
|
.video-area { flex: 0 0 85%; position: relative; overflow: hidden; background: #000; }
|
||||||
|
|
||||||
|
body { background: #fdb515; }
|
||||||
|
|
||||||
.info-bar {
|
.info-bar {
|
||||||
flex: 0 0 15%;
|
flex: 0 0 15%;
|
||||||
background: #fdb515;
|
background: #fdb515;
|
||||||
color: #000;
|
color: #000;
|
||||||
|
display: flex;
|
||||||
|
// display: block;
|
||||||
|
width: 300% ;
|
||||||
|
align-items: center;
|
||||||
|
vertical-align:middle;
|
||||||
|
box-sizing: border-box;
|
||||||
height: 15vh;
|
height: 15vh;
|
||||||
min-height: 50px;
|
min-height: 50px;
|
||||||
box-sizing: border-box;
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding-left: 4vh;
|
padding-left: 4vh;
|
||||||
padding-right: 4vh;
|
padding-right: 4vh;
|
||||||
}
|
overflow: hidden;
|
||||||
|
|
||||||
#scroll-content {
|
|
||||||
display: inline-block;
|
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
margin-left: 100%;
|
animation: scroll-left 20s linear infinite;
|
||||||
animation: scroll-left var(--duration, 20s) linear infinite;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#gap {
|
@keyframes scroll-left {
|
||||||
display: inline-block;
|
from { transform: translateX(100%); }
|
||||||
width: var(--gap-width, 500px);
|
to { transform: translateX(-100%); }
|
||||||
}
|
|
||||||
|
|
||||||
#text-1, #text-2 {
|
|
||||||
display: inline-block;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.video-area video {
|
.video-area video {
|
||||||
|
|
@ -52,11 +46,10 @@
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
#scroll-content, .num-inline, #text-1, #text-2 {
|
.info-bar, .info-bar .info-left, .info-bar .info-right {
|
||||||
font-size: 5vh;
|
font-size: 5vh;
|
||||||
font-weight:700;
|
font-weight:700;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
vertical-align: middle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.num-inline {
|
.num-inline {
|
||||||
|
|
@ -70,45 +63,12 @@
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes scroll-left {
|
|
||||||
from { transform: translateX(0); }
|
|
||||||
to { transform: translateX(var(--scroll-distance)); }
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 700px) {
|
@media (max-width: 700px) {
|
||||||
.video-area { flex-basis: 70%; }
|
.video-area { flex-basis: 70%; }
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const SPEED_FACTOR = 0.006;
|
|
||||||
const CUSTOM_GAP_WIDTH = 1920;
|
|
||||||
|
|
||||||
function updateAnimation(scrollContentElement, combinedText) {
|
|
||||||
|
|
||||||
const tempElement = document.createElement('span');
|
|
||||||
tempElement.style.whiteSpace = 'nowrap';
|
|
||||||
tempElement.style.fontSize = '5vh';
|
|
||||||
tempElement.style.fontWeight = '700';
|
|
||||||
tempElement.innerHTML = combinedText;
|
|
||||||
|
|
||||||
document.body.appendChild(tempElement);
|
|
||||||
const contentWidth = tempElement.offsetWidth;
|
|
||||||
document.body.removeChild(tempElement);
|
|
||||||
|
|
||||||
const totalScrollDistance = contentWidth + CUSTOM_GAP_WIDTH;
|
|
||||||
|
|
||||||
const duration = totalScrollDistance * SPEED_FACTOR;
|
|
||||||
|
|
||||||
scrollContentElement.style.setProperty('--scroll-distance', `-${totalScrollDistance}px`);
|
|
||||||
scrollContentElement.style.setProperty('--duration', `${duration}s`);
|
|
||||||
|
|
||||||
document.getElementById('gap').style.setProperty('--gap-width', `${CUSTOM_GAP_WIDTH}px`);
|
|
||||||
|
|
||||||
document.getElementById('text-1').innerHTML = combinedText;
|
|
||||||
document.getElementById('text-2').innerHTML = combinedText;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function fetchCurrent() {
|
async function fetchCurrent() {
|
||||||
try {
|
try {
|
||||||
const r = await fetch('/current', { cache: 'no-store' });
|
const r = await fetch('/current', { cache: 'no-store' });
|
||||||
|
|
@ -117,24 +77,16 @@
|
||||||
const nums = j.current || [];
|
const nums = j.current || [];
|
||||||
const waitingCount = j.waiting != null ? j.waiting : '0';
|
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 infoText = 'Chcesz spróbować swoich sił w lutowaniu? Odbierz numer i sprawdzaj kolejkę na queue.hswro.org';
|
||||||
const numsFormatted = nums.map(n => `<span class="num-inline">${n}</span>`).join(' ');
|
const numsFormatted = nums.map(n => `<span class="num-inline">${n}</span>`).join(' ');
|
||||||
const numList = nums.length > 0 ? `| Zapraszamy z numerami: ${numsFormatted}` : '';
|
const numList = nums.length > 0 ? `| Zapraszamy z numerami: ${numsFormatted}` : '';
|
||||||
const combinedText = `${infoText} | Oczekujących: ${waitingCount} ${numList}`;
|
const combinedText = `${infoText} | Oczekujących: ${waitingCount} ${numList}`;
|
||||||
|
|
||||||
const scrollContentElement = document.getElementById('scroll-content');
|
// Wstawienie tekstu do dolnego paska
|
||||||
|
document.getElementById('info-bar-text-1').innerHTML = combinedText;
|
||||||
scrollContentElement.style.animationPlayState = 'paused';
|
// document.getElementById('info-bar-text-2').innerHTML = combinedText;
|
||||||
updateAnimation(scrollContentElement, combinedText);
|
|
||||||
setTimeout(() => {
|
|
||||||
scrollContentElement.style.animationPlayState = 'running';
|
|
||||||
}, 50);
|
|
||||||
|
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('fetchCurrent error', e);
|
console.error('fetchCurrent error', e);
|
||||||
const scrollContentElement = document.getElementById('scroll-content');
|
|
||||||
scrollContentElement.style.animationPlayState = 'running';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -153,11 +105,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="info-bar">
|
<div class="info-bar">
|
||||||
<div id="scroll-content">
|
<div id="info-bar-text-1" class="info-left">-</div>
|
||||||
<span id="text-1">-</span>
|
|
||||||
<span id="gap"> </span>
|
|
||||||
<span id="text-2">-</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue