RC2.5
This commit is contained in:
parent
bde8143c94
commit
2df36a0564
|
@ -4,8 +4,8 @@
|
|||
<meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no">
|
||||
<title>rC3 NOWHERE</title>
|
||||
<link href=/fork-awesome/css/fork-awesome.min.css rel=stylesheet type=text/css>
|
||||
<link rel=stylesheet href=https://infobeamer.montage2.de/main.min.818792ab7049f79cb65101e4c8c34d90986ecabe38b739d82ab5b7be19d1923e.css>
|
||||
<script src=https://infobeamer.montage2.de/js/config.fa1a162e62b8d5f3f40c8812d30b5289c5792ff26c0843426d8c109a00621389.js integrity="sha256-+hoWLmK41fP0DIgS0wtSicV5L/JsCENCbYwQmgBiE4k="></script>
|
||||
<link rel=stylesheet href=https://infobeamer.montage2.de/main.min.b34cf8f32ebf8158101dc492d21641a7a52c484c65ce5c4bfbd0df55d3455d1d.css>
|
||||
<script src=https://infobeamer.montage2.de/js/config.c3055781f00111fd050e1e5732c9e6dbd2dce21204e90b02975e9983a4c367f7.js integrity="sha256-wwVXgfABEf0FDh5XMsnm29Lc4hIE6QsCl16Zg6TDZ/c="></script>
|
||||
</head>
|
||||
<body>
|
||||
<main id=main>
|
||||
|
@ -13,6 +13,6 @@
|
|||
<script src=https://infobeamer.montage2.de/js/moment/moment.min.73de4254959530e4d1d9bec586379184f96b4953dacf9cd5e5e2bdd7bfeceef7.js integrity="sha256-c95CVJWVMOTR2b7FhjeRhPlrSVPaz5zV5eK917/s7vc="></script>
|
||||
<script src=https://infobeamer.montage2.de/js/preact/preact.min.0c204e20934f1e09cfe86fbcf1d069d842f988fc71efe3a923021c08892c71c8.js integrity="sha256-DCBOIJNPHgnP6G+88dBp2EL5iPxx7+OpIwIcCIksccg="></script>
|
||||
<script src=https://infobeamer.montage2.de/js/htm/htm.80e39afe20fd61183412eda89efa10532d57945e6364642aceacd50eb2384b4b.js integrity="sha256-gOOa/iD9YRg0Eu2onvoQUy1XlF5jZGQqzqzVDrI4S0s="></script>
|
||||
<script src=https://infobeamer.montage2.de/main.c6cb62188f7b5dc001704b60fcb1a1b0b38510b5bed7b27311053c13fc63333d.js integrity="sha256-xstiGI97XcABcEtg/LGhsLOFELW+17JzEQU8E/xjMz0=" type=module></script>
|
||||
<script src=https://infobeamer.montage2.de/main.7b9386a5aed538c367cecbb578d8b458be6fcb679fa7b83c00402918b7b123aa.js integrity="sha256-e5OGpa7VOMNnzsu1eNi0WL5vy2efp7g8AEApGLexI6o=" type=module></script>
|
||||
</body>
|
||||
</html>
|
|
@ -5,11 +5,11 @@
|
|||
window.infoBeamerConfig.set("scheduleURL", "/everything.schedule.json");
|
||||
window.infoBeamerConfig.set("scheduleFetchInterval", 60);
|
||||
window.infoBeamerConfig.set("twitterURL", "/tweets-rc3.json");
|
||||
window.infoBeamerConfig.set("twitterFetchInterval", 60);
|
||||
window.infoBeamerConfig.set("twitterFetchInterval", 120);
|
||||
window.infoBeamerConfig.set("mastodonURL", "/toots-rc3-chaos.social.json");
|
||||
window.infoBeamerConfig.set("mastodonFetchInterval", 60);
|
||||
window.infoBeamerConfig.set("mastodonFetchInterval", 120);
|
||||
window.infoBeamerConfig.set("musicURL", "/music.json");
|
||||
window.infoBeamerConfig.set("musicFetchInterval", 3);
|
||||
window.infoBeamerConfig.set("musicFetchInterval", 5);
|
||||
console.log("Info Beamer Configuration: ");
|
||||
console.log(window.infoBeamerConfig);
|
||||
})();
|
|
@ -1,29 +1,26 @@
|
|||
"use strict";
|
||||
(() => {
|
||||
// ns-hugo:/home/raoul-web/rc3_2021/html-infobeamer-content/assets/js/services.js
|
||||
var delay = 3 * 5 * 60 * 1e3;
|
||||
var postsLimit = 20;
|
||||
var defaultUrlSet = [
|
||||
"https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png",
|
||||
"https://chaos.social/avatars/original/missing.png"
|
||||
];
|
||||
var default_profile_image_url = () => "./nounicorn.png";
|
||||
var social_limiter = (tweets, toots) => {
|
||||
const numberTweets = 20;
|
||||
let posts = tweets.concat(toots);
|
||||
let byDate = (fst, snd) => Date.parse(fst.time) - Date.parse(snd.time);
|
||||
let postsSorted = posts.sort(byDate);
|
||||
if (postsSorted.length > 0) {
|
||||
while (postsSorted.length < numberTweets) {
|
||||
while (postsSorted.length < postsLimit) {
|
||||
postsSorted = postsSorted.concat(postsSorted);
|
||||
}
|
||||
}
|
||||
postsSorted = postsSorted.reverse().slice(0, numberTweets);
|
||||
postsSorted = postsSorted.reverse().slice(0, postsLimit);
|
||||
return postsSorted;
|
||||
};
|
||||
var default_profile_image = () => "./nounicorn.png";
|
||||
var replace_default_image = (url) => {
|
||||
let newUrl;
|
||||
if (url === "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png" || url === "https://chaos.social/avatars/original/missing.png") {
|
||||
newUrl = default_profile_image();
|
||||
} else {
|
||||
newUrl = url;
|
||||
}
|
||||
return newUrl;
|
||||
};
|
||||
var replace_default_image_url = (url) => defaultUrlSet.includes(url) === true ? default_profile_image_url() : url;
|
||||
var tweet_author = (data, tweet) => {
|
||||
let authorId = tweet.author_id;
|
||||
let users = data.includes.users;
|
||||
|
@ -35,7 +32,7 @@
|
|||
let authorId = tweet.author_id;
|
||||
let users = data.includes.users;
|
||||
let author = users.find((item) => item.id === authorId);
|
||||
let profileImageUrl = replace_default_image(author.profile_image_url);
|
||||
let profileImageUrl = replace_default_image_url(author.profile_image_url);
|
||||
return profileImageUrl;
|
||||
};
|
||||
var tweet_text = (tweet) => tweet.text;
|
||||
|
@ -54,7 +51,7 @@
|
|||
return tweets;
|
||||
};
|
||||
var toot_author = (toot) => toot.account.username;
|
||||
var toot_profile_image = (toot) => replace_default_image(toot.account.avatar_static);
|
||||
var toot_profile_image = (toot) => replace_default_image_url(toot.account.avatar_static);
|
||||
var toot_text = (toot) => toot.content;
|
||||
var toot_time = (toot) => toot.created_at;
|
||||
var html_plainify = (html2) => {
|
||||
|
@ -94,24 +91,21 @@
|
|||
let talksDataSorted = talksData.sort(byDate);
|
||||
return talksDataSorted;
|
||||
};
|
||||
var future_events = (schedule, datetime) => {
|
||||
let scheduleFiltered = schedule.filter((e) => Date.parse(e.date) > datetime);
|
||||
return scheduleFiltered;
|
||||
};
|
||||
var future_events = (schedule, now) => schedule.filter((e) => Date.parse(e.date) >= now - delay);
|
||||
var same_music_track = (track1, track2) => track1.artist === track2.artist && track1.title === track2.title;
|
||||
var is_new_music = (musicA, musicB) => {
|
||||
let isSame;
|
||||
let isNewMusic;
|
||||
if (musicA.length !== 0 && musicB.length !== 0) {
|
||||
isSame = musicA[0].artist === musicB[0].artist && musicA[0].title === musicB[0].title;
|
||||
isNewMusic = same_music_track(musicA[0], musicB[0]);
|
||||
} else if (musicA.length === 0 && musicB.length === 0) {
|
||||
isSame = true;
|
||||
isNewMusic = true;
|
||||
} else {
|
||||
isSame = false;
|
||||
isNewMusic = false;
|
||||
}
|
||||
return !isSame;
|
||||
return !isNewMusic;
|
||||
};
|
||||
var music_update = (musicA, musicB) => {
|
||||
let isNew = is_new_music(musicA, musicB);
|
||||
if (isNew === true) {
|
||||
if (is_new_music(musicA, musicB) === true) {
|
||||
musicB.forEach((m) => m.since = Date.now());
|
||||
}
|
||||
return musicB;
|
||||
|
@ -119,16 +113,38 @@
|
|||
|
||||
// ns-hugo:/home/raoul-web/rc3_2021/html-infobeamer-content/assets/js/dom.js
|
||||
var html = htm.bind(preact.h);
|
||||
var here_room = "Chaos-West TV";
|
||||
var hereRoom = "Chaos-West TV";
|
||||
var number_events_all = 7;
|
||||
var musicAge = 5 * 1e3;
|
||||
var urgency = 5 * 60 * 1e3;
|
||||
var is_own_talk = (talk) => talk.room === here_room;
|
||||
var urgent = 5 * 60 * 1e3;
|
||||
var stale = 3 * 5 * 60 * 1e3;
|
||||
var lapse = 5 * 1e3;
|
||||
var talk_day = (talk) => {
|
||||
const lut = {
|
||||
1: "I",
|
||||
2: "II",
|
||||
3: "III",
|
||||
4: "IV"
|
||||
};
|
||||
return lut[talk.day];
|
||||
};
|
||||
var is_own_talk = (talk) => talk.room === hereRoom;
|
||||
var talk_start_time = (talk) => Date.parse(talk.date);
|
||||
var is_urgent = (talk, time) => {
|
||||
let talkStart = Date.parse(talk.date);
|
||||
let timeDelta = talkStart - time;
|
||||
return timeDelta <= urgency;
|
||||
let timeDelta = talk_start_time(talk) - time;
|
||||
return timeDelta >= 0 && timeDelta <= urgent;
|
||||
};
|
||||
var is_stale = (talk, time) => {
|
||||
let timeDelta = talk_start_time(talk) - time;
|
||||
return timeDelta < 0;
|
||||
};
|
||||
var is_lapse = (talk, time) => {
|
||||
let timeDelta = talk_start_time(talk) - time;
|
||||
return timeDelta <= -(stale - lapse);
|
||||
};
|
||||
var urgent_class = (talk, time) => is_urgent(talk, time) ? "urgent" : "";
|
||||
var stale_class = (talk, time) => is_stale(talk, time) ? "stale" : "";
|
||||
var lapse_class = (talk, time) => is_lapse(talk, time) ? "lapse" : "";
|
||||
var speaker_names = (talk) => talk.persons.map((p) => p.public_name);
|
||||
var speaker_dom = (talk) => {
|
||||
const separator = ", ";
|
||||
|
@ -142,23 +158,48 @@
|
|||
}
|
||||
return inner;
|
||||
};
|
||||
var starting_dom = (talk, time) => {
|
||||
const hrs3 = 3 * 60 * 60 * 1e3;
|
||||
const min15 = 3 * 5 * 60 * 1e3;
|
||||
const min2 = 2 * 60 * 1e3;
|
||||
const min1 = 60 * 1e3;
|
||||
let timeDelta = talk_start_time(talk) - time;
|
||||
let minutes = Math.ceil(Math.abs(timeDelta / 1e3 / 60));
|
||||
let inner;
|
||||
if (timeDelta > hrs3) {
|
||||
inner = html`<span class="start">Day ${talk_day(talk)} at ${talk.start}</span>`;
|
||||
} else if (timeDelta > min15) {
|
||||
inner = html`<span class="start">Starting at ${talk.start}</span>`;
|
||||
} else if (timeDelta <= min15 && timeDelta > min1) {
|
||||
inner = html`<span class="start">Starting in ${minutes} minutes</span>`;
|
||||
} else if (timeDelta <= min1 && timeDelta >= 0) {
|
||||
inner = html`<span class="start">Starting now!</span>`;
|
||||
} else if (timeDelta < 0 && timeDelta >= -min1) {
|
||||
inner = html`<span class="start">Just started!</span>`;
|
||||
} else if (timeDelta < -min1 && timeDelta >= -min15) {
|
||||
inner = html`<span class="start">Started ${minutes} minutes ago</span>`;
|
||||
} else if (timeDelta < -min15) {
|
||||
inner = html`<span class="start">Seriously missed</span>`;
|
||||
}
|
||||
return inner;
|
||||
};
|
||||
var to_minutes = (duration) => {
|
||||
const timeFormat = "hh:mm";
|
||||
let dt = moment(duration, timeFormat);
|
||||
let minutes = 60 * dt.hours() + dt.minutes();
|
||||
return minutes;
|
||||
};
|
||||
var duration_dom = (duration) => {
|
||||
return html`<span class="duration">${to_minutes(duration)} minutes</span>`;
|
||||
var duration_dom = (talk) => {
|
||||
return html`<span class="duration">${to_minutes(talk.duration)} minutes</span>`;
|
||||
};
|
||||
var meta_here_dom = (schedule, time) => {
|
||||
let inner = html`${schedule.map((talk) => html`
|
||||
<div class="talk-here-meta-box ${urgent_class(talk, time)}">
|
||||
<div class="talk-here-meta-box ${urgent_class(talk, time)} ${stale_class(talk, time)}">
|
||||
<div class="speaker">${speaker_dom(talk)}</div>
|
||||
<div class="title"><span class="titletext">${talk.title}</span></div>
|
||||
<div class="start-duration">
|
||||
<span class="start">Starting at ${talk.start}</span>
|
||||
${duration_dom(talk.duration)}
|
||||
${starting_dom(talk, time)}
|
||||
${duration_dom(talk)}
|
||||
</div>
|
||||
</div>
|
||||
`)}`;
|
||||
|
@ -193,17 +234,8 @@
|
|||
});
|
||||
return inner;
|
||||
};
|
||||
var talk_day = (talk) => {
|
||||
const lut = {
|
||||
1: "I",
|
||||
2: "II",
|
||||
3: "III",
|
||||
4: "IV"
|
||||
};
|
||||
return lut[talk.day];
|
||||
};
|
||||
var talk_day_dom = (talk) => html`<span class="day">Day ${talk_day(talk)}</span>`;
|
||||
var highlight_class = (talk) => is_own_talk(talk) === true ? "item-highlight" : "";
|
||||
var highlight_class = (talk) => is_own_talk(talk) === true ? "highlight" : "";
|
||||
var do_not_record_dom = (talk) => {
|
||||
let icon = "fa-microphone-slash";
|
||||
let inner;
|
||||
|
@ -217,7 +249,7 @@
|
|||
var list_all_dom = (schedule, time) => {
|
||||
let inner = html`
|
||||
${schedule.map((talk) => html`
|
||||
<div class="item ${highlight_class(talk)} ${urgent_class(talk, time)}">
|
||||
<div class="item ${highlight_class(talk)} ${urgent_class(talk, time)} ${stale_class(talk, time)} ${lapse_class(talk, time)}">
|
||||
<div>
|
||||
<div class="title">${talk.title}</div>
|
||||
</div>
|
||||
|
@ -230,41 +262,71 @@
|
|||
</div>`)}`;
|
||||
return inner;
|
||||
};
|
||||
var next_up_here_dom = (talks, time) => {
|
||||
let inner;
|
||||
if (talks.length > 0) {
|
||||
inner = html`
|
||||
<div class="panel meta">
|
||||
<div class="header">Next Up Here</div>
|
||||
<div class="content">${meta_here_dom(talks, time)}</div>
|
||||
</div>`;
|
||||
} else {
|
||||
inner = html`
|
||||
<div class="panel meta">
|
||||
<div class="header">Next Up Here</div>
|
||||
</div>`;
|
||||
}
|
||||
return inner;
|
||||
};
|
||||
var next_up_abstract_dom = (talks, time) => {
|
||||
let inner;
|
||||
if (talks.length > 0) {
|
||||
inner = html`
|
||||
<div class="panel abstract">
|
||||
<div class="header">Abstract</div>
|
||||
<div class="content">${abstract_here_dom(talks)}</div>
|
||||
</div>`;
|
||||
} else {
|
||||
inner = html``;
|
||||
}
|
||||
return inner;
|
||||
};
|
||||
var next_up_list_all_dom = (talks, time) => {
|
||||
let inner;
|
||||
if (talks.length > 0) {
|
||||
inner = html`
|
||||
<div class="panel list">
|
||||
<div class="header">Next Up at rC3</div>
|
||||
<div class="content">${list_all_dom(talks, time)}</div>
|
||||
</div>`;
|
||||
} else {
|
||||
inner = html`
|
||||
<div class="panel list">
|
||||
<div class="header">Next Up at rC3</div>
|
||||
</div>`;
|
||||
}
|
||||
return inner;
|
||||
};
|
||||
var schedule_dom = (schedule, time) => {
|
||||
const here_number_events = 1;
|
||||
const all_number_events = 7;
|
||||
let allTalks = schedule.slice(0, all_number_events);
|
||||
let allTalks = schedule.slice(0, number_events_all);
|
||||
let nextTalkHere = schedule.filter(is_own_talk).slice(0, 1);
|
||||
let nextHereMetaDom = meta_here_dom(nextTalkHere, time);
|
||||
let nextHereAbstractDom = abstract_here_dom(nextTalkHere);
|
||||
let nextAllMetaDom = list_all_dom(allTalks, time);
|
||||
let inner = html`
|
||||
return html`
|
||||
<div class="slide">
|
||||
<div class="schedule">
|
||||
<div class="left">
|
||||
<div class="panel meta">
|
||||
<div class="header">Next Up Here</div>
|
||||
<div class="content">${nextHereMetaDom}</div>
|
||||
</div>
|
||||
<div class="panel abstract">
|
||||
<div class="header">Abstract</div>
|
||||
<div class="content">${nextHereAbstractDom}</div>
|
||||
</div>
|
||||
${next_up_here_dom(nextTalkHere, time)}
|
||||
${next_up_abstract_dom(nextTalkHere, time)}
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="panel list">
|
||||
<div class="header">Next Up at rC3</div>
|
||||
<div class="content">${nextAllMetaDom}</div>
|
||||
</div>
|
||||
${next_up_list_all_dom(allTalks, time)}
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
return inner;
|
||||
};
|
||||
var music_changed = (current, time) => time - current.since <= musicAge;
|
||||
var changed_music_class = (current, time) => music_changed(current, time) ? "changed" : "";
|
||||
var music_playing_now_dom = (music, time) => {
|
||||
let inner = html`
|
||||
return html`
|
||||
<div class="music-box">
|
||||
${music.map((current) => html`
|
||||
<div class="music ${changed_music_class(current, time)}">
|
||||
|
@ -284,7 +346,6 @@
|
|||
</div>
|
||||
</div>`)}
|
||||
</div>`;
|
||||
return inner;
|
||||
};
|
||||
var post_time = (date) => moment(date).format("H:mm, D. MMMM YYYY");
|
||||
var social_network_dom = (post) => {
|
||||
|
@ -338,15 +399,11 @@
|
|||
let schedule = data.schedule;
|
||||
let music = data.music;
|
||||
let postings = data.posts;
|
||||
let scheduleDom = schedule_dom(schedule, time);
|
||||
let hashtagDom = hashtag_dom();
|
||||
let musicDom = music_playing_now_dom(music, time);
|
||||
let postingsDom = social_container_dom(postings);
|
||||
let inner = html`
|
||||
${scheduleDom}
|
||||
${hashtagDom}
|
||||
${musicDom}
|
||||
${postingsDom}
|
||||
${schedule_dom(schedule, time)}
|
||||
${hashtag_dom()}
|
||||
${music_playing_now_dom(music, time)}
|
||||
${social_container_dom(postings)}
|
||||
`;
|
||||
const anchorElId = "main";
|
||||
const el = document.getElementById(anchorElId);
|
||||
|
@ -435,10 +492,12 @@
|
|||
} else {
|
||||
console.log("Your browser doesn't support web workers.");
|
||||
}
|
||||
var fakeNow = 0;
|
||||
var fakeTimeDelta = fakeNow - Date.now();
|
||||
function update_screen() {
|
||||
let realTime = new Date();
|
||||
console.log("Updating screen at at: " + realTime);
|
||||
let now = Date.now();
|
||||
let now = Date.now() + fakeTimeDelta;
|
||||
console.log("Using 'now': " + now);
|
||||
update_main_slide({
|
||||
schedule: future_events(scheduleData, now),
|
||||
|
@ -448,7 +507,7 @@
|
|||
}
|
||||
function main_loop() {
|
||||
update_screen();
|
||||
setTimeout(main_loop, 10 * 1e3);
|
||||
setTimeout(main_loop, 5 * 1e3);
|
||||
}
|
||||
main_loop();
|
||||
})();
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -5,7 +5,7 @@
|
|||
<title>rC3 NOWHERE</title>
|
||||
<link href=/fork-awesome/css/fork-awesome.min.css rel=stylesheet type=text/css>
|
||||
<link rel=stylesheet href=https://infobeamer.montage2.de/main.min.1a1572716ba819c6a8125645f805d12ca6b6a47e2a1dbce5507702bdd79d9aa5.css>
|
||||
<script src=https://infobeamer.montage2.de/js/config.fa1a162e62b8d5f3f40c8812d30b5289c5792ff26c0843426d8c109a00621389.js integrity="sha256-+hoWLmK41fP0DIgS0wtSicV5L/JsCENCbYwQmgBiE4k="></script>
|
||||
<script src=https://infobeamer.montage2.de/js/config.c3055781f00111fd050e1e5732c9e6dbd2dce21204e90b02975e9983a4c367f7.js integrity="sha256-wwVXgfABEf0FDh5XMsnm29Lc4hIE6QsCl16Zg6TDZ/c="></script>
|
||||
</head>
|
||||
<body>
|
||||
<main id=main>
|
||||
|
@ -13,6 +13,6 @@
|
|||
<script src=https://infobeamer.montage2.de/js/moment/moment.min.73de4254959530e4d1d9bec586379184f96b4953dacf9cd5e5e2bdd7bfeceef7.js integrity="sha256-c95CVJWVMOTR2b7FhjeRhPlrSVPaz5zV5eK917/s7vc="></script>
|
||||
<script src=https://infobeamer.montage2.de/js/preact/preact.min.0c204e20934f1e09cfe86fbcf1d069d842f988fc71efe3a923021c08892c71c8.js integrity="sha256-DCBOIJNPHgnP6G+88dBp2EL5iPxx7+OpIwIcCIksccg="></script>
|
||||
<script src=https://infobeamer.montage2.de/js/htm/htm.80e39afe20fd61183412eda89efa10532d57945e6364642aceacd50eb2384b4b.js integrity="sha256-gOOa/iD9YRg0Eu2onvoQUy1XlF5jZGQqzqzVDrI4S0s="></script>
|
||||
<script src=https://infobeamer.montage2.de/main.c6cb62188f7b5dc001704b60fcb1a1b0b38510b5bed7b27311053c13fc63333d.js integrity="sha256-xstiGI97XcABcEtg/LGhsLOFELW+17JzEQU8E/xjMz0=" type=module></script>
|
||||
<script src=https://infobeamer.montage2.de/main.7b9386a5aed538c367cecbb578d8b458be6fcb679fa7b83c00402918b7b123aa.js integrity="sha256-e5OGpa7VOMNnzsu1eNi0WL5vy2efp7g8AEApGLexI6o=" type=module></script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue