backend/src/templates/latest.eta

81 lines
1.6 KiB
Plaintext

<% layout('./layout') %>
<div class="grid">
<% it.data.forEach(function(v){ %>
<div class="video">
<a href="/watch?v=<%= v.id %>">
<img class="thumbnail" src="<%= v.thumbnail %>" loading="lazy" />
<div class="title"><%= v.title %></div>
<div class="date">Published on <%= v.published %> | Archived on <%= v.archived %></div>
</a>
<div class="channel-profile">
<img src="<%= v.channelAvatar %>" loading="lazy" />
<span class="channel-name">
<a href="/channel/<%= v.channelId %>">
<%= v.channel %>
<% if (it.channelVerified) { %>
<div class="verified"></div>
<% } %>
</a>
</span>
</div>
</div>
<% }) %>
</div>
<style>
.grid {
margin-left: 10%;
margin-right: 10%;
margin-top: 1%;
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media screen and (max-width: 768px) {
.grid {
grid-template-columns: repeat(1, minmax(0, 1fr));
}
}
.video {
padding: 20px;
}
.video img {
width: 100%;
aspect-ratio: 16/9;
}
.title {
margin-top: 5px;
font-size: 20px;
font-weight: bold;
}
.channel-profile {
margin-top: 2px;
display: flex;
align-items: center;
}
.channel-profile img {
border-radius: 50%;
display: inline-block;
width: 20px;
height: 20px;
}
.channel-name {
padding-left: 10px;
font-size: 15px;
}
.verified {
height: 12px;
margin-left: 2px;
content: url('https://api.iconify.design/ion/checkmark-circle.svg');
display: inline-block;
}
</style>