From a6e3a127619830d8c16fd0fb0075c04cf09a686a Mon Sep 17 00:00:00 2001 From: msoliman3 Date: Thu, 3 Nov 2022 14:23:49 +0100 Subject: [PATCH] twitter hour help me lol --- dashboard.py | 2 +- dashboard_static/js/code.js | 3 +++ dashboard_static/style/style.css | 21 ++++++++++++++++----- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/dashboard.py b/dashboard.py index fa975ac..7196e39 100644 --- a/dashboard.py +++ b/dashboard.py @@ -13,7 +13,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.1) + start_offline_tweets('sports1.txt', event_name="tweet", time_factor=0.01) ctx.count = 0 # fire('sample', {'previous': 0.0}) diff --git a/dashboard_static/js/code.js b/dashboard_static/js/code.js index 43be3fd..91a3ed4 100644 --- a/dashboard_static/js/code.js +++ b/dashboard_static/js/code.js @@ -25,6 +25,8 @@ function showFeeds() { } function tweetCell(tweet) { + const date = new Date(tweet.created_at); + console.log(new Intl.DateTimeFormat('en-GB').format(date)); var cell = document.createElement("div"); cell.innerHTML = `
@@ -33,6 +35,7 @@ function tweetCell(tweet) {
${tweet.user.name} @${tweet.user.screen_name} +

${date.getHours()}:${date.getMinutes()}

${tweet.text}
diff --git a/dashboard_static/style/style.css b/dashboard_static/style/style.css index 3b04eee..691191b 100644 --- a/dashboard_static/style/style.css +++ b/dashboard_static/style/style.css @@ -7,9 +7,7 @@ --column-color: #1E1E1E; --secondary: #1D9BF0; } -body { - overflow: hidden; -} + body, html, .container { width: 100%; height: 100%; @@ -95,6 +93,7 @@ body { .tweet { display: flex; + gap: 10px; background-color: var(--tweet-color); border-radius: 16px; padding: 16px; @@ -112,6 +111,12 @@ body { padding-left: 16px; } +.tweet-name { + display: flex; + gap: 1.5%; + +} + .tweet-interactions { display: flex; margin-top: 8px; @@ -152,6 +157,13 @@ body { opacity: 0.8; } +.tweet-date { + color: var(--main-light); + text-decoration: none; + justify-self: flex-end; + opacity: 0.8; +} + .filters-search input { height: 28px; width: 100%; @@ -197,7 +209,6 @@ body { .leftcol, .centercol, .rightcol, .searchcontainer, .popchart { background-color: var(--column-color); - overflow: hidden; } .rightcol { @@ -280,4 +291,4 @@ body { .radius-bottom { border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; -} \ No newline at end of file +}