diff --git a/dashboard.py b/dashboard.py index 6fb5a52..4f7468e 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 a05d79c..dac7257 100644 --- a/dashboard_static/js/code.js +++ b/dashboard_static/js/code.js @@ -24,16 +24,19 @@ 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 = `
- ${tweet.user.name} - @${tweet.user.screen_name} - -

${tweet.created_at}

+
+ ${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 ec3f7ef..af837df 100644 --- a/dashboard_static/style/style.css +++ b/dashboard_static/style/style.css @@ -93,6 +93,7 @@ body { .tweet { display: flex; + gap: 10px; background-color: var(--tweet-color); border-radius: 16px; padding: 16px; @@ -108,6 +109,17 @@ body { .tweet-content { padding-left: 16px; + width: 100%; +} + +.tweet-name { + display: flex; + gap: 1.5%; + justify-content: space-between; +} + +.tweet-date { + align-self: flex-end; } .tweet-interactions { @@ -154,6 +166,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%; @@ -305,4 +324,4 @@ body { .current-sort { line-height: 36px; -} \ No newline at end of file +}