1
0
Fork 0
mirror of https://github.com/Kunsi/pretalx-plugin-broadcast-tools synced 2025-04-29 19:30:59 +00:00

initial commit

This commit is contained in:
Franzi 2021-11-20 09:05:08 +01:00
commit bdf7281b74
Signed by: kunsi
GPG key ID: 12E3D2136B818350
21 changed files with 563 additions and 0 deletions

View file

@ -0,0 +1,30 @@
* {
margin: 0;
padding: 0;
line-height: 1.2em;
}
#box {
width: 1020px;
position: absolute;
bottom: 80px;
left: 50%;
margin-left: -510px;
color: white;
font-family: "Muli","Open Sans","OpenSans","Helvetica Neue",Helvetica,Arial,sans-serif;
padding: 15px;
box-shadow: 5px 5px 10px 0px rgba(50, 50, 50, 0.75);
}
#title {
font-size: 30px;
font-weight: 500;
margin-bottom: 15px;
}
#speaker {
font-size: 20px;
}

View file

@ -0,0 +1,70 @@
schedule = null;
room_name = null;
$(function() {
$('#speaker').text('Content will appear soon.');
});
function update_lower_third() {
current_time = new Date(Date.now()).getTime()
try {
hash = decodeURIComponent(window.location.hash.substring(1));
room_name = hash;
} catch (e) {
console.error(e);
return
}
if (!schedule) {
console.warn("There's no schedule yet, exiting ...");
return
}
if (schedule['rooms'].length > 1 && !schedule['rooms'].includes(room_name)) {
$('#title').text('Error')
$('#speaker').text('Invalid room_name. Valid names: ' + schedule['rooms'].join(', '));
return
}
current_talk = null;
for (talk_i in schedule['talks']) {
talk = schedule['talks'][talk_i]
if (schedule['rooms'].length > 1 && talk['room'] != room_name) {
// not in this room
continue;
}
talk_start = new Date(talk['start']).getTime();
talk_end = new Date(talk['end']).getTime();
if (talk_start < current_time && talk_end > current_time) {
current_talk = talk;
}
}
if (current_talk) {
$('#title').text(current_talk['title']);
$('#speaker').text(current_talk['persons'].join(', '));
$('#box').css('border-bottom', '10px solid ' + current_talk['track']['color']);
} else {
$('#title').text('Currently no talk');
$('#speaker').text('');
$('#box').css('border-bottom', 'none');
}
}
window.setInterval(update_lower_third, 1000);
function update_schedule() {
$.getJSON('schedule.json', function(data) {
console.info('schedule updated with ' + data['talks'].length + ' talks in ' + data['rooms'].length + ' rooms');
schedule = data;
window.setTimeout(update_schedule, 30000);
});
}
update_schedule();