twitter hour help me lol

This commit is contained in:
msoliman3
2022-11-03 14:23:49 +01:00
parent 20e70ae032
commit a6e3a12761
3 changed files with 20 additions and 6 deletions

View File

@@ -13,7 +13,7 @@ root_content_path = 'dashboard_static'
# the action will be called with the context and the event # the action will be called with the context and the event
@event('init') @event('init')
def setup(ctx, e): 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 ctx.count = 0
# fire('sample', {'previous': 0.0}) # fire('sample', {'previous': 0.0})

View File

@@ -25,6 +25,8 @@ function showFeeds() {
} }
function tweetCell(tweet) { function tweetCell(tweet) {
const date = new Date(tweet.created_at);
console.log(new Intl.DateTimeFormat('en-GB').format(date));
var cell = document.createElement("div"); var cell = document.createElement("div");
cell.innerHTML = cell.innerHTML =
`<div class="tweet"> `<div class="tweet">
@@ -33,6 +35,7 @@ function tweetCell(tweet) {
<div class="tweet-name"> <div class="tweet-name">
<a class="tweet-nickname" href = "https://www.twitter.com/${tweet.user.screen_name}" target = "_blank">${tweet.user.name}</a> <a class="tweet-nickname" href = "https://www.twitter.com/${tweet.user.screen_name}" target = "_blank">${tweet.user.name}</a>
<a class="tweet-username" href = "https://www.twitter.com/${tweet.user.screen_name}" target = "_blank">@${tweet.user.screen_name}</a> <a class="tweet-username" href = "https://www.twitter.com/${tweet.user.screen_name}" target = "_blank">@${tweet.user.screen_name}</a>
<p class="tweet-date tweet-username"><em>${date.getHours()}:${date.getMinutes()}</em></p>
</div> </div>
<span class="tweet-text">${tweet.text}</span> <span class="tweet-text">${tweet.text}</span>
<div class="tweet-interactions"> <div class="tweet-interactions">

View File

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