Merge pull request #28 from olinpin/ph

branch merge
This commit is contained in:
2022-11-03 16:44:07 +01:00
committed by GitHub
6 changed files with 28 additions and 6 deletions

View File

Binary file not shown.

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

@@ -24,16 +24,19 @@ 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">
<a href ="https://www.twitter.com/${tweet.user.screen_name}"><img src="${tweet.user.profile_image_url}" onerror="this.src='media/logo.png';" class="tweet-profilepicture"></a> <a href ="https://www.twitter.com/${tweet.user.screen_name}"><img src="${tweet.user.profile_image_url}" onerror="this.src='media/logo.png';" class="tweet-profilepicture"></a>
<div class="tweet-content"> <div class="tweet-content">
<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> <div>
<a class="tweet-username" href = "https://www.twitter.com/${tweet.user.screen_name}" target = "_blank">@${tweet.user.screen_name}</a> <a class="tweet-nickname" href = "https://www.twitter.com/${tweet.user.screen_name}" target = "_blank">${tweet.user.name}</a>
<!-- add tweet date called created_at--> <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.created_at}</p> </div>
<span class="tweet-date"><em>${date.getHours()}:${date.getMinutes()}</em></span>
</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

@@ -93,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;
@@ -108,6 +109,17 @@ body {
.tweet-content { .tweet-content {
padding-left: 16px; padding-left: 16px;
width: 100%;
}
.tweet-name {
display: flex;
gap: 1.5%;
justify-content: space-between;
}
.tweet-date {
align-self: flex-end;
} }
.tweet-interactions { .tweet-interactions {
@@ -150,6 +162,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%;
@@ -301,4 +320,4 @@ body {
.current-sort { .current-sort {
line-height: 36px; line-height: 36px;
} }

View File

Binary file not shown.

View File

Binary file not shown.