Feat plugin tweets medias (#164)

This commit is contained in:
Simon Lecoq
2021-03-02 02:28:58 +01:00
committed by GitHub
parent 46ef6a1532
commit 3b5f9153c4
5 changed files with 94 additions and 8 deletions

View File

@@ -25,9 +25,23 @@
</div>
<% if (plugins.tweets.profile) { %>
<% if (plugins.tweets.list.length) { %>
<% for (const {text, createdAt } of plugins.tweets.list) { %>
<% for (const {text, createdAt, attachments} of plugins.tweets.list) { %>
<div class="tweet">
<%- text %>
<% if (attachments) { %>
<div class="attachments">
<% for (const {image, title, description, website} of attachments) { %>
<div style="background-image: url('<%= image %>');">
<% if (title) { %>
<div class="infos">
<div class="title"><%= title %></div>
<div class="description"><%= description %></div>
</div>
<% } %>
</div>
<% } %>
</div>
<% } %>
<div class="date"><%= createdAt %></div>
</div>
<% } %>

View File

@@ -326,7 +326,6 @@
.tweet .mention, .tweet .link, .tweet .hashtag {
color: #0366d6;
margin: 0 4px;
}
.tweet .date {
@@ -335,6 +334,50 @@
color: #666666;
}
.tweet .attachments {
display: flex;
width: 450px;
margin-top: 8px;
}
.tweet .attachments > div {
flex: 1 1 0;
width: 0;
border-radius: 6px;
background-position: center;
background-size: cover;
height: 200px;
margin: 2px;
box-shadow: 0px 0px 1px #777777A0;
overflow: hidden;
display: flex;
align-items: flex-end;
}
.tweet .attachments .infos {
background-color: #000000D0;
color: white;
display: flex;
flex-direction: column;
width: 100%;
padding-bottom: 4px;
}
.tweet .attachments .infos > div {
margin: 4px 8px 0;
}
.tweet .attachments .infos .title {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.tweet .attachments .infos .description {
font-size: 11px;
color: #666666;
}
/* Charts and graphs */
.chart {
padding: 0 8px;