332 lines
9.7 KiB
HTML
332 lines
9.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>{{ app.title }}</title>
|
|
<meta name="theme-color" content="#3054bf">
|
|
{% if threads|length == 1 %}
|
|
<meta name="description" content="{{ threads[0].content }}" />
|
|
<meta property="og:description" content="{{ threads[0].content }}" />
|
|
{% else %}
|
|
<meta name="description" content="{{ app.description }}" />
|
|
<meta property="og:description" content="{{ app.description }}" />
|
|
{% endif %}
|
|
<meta name="author" content="{{ attribution.owner }}" />
|
|
<meta property="og:type" content="website" />
|
|
<meta property="og:site_name" content="{{ app.site_name }}" />
|
|
<meta property="og:title" content="{{ app.title }}" />
|
|
|
|
<link rel="stylesheet" href="https://webcomponent.io/reset.css" />
|
|
<style>
|
|
body {
|
|
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
|
|
max-width: 600px;
|
|
margin: 0 auto;
|
|
color: #232323;
|
|
padding: 5px;
|
|
}
|
|
header, footer {
|
|
padding: 1em;
|
|
}
|
|
main {
|
|
padding: 1em 0;
|
|
}
|
|
header, footer {
|
|
background: linear-gradient(45deg, #3054bf, #416fff);
|
|
color: white;
|
|
border-radius: 5px;
|
|
& a {
|
|
color: white;
|
|
}
|
|
}
|
|
|
|
main .back {
|
|
& a {
|
|
text-decoration: none;
|
|
}
|
|
& a::before {
|
|
content: '\25C0';
|
|
}
|
|
}
|
|
|
|
ul {
|
|
list-style: none;
|
|
}
|
|
|
|
.card.descendant {
|
|
/* TODO: damn, fix the markup maybe */
|
|
margin-left: calc(-80px - 1em - 5px);
|
|
}
|
|
.card {
|
|
margin-left: -40px;
|
|
background-color: #fff;
|
|
display: grid;
|
|
grid-template-columns: 55px auto;
|
|
gap: 5px;
|
|
padding: 1em 0;
|
|
}
|
|
|
|
.card_content {
|
|
& .invisible {
|
|
display: none;
|
|
}
|
|
|
|
& .emoji {
|
|
display: inline;
|
|
height: calc(1rem + 6px);
|
|
margin-bottom: -4px;
|
|
}
|
|
|
|
& .ellipsis::after {
|
|
content: '...'
|
|
}
|
|
|
|
& .body {
|
|
|
|
& code {
|
|
background: rgb(245, 242, 240);
|
|
padding: 0.25em 0.3em;
|
|
border-radius: 5px;
|
|
display: inline;
|
|
}
|
|
|
|
& .media, & .link_card {
|
|
border: 1px solid rgba(34, 34, 34, 0.15);
|
|
border-radius: 5px;
|
|
box-shadow: 5px 25px 10px -25px rgba(34, 34, 34, 0.15);
|
|
max-width: 100%;
|
|
margin-bottom: 1em;
|
|
object-fit: cover;
|
|
}
|
|
|
|
& .media:hover, & .link_card:hover {
|
|
color: blue;
|
|
text-decoration-color: blue;
|
|
border-color: blue;
|
|
}
|
|
|
|
|
|
& p {
|
|
margin-bottom: 0.5em;
|
|
}
|
|
}
|
|
|
|
& .author a {
|
|
display: block;
|
|
margin-bottom: 0.5em;
|
|
text-decoration: none;
|
|
color: #232323;
|
|
|
|
&:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
}
|
|
|
|
& .meta {
|
|
margin-bottom: 5px;
|
|
|
|
& a {
|
|
font-size: small;
|
|
color: #555;
|
|
}
|
|
& a:hover {
|
|
color: blue;
|
|
}
|
|
|
|
}
|
|
|
|
& .action {
|
|
color: blue;
|
|
margin: 1em 0;
|
|
cursor: pointer;
|
|
margin-top: 1em;
|
|
}
|
|
|
|
& .link_card {
|
|
color: #555;
|
|
text-decoration: underline;
|
|
text-decoration-color: #888;
|
|
|
|
& strong, & small {
|
|
text-decoration-thickness: 1px;
|
|
display: block;
|
|
}
|
|
|
|
padding: 1rem;
|
|
}
|
|
}
|
|
|
|
.card_avatar img {
|
|
border-radius: 50%;
|
|
display: inline;
|
|
width: 50px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<nav><a href="/">Go home</a></nav>
|
|
<h1>{{ app.title }}</h1>
|
|
<p>{{ app.description }}</p>
|
|
</header>
|
|
<main>
|
|
{% if threads|length == 1 and threads[0].descendants %}
|
|
<div class="back">
|
|
<a href="{{url_for('threads.home')}}">Back</a>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<ul>
|
|
{% for thread in threads %}
|
|
<li class="card">
|
|
<div class="card_avatar">
|
|
{% if thread.account.avatar is defined %}
|
|
<a href="{{ thread.account.url }}">
|
|
<img class="avatar" src="{{ thread.account.avatar }}"
|
|
alt="avatar of {{ thread.account.display_name }}"
|
|
title="avatar of {{ thread.account.display_name }}" />
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="card_content" id="{{ thread.id }}">
|
|
<h3 class="author">
|
|
<a rel="author" href="{{thread.account.url}}"
|
|
>{{thread.account.display_name | safe}}</a
|
|
>
|
|
</h3>
|
|
|
|
<div class="body">
|
|
{{thread.content | safe}} {% if thread.descendants is defined %}
|
|
{% for media in thread.media_attachments %} {% if media.type ==
|
|
'image'%}
|
|
<a href="{{ media.url }}">
|
|
<img
|
|
class="media"
|
|
src="{{media.preview_url}}"
|
|
alt="{{ media.description or 'media attachment' }}"
|
|
title="{{ media.description or 'media attachment' }}"
|
|
/>
|
|
</a>
|
|
{% elif media.type == 'gifv' %}
|
|
<video
|
|
class="media"
|
|
controls
|
|
autoplay="autoplay"
|
|
muted
|
|
loop
|
|
alt="{{ media.description or 'media attachment' }}"
|
|
title="{{ media.description or 'media attachment' }}"
|
|
>
|
|
<source src="{{media.url}}" type="video/mp4" />
|
|
Your browser does not support the video tag.
|
|
</video>
|
|
{% endif %} {% endfor %} {% endif %}
|
|
</div>
|
|
|
|
{% if thread.descendants is defined %}
|
|
<div class="meta">
|
|
<a href="{{thread.url}}" target="_blank"
|
|
>{{ thread.created_at }}</a
|
|
>
|
|
</div>
|
|
|
|
<ul>
|
|
{% for descendant in thread.descendants %}
|
|
<li class="card descendant">
|
|
<div class="card_avatar">
|
|
{% if descendant.account.avatar is defined %}
|
|
<a href="{{ descendant.account.url }}">
|
|
<img class="avatar" src="{{ descendant.account.avatar }}"
|
|
alt="avatar of {{ descendant.account.display_name }}"
|
|
title="avatar of {{ descendant.account.display_name }}" />
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="card_content" id="{{ descendant.id }}">
|
|
<h3 class="author">
|
|
<a rel="author" href="{{descendant.account.url}}"
|
|
>{{descendant.account.display_name | safe}}</a
|
|
>
|
|
</h3>
|
|
<div class="body">
|
|
{{ descendant.content | safe }}
|
|
{% for media in descendant.media_attachments%}
|
|
{% if media.type == 'image'%}
|
|
<a href="{{ media.url }}">
|
|
<img
|
|
class="media"
|
|
src="{{media.preview_url}}"
|
|
alt="{{ media.description or 'media attachment' }}"
|
|
title="{{ media.description or 'media attachment' }}"
|
|
/>
|
|
</a>
|
|
{% elif media.type == 'gifv' %}
|
|
<video
|
|
class="media"
|
|
controls
|
|
autoplay="autoplay"
|
|
muted
|
|
loop
|
|
alt="{{ media.description or 'media attachment' }}"
|
|
title="{{ media.description or 'media attachment' }}"
|
|
>
|
|
<source src="{{media.url}}" type="video/mp4" />
|
|
Your browser does not support the video tag.
|
|
</video>
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% if descendant.card %}
|
|
<a href="{{ descendant.card.url }}">
|
|
<div class="link_card">
|
|
<small>
|
|
{{ descendant.card.provider_name or
|
|
descendant.card.provider_url }}
|
|
</small>
|
|
<strong>{{ descendant.card.title }}</strong>
|
|
<small>{{descendant.card.description}}</small>
|
|
</div>
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="meta">
|
|
<a href="{{descendant.url}}" target="_blank"
|
|
>{{ descendant.created_at }}</a
|
|
>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
|
|
<li>{% endfor %}</li>
|
|
</ul>
|
|
|
|
{% else %}
|
|
<a
|
|
class="action"
|
|
href="{{ url_for('threads.thread', id=thread.id) }}"
|
|
>Read full thread</a
|
|
>
|
|
{% endif %}
|
|
</div>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</main>
|
|
<footer>
|
|
<p>
|
|
Copyright ©
|
|
{% if attribution.current_year %}
|
|
{{ attribution.year}}-{{ attribution.current_year }}
|
|
{% else %}
|
|
{{ attribution.year}}
|
|
{% endif %}
|
|
{{ attribution.owner }}
|
|
</p>
|
|
<p>Powered by <a href="https://ayco.io/sh/threads">/threads</a></p>
|
|
</footer>
|
|
</body>
|
|
</html>
|