Update Content, still WiP
This commit is contained in:
parent
c5f51e94ca
commit
b184467b54
|
@ -3,7 +3,7 @@
|
||||||
<meta charset=utf-8>
|
<meta charset=utf-8>
|
||||||
<meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no">
|
<meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no">
|
||||||
<title>rC3 NOWHERE</title>
|
<title>rC3 NOWHERE</title>
|
||||||
<link rel=stylesheet href=https://infobeamer.montage2.de/main.min.98d83e9b389cfb42e02b6dc50f4985bde2bd17d3359d391d6154c0a69918bfc0.css>
|
<link rel=stylesheet href=https://infobeamer.montage2.de/main.min.50215e4017c001d2b7d6ee54c9ee64cc4544efb8502a289899b34b09a02ff466.css>
|
||||||
<script src=https://infobeamer.montage2.de/js/config.a954e77ac7f60b43bb37f71a04934bbf522575b4b8bbc6e214d7b0371e2c81a4.js integrity="sha256-qVTnesf2C0O7N/caBJNLv1IldbS4u8biFNewNx4sgaQ="></script>
|
<script src=https://infobeamer.montage2.de/js/config.a954e77ac7f60b43bb37f71a04934bbf522575b4b8bbc6e214d7b0371e2c81a4.js integrity="sha256-qVTnesf2C0O7N/caBJNLv1IldbS4u8biFNewNx4sgaQ="></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -11,6 +11,6 @@
|
||||||
</main>
|
</main>
|
||||||
<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/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/js/htm/htm.80e39afe20fd61183412eda89efa10532d57945e6364642aceacd50eb2384b4b.js integrity="sha256-gOOa/iD9YRg0Eu2onvoQUy1XlF5jZGQqzqzVDrI4S0s="></script>
|
||||||
<script src=https://infobeamer.montage2.de/main.70ebfdc7bf1b6f07ff5cb8036bab2309230d7a7a17d3e31366332852678adbaf.js integrity="sha256-cOv9x78bbwf/XLgDa6sjCSMNenoX0+MTZjMoUmeK268=" type=module></script>
|
<script src=https://infobeamer.montage2.de/main.ed70c487a33840a79f8f30be2914947b7075c79656362b0f07f1b33aacc1254a.js integrity="sha256-7XDEh6M4QKefjzC+KRSUe3B1x5ZWNisPB/GzOqzBJUo=" type=module></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
(() => {
|
(() => {
|
||||||
// ns-hugo:/home/raoul/rc3_2021/html-infobeamer-content/assets/js/dom.js
|
// ns-hugo:/home/raoul-web/rc3_2021/html-infobeamer-content/assets/js/dom.js
|
||||||
var html = htm.bind(preact.h);
|
var html = htm.bind(preact.h);
|
||||||
var schedule_meta_here_dom = (schedule) => {
|
var schedule_meta_here_dom = (schedule) => {
|
||||||
let inner = html`${schedule.map((talk) => html`
|
let inner = html`${schedule.map((talk) => html`
|
||||||
|
@ -81,20 +81,67 @@
|
||||||
<span class="license">(${current.license})</span>
|
<span class="license">(${current.license})</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="line2">
|
<div class="line2">
|
||||||
|
<span class="title">«${current.title}»</span>
|
||||||
|
<span class="by">by</span>
|
||||||
<span class="artist">${current.artist}</span>
|
<span class="artist">${current.artist}</span>
|
||||||
<span>—</span>
|
|
||||||
<span class="title">${current.title}</span>
|
|
||||||
</div>`)}
|
</div>`)}
|
||||||
</div>`;
|
</div>`;
|
||||||
return inner;
|
return inner;
|
||||||
};
|
};
|
||||||
|
var get_tweet_author = (data, tweet) => {
|
||||||
|
let authorId = tweet.author_id;
|
||||||
|
let users = data.includes.users;
|
||||||
|
let author = users.find((item) => item.id === authorId);
|
||||||
|
let userName = author !== void 0 ? author.username : "NoOne";
|
||||||
|
return userName;
|
||||||
|
};
|
||||||
|
var get_tweet_text = (data, tweet) => tweet.text;
|
||||||
|
var get_tweet_profile_image = (data, tweet) => {
|
||||||
|
const defaultProfileImageUrl = "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png";
|
||||||
|
let authorId = tweet.author_id;
|
||||||
|
let users = data.includes.users;
|
||||||
|
let author = users.find((item) => item.id === authorId);
|
||||||
|
let profileImageUrl = author !== void 0 ? author.profile_image_url : defaultProfileImageUrl;
|
||||||
|
return profileImageUrl;
|
||||||
|
};
|
||||||
|
var single_tweet_dom = (data, tweet) => {
|
||||||
|
let userName = get_tweet_author(data, tweet);
|
||||||
|
let profileImageUrl = get_tweet_profile_image(data, tweet);
|
||||||
|
let text = get_tweet_text(data, tweet);
|
||||||
|
let inner = html`
|
||||||
|
<div class="tweet slider">
|
||||||
|
<div class="container">
|
||||||
|
<img class="profile-image" src="${profileImageUrl}"/>
|
||||||
|
<div class="content">
|
||||||
|
<div class="username">@${userName}</div>
|
||||||
|
<div class="text">${text}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
|
return inner;
|
||||||
|
};
|
||||||
|
var social_container_dom = (data) => {
|
||||||
|
let inner = html``;
|
||||||
|
data.forEach((d) => {
|
||||||
|
let tweets = d.data;
|
||||||
|
inner = html`
|
||||||
|
<div id="bottom-bar" class="visible bottom-bar">
|
||||||
|
<div id="ticker-wrap" class="ticker-wrap">
|
||||||
|
<div class="ticker switcher">
|
||||||
|
${tweets.map((t) => single_tweet_dom(d, t))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
|
});
|
||||||
|
return inner;
|
||||||
|
};
|
||||||
function update_main_slide(data) {
|
function update_main_slide(data) {
|
||||||
let schedule = data.schedule;
|
let schedule = data.schedule;
|
||||||
let music = data.music;
|
let music = data.music;
|
||||||
let twitter = data.twitter;
|
let twitter = data.twitter;
|
||||||
let scheduleDom = update_schedule_dom(schedule);
|
let scheduleDom = update_schedule_dom(schedule);
|
||||||
let musicDom = music_playing_now_dom(music);
|
let musicDom = music_playing_now_dom(music);
|
||||||
let twitterDom = void 0;
|
let twitterDom = social_container_dom(twitter);
|
||||||
let inner = html`
|
let inner = html`
|
||||||
${scheduleDom}
|
${scheduleDom}
|
||||||
${musicDom}
|
${musicDom}
|
||||||
|
@ -106,9 +153,23 @@ ${twitterDom}
|
||||||
}
|
}
|
||||||
|
|
||||||
// <stdin>
|
// <stdin>
|
||||||
var scheduleData = JSON.constructor([]);
|
var scheduleData = [];
|
||||||
var musicData = JSON.constructor([]);
|
var musicData = [];
|
||||||
var twitterData = JSON.constructor([]);
|
var twitterData = [];
|
||||||
|
var twitter_limiter = (idata) => {
|
||||||
|
const numberTweets = 20;
|
||||||
|
let dataCopy = JSON.parse(JSON.stringify(idata));
|
||||||
|
dataCopy.forEach((d) => {
|
||||||
|
let tweets = d.data;
|
||||||
|
if (tweets.length > 0) {
|
||||||
|
while (tweets.length < 20) {
|
||||||
|
tweets = tweets.concat(tweets);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
d.data = tweets.slice(0, numberTweets);
|
||||||
|
});
|
||||||
|
return dataCopy;
|
||||||
|
};
|
||||||
if (window.Worker) {
|
if (window.Worker) {
|
||||||
const workerBaseURL = window.infoBeamerConfig.get("workerBaseURL");
|
const workerBaseURL = window.infoBeamerConfig.get("workerBaseURL");
|
||||||
const scheduleWorkerCode = workerBaseURL + "js/schedule_worker.js";
|
const scheduleWorkerCode = workerBaseURL + "js/schedule_worker.js";
|
||||||
|
@ -145,7 +206,7 @@ ${twitterDom}
|
||||||
musicWorker.onmessage = function(e) {
|
musicWorker.onmessage = function(e) {
|
||||||
let msgType = e.data.msgType;
|
let msgType = e.data.msgType;
|
||||||
if (msgType === musicType) {
|
if (msgType === musicType) {
|
||||||
musicData = JSON.constructor([e.data.json]);
|
musicData = [e.data.json];
|
||||||
let time = e.data.timestamp;
|
let time = e.data.timestamp;
|
||||||
console.log("Message: " + msgType + " at " + time);
|
console.log("Message: " + msgType + " at " + time);
|
||||||
console.log(musicData);
|
console.log(musicData);
|
||||||
|
@ -166,7 +227,8 @@ ${twitterDom}
|
||||||
twitterWorker.onmessage = function(e) {
|
twitterWorker.onmessage = function(e) {
|
||||||
let msgType = e.data.msgType;
|
let msgType = e.data.msgType;
|
||||||
if (msgType === twitterType) {
|
if (msgType === twitterType) {
|
||||||
twitterData = e.data.json;
|
twitterData = [e.data.json];
|
||||||
|
twitterData = twitter_limiter(twitterData);
|
||||||
let time = e.data.timestamp;
|
let time = e.data.timestamp;
|
||||||
console.log("Message: " + msgType + " at " + time);
|
console.log("Message: " + msgType + " at " + time);
|
||||||
console.log(twitterData);
|
console.log(twitterData);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue