168 lines
4.3 KiB
HTML
168 lines
4.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Ayo's Threads</title>
|
|
<link rel="stylesheet" href="https://webcomponent.io/reset.css" />
|
|
<style>
|
|
body {
|
|
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
|
|
max-width: 570px;
|
|
margin: 0 auto;
|
|
color: #232323;
|
|
padding: 5px;
|
|
}
|
|
header, footer {
|
|
background: linear-gradient(45deg, #3054bf, #416fff);
|
|
padding: 1em;
|
|
color: white;
|
|
border-radius: 5px;
|
|
& a {
|
|
color: white;
|
|
}
|
|
}
|
|
p, img, video {
|
|
margin-top: 1em;
|
|
}
|
|
summary:hover {
|
|
text-decoration: underline;
|
|
}
|
|
summary {
|
|
color: blue;
|
|
cursor: pointer;
|
|
margin-top: 1em;
|
|
}
|
|
ul {
|
|
list-style: none;
|
|
}
|
|
.card.descendant {
|
|
padding-bottom: 1em;
|
|
}
|
|
.card {
|
|
border-bottom: 1px solid rgba(34, 34, 34, 0.15);
|
|
margin-left: -40px;
|
|
background-color: #fff;
|
|
display: grid;
|
|
grid-template-columns: 55px auto;
|
|
gap: 5px;
|
|
}
|
|
|
|
.card_content {
|
|
|
|
padding: 1em 0;
|
|
|
|
& .invisible {
|
|
display: none;
|
|
}
|
|
|
|
& .ellipsis::after {
|
|
content: '...'
|
|
}
|
|
|
|
& img, & video {
|
|
border-radius: 5px;
|
|
max-width: 100%;
|
|
object-fit: cover;
|
|
border: 1px solid rgba(34, 34, 34, 0.15);
|
|
}
|
|
|
|
& .meta {
|
|
margin-bottom: 5px;
|
|
|
|
& a {
|
|
font-size: small;
|
|
color: #555;
|
|
}
|
|
& a:hover {
|
|
color: blue;
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
.card_avatar img {
|
|
border: 1px solid rgba(34, 34, 34, 0.35);
|
|
border-radius: 5px;
|
|
display: inline;
|
|
width: 50px;
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>Ayo's Threads</h1>
|
|
<p>See the <a href="https://ayco.io/sh/threads">source code</a>. Or <a href="/">go home</a>.</p>
|
|
</header>
|
|
<main>
|
|
<ul>
|
|
{% for thread in threads %}
|
|
<li class="card">
|
|
|
|
<div class="card_avatar">
|
|
{% if thread.account.avatar is defined %}
|
|
<img class="avatar" src="{{thread.account.avatar}}" />
|
|
{% endif %}
|
|
</div>
|
|
|
|
|
|
<div class="card_content">
|
|
<div class="meta">
|
|
<a href="{{thread.url}}" target="_blank">{{ thread.created_at }}</a>
|
|
</div>
|
|
{{thread.content | safe}}
|
|
|
|
{% for media in thread.media_attachments %}
|
|
{% if media.type == 'image'%}
|
|
<img src="{{media.url}}" />
|
|
{% elif media.type == 'gifv' %}
|
|
<video autoplay loop>
|
|
<source src="{{media.url}}" type="video/mp4">
|
|
Your browser does not support the video tag.
|
|
</video>
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
<details>
|
|
<summary>See more ({{ thread.descendants | length }})</summary>
|
|
<ul>
|
|
{% for descendant in thread.descendants %}
|
|
<li class="card descendant">
|
|
<div class="card_avatar">
|
|
{% if descendant.account.avatar is defined %}
|
|
<img class="avatar" src="{{thread.account.avatar}}" />
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="card_content">
|
|
<div class="meta">
|
|
<a href="{{descendant.url}}" target="_blank">{{ descendant.created_at }}</a>
|
|
</div>
|
|
{{ descendant.content | safe }}
|
|
{% for media in descendant.media_attachments%}
|
|
{% if media.type == 'image'%}
|
|
<img src="{{media.url}}" />
|
|
{% elif media.type == 'gifv' %}
|
|
<video autoplay loop>
|
|
<source src="{{media.url}}" type="video/mp4">
|
|
Your browser does not support the video tag.
|
|
</video>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
<li>
|
|
{% endfor %}
|
|
</ul>
|
|
</details>
|
|
|
|
</div>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</main>
|
|
<footer>
|
|
© 2024 Ayo Ayco
|
|
</footer>
|
|
</body>
|
|
</html>
|