| 1 | <div class="tl-wrap">
|
|---|
| 2 | <h1 class="tl-title"><%= t('tl.title') %></h1>
|
|---|
| 3 | <p class="tl-lead"><%= t('tl.lead') %></p>
|
|---|
| 4 | <% if (typeof success !== 'undefined' && success) { %><div class="alert alert-success"><%= success %></div><% } %>
|
|---|
| 5 | <% if (typeof error !== 'undefined' && error) { %><div class="alert alert-error"><%= error %></div><% } %>
|
|---|
| 6 |
|
|---|
| 7 | <form method="post" action="/tijdlijn/follow" class="tl-follow">
|
|---|
| 8 | <input type="text" name="handle" placeholder="@naam@server.social" autocomplete="off" spellcheck="false" required>
|
|---|
| 9 | <button type="submit" class="btn btn-primary"><%= t('tl.follow_btn') %></button>
|
|---|
| 10 | </form>
|
|---|
| 11 |
|
|---|
| 12 | <% if (following && following.length) { %>
|
|---|
| 13 | <h2 class="tl-sub"><%= t('tl.following') %> (<%= following.length %>)</h2>
|
|---|
| 14 | <ul class="tl-foll-list">
|
|---|
| 15 | <% following.forEach(function(f){ %>
|
|---|
| 16 | <li class="tl-foll">
|
|---|
| 17 | <span class="tl-foll-av"><% if (f.icon) { %><img src="<%= f.icon %>" alt=""><% } else { %><%= (f.name || '?').charAt(0).toUpperCase() %><% } %></span>
|
|---|
| 18 | <span class="tl-foll-meta">
|
|---|
| 19 | <a href="<%= f.url || f.actor_uri %>" target="_blank" rel="nofollow noopener"><%= f.name || f.handle %></a>
|
|---|
| 20 | <span class="tl-foll-handle"><%= f.handle %></span>
|
|---|
| 21 | <% if (f.status === 'pending') { %><span class="tl-pending"><%= t('tl.pending') %></span><% } %>
|
|---|
| 22 | </span>
|
|---|
| 23 | <form method="post" action="/tijdlijn/unfollow"><input type="hidden" name="actor_uri" value="<%= f.actor_uri %>"><button type="submit" class="tl-unfollow"><%= t('tl.unfollow') %></button></form>
|
|---|
| 24 | </li>
|
|---|
| 25 | <% }); %>
|
|---|
| 26 | </ul>
|
|---|
| 27 | <% } %>
|
|---|
| 28 |
|
|---|
| 29 | <h2 class="tl-sub"><%= t('tl.feed') %></h2>
|
|---|
| 30 | <% if (!timeline || !timeline.length) { %>
|
|---|
| 31 | <p class="tl-empty"><%= t('tl.empty') %></p>
|
|---|
| 32 | <% } else { %>
|
|---|
| 33 | <ol class="tl-feed">
|
|---|
| 34 | <% timeline.forEach(function(p){ %>
|
|---|
| 35 | <li class="tl-item">
|
|---|
| 36 | <span class="tl-avatar"><% if (p.author_icon) { %><img src="<%= p.author_icon %>" alt="" loading="lazy"><% } else { %><%= (p.author_name || '?').charAt(0).toUpperCase() %><% } %></span>
|
|---|
| 37 | <div class="tl-itembody">
|
|---|
| 38 | <div class="tl-meta">
|
|---|
| 39 | <a class="tl-author" href="<%= p.author_url || p.author_uri %>" target="_blank" rel="nofollow noopener"><%= p.author_name %></a>
|
|---|
| 40 | <span class="tl-handle"><%= p.author_handle %></span>
|
|---|
| 41 | <% if (p.published || p.created_at) { %><span class="tl-time"><%= formatDateTime(p.published || p.created_at) %></span><% } %>
|
|---|
| 42 | </div>
|
|---|
| 43 | <div class="tl-content"><%- p.content %></div>
|
|---|
| 44 | <% var media = []; try { media = JSON.parse(p.media_json || '[]'); } catch (e) { media = []; } %>
|
|---|
| 45 | <% media.filter(function(m){ return !m.type || /^image\//.test(m.type); }).forEach(function(m){ %><img class="tl-media" src="<%= m.url %>" alt="" loading="lazy"><% }); %>
|
|---|
| 46 | <% if (p.url) { %><p class="tl-orig"><a href="<%= p.url %>" target="_blank" rel="nofollow noopener"><%= t('tl.view_original') %></a></p><% } %>
|
|---|
| 47 | </div>
|
|---|
| 48 | </li>
|
|---|
| 49 | <% }); %>
|
|---|
| 50 | </ol>
|
|---|
| 51 | <% } %>
|
|---|
| 52 | </div>
|
|---|
| 53 |
|
|---|
| 54 | <style>
|
|---|
| 55 | .tl-wrap { max-width: 640px; margin: 2rem auto; padding: 0 1rem; }
|
|---|
| 56 | .tl-title { margin: 0 0 .25rem; }
|
|---|
| 57 | .tl-lead { color: var(--ink-soft, #888); margin: 0 0 1.25rem; }
|
|---|
| 58 | .tl-sub { font-size: 1.1rem; margin: 1.75rem 0 .75rem; }
|
|---|
| 59 | .tl-follow { display: flex; gap: .5rem; margin: 0 0 1rem; flex-wrap: wrap; }
|
|---|
| 60 | .tl-follow input { flex: 1; min-width: 200px; height: 2.4rem; padding: 0 .9rem; border-radius: 999px; font: inherit;
|
|---|
| 61 | border: 1px solid color-mix(in srgb, var(--ink, #000) 18%, transparent); background: color-mix(in srgb, var(--ink, #000) 4%, transparent); color: var(--ink, #000); }
|
|---|
| 62 | .tl-foll-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
|
|---|
| 63 | .tl-foll { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: 12px; background: color-mix(in srgb, var(--ink, #000) 4%, transparent); }
|
|---|
| 64 | .tl-foll-av, .tl-avatar { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: color-mix(in srgb, var(--accent, #888) 20%, transparent); color: var(--accent, #555); }
|
|---|
| 65 | .tl-foll-av img, .tl-avatar img { width: 100%; height: 100%; object-fit: cover; }
|
|---|
| 66 | .tl-foll-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
|
|---|
| 67 | .tl-foll-handle, .tl-handle { color: var(--ink-soft, #888); font-size: .82rem; }
|
|---|
| 68 | .tl-pending { font-size: .72rem; color: var(--ink-soft, #999); }
|
|---|
| 69 | .tl-unfollow { background: none; border: 1px solid color-mix(in srgb, var(--ink, #000) 18%, transparent); border-radius: 8px; padding: .25rem .6rem; font-size: .8rem; color: var(--ink-soft, #888); cursor: pointer; }
|
|---|
| 70 | .tl-unfollow:hover { color: var(--ink, #000); }
|
|---|
| 71 | .tl-empty { color: var(--ink-soft, #888); }
|
|---|
| 72 | .tl-feed { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .9rem; }
|
|---|
| 73 | .tl-item { display: flex; gap: .75rem; padding: .9rem 1rem; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--ink, #000) 9%, transparent); background: color-mix(in srgb, var(--ink, #000) 3%, transparent); }
|
|---|
| 74 | .tl-itembody { flex: 1; min-width: 0; }
|
|---|
| 75 | .tl-meta { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
|
|---|
| 76 | .tl-author { font-weight: 600; color: var(--ink, inherit); text-decoration: none; }
|
|---|
| 77 | .tl-author:hover { text-decoration: underline; }
|
|---|
| 78 | .tl-time { color: var(--ink-soft, #999); font-size: .8rem; margin-left: auto; }
|
|---|
| 79 | .tl-content { margin: .3rem 0 0; line-height: 1.5; overflow-wrap: anywhere; }
|
|---|
| 80 | .tl-content p { margin: .25rem 0; } .tl-content p:first-child { margin-top: 0; }
|
|---|
| 81 | .tl-media { max-width: 100%; height: auto; border-radius: 10px; margin: .5rem 0 0; display: block; }
|
|---|
| 82 | .tl-orig { margin: .5rem 0 0; font-size: .82rem; }
|
|---|
| 83 | .tl-orig a { color: var(--accent, #06c); }
|
|---|
| 84 | </style>
|
|---|