From 78dacff90d5bbbce09a75a6808173b939392620b Mon Sep 17 00:00:00 2001 From: Florian Sorg Date: Sun, 27 Dec 2020 20:36:52 +0100 Subject: [PATCH 1/3] update bauchbinde --- static/bauchbinde/assets/script.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/static/bauchbinde/assets/script.js b/static/bauchbinde/assets/script.js index b814def..b91aeba 100644 --- a/static/bauchbinde/assets/script.js +++ b/static/bauchbinde/assets/script.js @@ -11,6 +11,7 @@ let time = null; let startDelay = 1000; let gracePeriod = 5; + let interval = null; async function getCurrentTalkByRoomName(roomName, offset) { if (!offset) { @@ -94,7 +95,10 @@ root.style.setProperty('--width', value); } if (key === 'gracePeriod') { - gracePeriod = parseInt(value, 10) + gracePeriod = parseInt(value, 10); + } + if (key === 'interval') { + interval = parseInt(value, 10); } } } @@ -283,10 +287,17 @@ await new Promise(r => setTimeout(r, 1000)); } - window.addEventListener('load', async () => { + async function cycle() { if (await init()) { await new Promise(r => setTimeout(r, startDelay)); await animate(); } + if (interval) { + setTimeout(cycle, interval * 1000); + } + } + + window.addEventListener('load', () => { + cycle(); }); })(); From f266d65cd9b73dcb142872851671dfff2540b2c9 Mon Sep 17 00:00:00 2001 From: Florian Sorg Date: Sun, 27 Dec 2020 21:17:37 +0100 Subject: [PATCH 2/3] update bauchbinde --- static/bauchbinde/assets/script.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/static/bauchbinde/assets/script.js b/static/bauchbinde/assets/script.js index b91aeba..0c04204 100644 --- a/static/bauchbinde/assets/script.js +++ b/static/bauchbinde/assets/script.js @@ -6,11 +6,11 @@ let headline = null; let speaker = null; let isIntro = false; - let holdDuration = 4000; + let holdDuration = 10; let room = null; let time = null; - let startDelay = 1000; - let gracePeriod = 5; + let startDelay = 1; + let gracePeriod = 360; let interval = null; async function getCurrentTalkByRoomName(roomName, offset) { @@ -22,7 +22,7 @@ now = Date.parse(time) + offset; } - if (!data) { + if (!offset || !data) { const response = await fetch(scheduleUrl); data = await response.json(); } @@ -104,7 +104,7 @@ } if (room) { - let offset = gracePeriod * 60 * 1000; + let offset = gracePeriod * 1000; let talk = await getCurrentTalkByRoomName(room); if (!talk) { talk = await getCurrentTalkByRoomName(room, -offset); @@ -195,7 +195,7 @@ fadeInText(), ]); } - await new Promise(r => setTimeout(r, holdDuration)); + await new Promise(r => setTimeout(r, holdDuration * 1000)); await Promise.all([ fadeOut(), fadeOutText(), @@ -289,7 +289,7 @@ async function cycle() { if (await init()) { - await new Promise(r => setTimeout(r, startDelay)); + await new Promise(r => setTimeout(r, startDelay * 1000)); await animate(); } if (interval) { From 70e4125d637ab8d11016d95ff5308c46e478f722 Mon Sep 17 00:00:00 2001 From: Florian Sorg Date: Sun, 27 Dec 2020 23:50:47 +0100 Subject: [PATCH 3/3] update bauchbinde --- static/bauchbinde/assets/script.js | 3 +++ static/bauchbinde/assets/style.css | 2 ++ 2 files changed, 5 insertions(+) diff --git a/static/bauchbinde/assets/script.js b/static/bauchbinde/assets/script.js index 0c04204..d3c9ca8 100644 --- a/static/bauchbinde/assets/script.js +++ b/static/bauchbinde/assets/script.js @@ -91,6 +91,9 @@ if (key === 'bottom') { root.style.setProperty('--bottom', value); } + if (key === 'top') { + root.style.setProperty('--top', value); + } if (key === 'width') { root.style.setProperty('--width', value); } diff --git a/static/bauchbinde/assets/style.css b/static/bauchbinde/assets/style.css index f45b9ab..8726f2e 100644 --- a/static/bauchbinde/assets/style.css +++ b/static/bauchbinde/assets/style.css @@ -11,6 +11,7 @@ --bottom: 9vw; --left: 12.5vw; --width: 67.5vw; + --top: auto; } :root.theme-main { @@ -45,6 +46,7 @@ body { bottom: var(--bottom); left: var(--left); width: var(--width); + top: var(--top); } .background {