From c374881274c0da98d9b2eb4f016e29e3b201e428 Mon Sep 17 00:00:00 2001 From: Florian Sorg Date: Mon, 28 Dec 2020 16:24:17 +0100 Subject: [PATCH] update bauchbinde --- static/bauchbinde/assets/script.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/static/bauchbinde/assets/script.js b/static/bauchbinde/assets/script.js index d3c9ca8..7d66ca6 100644 --- a/static/bauchbinde/assets/script.js +++ b/static/bauchbinde/assets/script.js @@ -1,6 +1,8 @@ (() => { const scheduleUrl = 'https://schedule2.broken.equipment/everything.schedule.json'; + let isFirstRun = true; + let autoIntro = false; let data = null; let textEl; let headline = null; @@ -69,6 +71,9 @@ if (key === 'intro') { isIntro = !!parseInt(value, 10) } + if (key === 'autoIntro') { + autoIntro = !!parseInt(value, 10) + } if (key === 'hold') { holdDuration = parseInt(value, 10); } @@ -187,7 +192,7 @@ } async function animate() { - if (isIntro) { + if (autoIntro ? isFirstRun : isIntro) { await Promise.all([ slideIn(), fadeInText(), @@ -297,6 +302,7 @@ } if (interval) { setTimeout(cycle, interval * 1000); + isFirstRun = false; } }