From 3407da6fa9018938b3e58f2810620029644efde4 Mon Sep 17 00:00:00 2001 From: Luca Date: Sun, 27 Dec 2020 13:32:40 +0100 Subject: [PATCH 1/7] update 'bauchbinde' --- static/bauchbinde/assets/script.js | 81 ++++++++++++++++++++---------- 1 file changed, 55 insertions(+), 26 deletions(-) diff --git a/static/bauchbinde/assets/script.js b/static/bauchbinde/assets/script.js index 2f7ec7c..b814def 100644 --- a/static/bauchbinde/assets/script.js +++ b/static/bauchbinde/assets/script.js @@ -1,23 +1,31 @@ (() => { const scheduleUrl = 'https://schedule2.broken.equipment/everything.schedule.json'; + let data = null; let textEl; - let headline = '¯\\_(ツ)_/¯'; - let speaker = ''; + let headline = null; + let speaker = null; let isIntro = false; let holdDuration = 4000; let room = null; let time = null; let startDelay = 1000; + let gracePeriod = 5; - async function getCurrentTalkByRoomName(roomName) { - let now = Date.now(); + async function getCurrentTalkByRoomName(roomName, offset) { + if (!offset) { + offset = 0; + } + let now = Date.now() + offset; if (time) { - now = Date.parse(time) + now = Date.parse(time) + offset; + } + + if (!data) { + const response = await fetch(scheduleUrl); + data = await response.json(); } - const response = await fetch(scheduleUrl); - const data = await response.json(); const days = data.schedule.conference.days; const today = days.find(day => { const start = Date.parse(day.day_start); @@ -85,14 +93,24 @@ if (key === 'width') { root.style.setProperty('--width', value); } + if (key === 'gracePeriod') { + gracePeriod = parseInt(value, 10) + } } } if (room) { - const talk = await getCurrentTalkByRoomName(room); + let offset = gracePeriod * 60 * 1000; + let talk = await getCurrentTalkByRoomName(room); if (!talk) { - headline = '¯\\_(ツ)_/¯'; - speaker = ''; + talk = await getCurrentTalkByRoomName(room, -offset); + } + if (!talk) { + talk = await getCurrentTalkByRoomName(room, offset); + } + if (!talk) { + headline = null; + speaker = null; } else { headline = talk.title; if (talk.persons) { @@ -101,7 +119,11 @@ } } - if (speaker) { + if (!headline) { + return false; + } + + if (speaker && headline) { headline += ','; } @@ -110,18 +132,22 @@ const speakerEl = document.createElement('span'); speakerEl.classList.add('speaker'); - Array.from(headline).forEach(letter => { - const letterEl = document.createElement('span'); - letterEl.classList.add('letter'); - letterEl.innerText = letter; - headlineEl.appendChild(letterEl); - }) - Array.from(speaker).forEach(letter => { - const letterEl = document.createElement('span'); - letterEl.classList.add('letter'); - letterEl.innerText = letter; - speakerEl.appendChild(letterEl); - }) + if (headline) { + Array.from(headline).forEach(letter => { + const letterEl = document.createElement('span'); + letterEl.classList.add('letter'); + letterEl.innerText = letter; + headlineEl.appendChild(letterEl); + }) + } + if (speaker) { + Array.from(speaker).forEach(letter => { + const letterEl = document.createElement('span'); + letterEl.classList.add('letter'); + letterEl.innerText = letter; + speakerEl.appendChild(letterEl); + }) + } textEl.appendChild(headlineEl); textEl.appendChild(document.createTextNode(' ')); @@ -149,6 +175,8 @@ } secondaryTilesEl.appendChild(tile); } + + return true; } async function animate() { @@ -256,8 +284,9 @@ } window.addEventListener('load', async () => { - await init(); - await new Promise(r => setTimeout(r, startDelay)); - await animate(); + if (await init()) { + await new Promise(r => setTimeout(r, startDelay)); + await animate(); + } }); })(); From e38e4a692628cb5105d3ba8110316d512750cb55 Mon Sep 17 00:00:00 2001 From: Stefan Schwarz Date: Sun, 27 Dec 2020 13:58:31 +0100 Subject: [PATCH 2/7] add rc3 stage --- content/rc3stage.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 content/rc3stage.md diff --git a/content/rc3stage.md b/content/rc3stage.md new file mode 100644 index 0000000..4046b54 --- /dev/null +++ b/content/rc3stage.md @@ -0,0 +1,11 @@ +--- +title: rC3 Stage +menu: + main: + weight: 3 +--- + +Go to {{}}streaming.media.ccc.de{{}} or watch here. + +{{