update bauchbinde
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Florian Sorg 2020-12-27 20:36:52 +01:00
parent a46de179ae
commit 78dacff90d
1 changed files with 13 additions and 2 deletions

View File

@ -11,6 +11,7 @@
let time = null; let time = null;
let startDelay = 1000; let startDelay = 1000;
let gracePeriod = 5; let gracePeriod = 5;
let interval = null;
async function getCurrentTalkByRoomName(roomName, offset) { async function getCurrentTalkByRoomName(roomName, offset) {
if (!offset) { if (!offset) {
@ -94,7 +95,10 @@
root.style.setProperty('--width', value); root.style.setProperty('--width', value);
} }
if (key === 'gracePeriod') { 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)); await new Promise(r => setTimeout(r, 1000));
} }
window.addEventListener('load', async () => { async function cycle() {
if (await init()) { if (await init()) {
await new Promise(r => setTimeout(r, startDelay)); await new Promise(r => setTimeout(r, startDelay));
await animate(); await animate();
} }
if (interval) {
setTimeout(cycle, interval * 1000);
}
}
window.addEventListener('load', () => {
cycle();
}); });
})(); })();