From fa47d5866f0a2e27719f3d565121f2336d22755b Mon Sep 17 00:00:00 2001 From: Tim Wijma Date: Tue, 1 Nov 2022 14:28:21 +0100 Subject: [PATCH 1/4] tweet css --- dashboard_static/index.html | 26 ++++++++++++++++++++++++++ dashboard_static/style/style.css | 24 ++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/dashboard_static/index.html b/dashboard_static/index.html index 83eb765..660db72 100644 --- a/dashboard_static/index.html +++ b/dashboard_static/index.html @@ -60,6 +60,32 @@

LATEST CLUCCS

+
+
+ +
+
+ Tim Wijma + @timwijma +
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Possimus velit maiores non deserunt adipisci dicta quam nobis ad. Iste, unde? +
+
+ favorite + 20 +
+
+ repeat + 20 +
+
+ chat_bubble + 20 +
+
+
+
+

FILTERED CLUCCS

diff --git a/dashboard_static/style/style.css b/dashboard_static/style/style.css index 14d15a2..5c3f4af 100644 --- a/dashboard_static/style/style.css +++ b/dashboard_static/style/style.css @@ -88,19 +88,43 @@ body { .tweet { display: flex; + background-color: var(--main-dark); + border-radius: 16px; + padding: 16px; } .tweet-profilepicture { border-radius: 100%; + width: 60px; + height: 60px; + /* padding: 8px; */ +} + +.tweet-content { + padding-left: 16px; } .tweet-interactions { display: flex; + margin-top: 8px; } .tweet-interaction { display: flex; align-items: center; + margin-right: 32px; +} + +.tweet-interaction .material-symbols-outlined { + margin-right: 4px; +} + +.tweet-nickname { + font-weight: bold; +} + +.tweet-username { + opacity: 0.8; } .filters-search input { From 199d7692929ad59a711f26e76396424d3ec978a7 Mon Sep 17 00:00:00 2001 From: Tim Wijma Date: Tue, 1 Nov 2022 14:39:31 +0100 Subject: [PATCH 2/4] changed tweetcell function --- dashboard_static/js/code.js | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/dashboard_static/js/code.js b/dashboard_static/js/code.js index 6f5074e..2fea0fc 100644 --- a/dashboard_static/js/code.js +++ b/dashboard_static/js/code.js @@ -25,30 +25,30 @@ function getCSSVariable(name) { function tweetCell(tweet, parent) { var cell = document.createElement("div"); cell.innerHTML = - '
'+ - '' + - '
' + - '
'+ - ''+tweet.user.name+' '+ - '@'+tweet.user.screen_name+''+ - '
'+ - ''+tweet.text+''+ - '
'+ - '
'+ - 'favorite'+ - ''+tweet.favorite_count+''+ - '
'+ - '
'+ - 'repeat'+ - ''+tweet.retweet_count+''+ - '
'+ - '
'+ - 'chat_bubble'+ - ''+tweet.reply_count+''+ - '
'+ - '
'+ - '
'+ - '
'; + `
+ +
+
+ ${tweet.user.name} + @${tweet.user.screen_name} +
+ ${tweet.text} +
+
+ favorite + ${tweet.favorite_count} +
+
+ repeat + ${tweet.retweet_count} +
+
+ chat_bubble + ${tweet.reply_count} +
+
+
+
` parent.append(cell); } From fbbb6c6c7a5898903331b7b0422ed7bf8fcc7fdf Mon Sep 17 00:00:00 2001 From: "youri.apell@gmail.com" Date: Tue, 1 Nov 2022 15:08:30 +0100 Subject: [PATCH 3/4] change time value to 0.1 --- dashboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard.py b/dashboard.py index b1eb76d..7b8637f 100644 --- a/dashboard.py +++ b/dashboard.py @@ -12,7 +12,7 @@ root_content_path = 'dashboard_static' # the action will be called with the context and the event @event('init') def setup(ctx, e): - start_offline_tweets('sports1.txt', event_name="tweet", time_factor=0.01) + start_offline_tweets('sports1.txt', event_name="tweet", time_factor=0.1) ctx.count = 0 # fire('sample', {'previous': 0.0}) From 3ee60ecb3c90bda3bd4335e7e5f9c84d059f9cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Hn=C3=A1t?= Date: Tue, 1 Nov 2022 16:31:22 +0100 Subject: [PATCH 4/4] Added function to put all in a single list --- dashboard_static/js/connection.js | 5 ++++- dashboard_static/lib/tweets.js | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dashboard_static/js/connection.js b/dashboard_static/js/connection.js index a9f1f0f..8d26743 100644 --- a/dashboard_static/js/connection.js +++ b/dashboard_static/js/connection.js @@ -2,4 +2,7 @@ // Sports = all selected sports, ARRAY $(".sport").on("selected", function(e, selected, sports) { console.log(selected, sports); -}) \ No newline at end of file +}) +window.addEventListener('DOMContentLoaded', (event) => { + window.sessionStorage.setItem('tweets', JSON.stringify([])); +}); \ No newline at end of file diff --git a/dashboard_static/lib/tweets.js b/dashboard_static/lib/tweets.js index caae015..6cc4642 100644 --- a/dashboard_static/lib/tweets.js +++ b/dashboard_static/lib/tweets.js @@ -80,6 +80,14 @@ block.fn.tweets = function(config) { // register default handler for handling tweet data this.actions(function(e, tweet){ + tweets = window.sessionStorage.getItem('tweets'); + tweets = JSON.parse(tweets); + tweets.push(tweet); + if(tweets.length >= options.memory) { + tweets.shift(); + } + window.sessionStorage.setItem('tweets', JSON.stringify(tweets)); + var $item = $('
  • '); var $tweet = $('
    ');