source: Klonkt/src/views/pages/circle-feed.ejs@ 04a6b15

main
Last change on this file since 04a6b15 was 04a6b15, checked in by roboburr <roboburr@…>, 3 months ago

Circle header scalable: max 6 chips + "+N more" pill + total count

With many circle sites, all chips wrapped into a wall that pushed the feed
down. Now: first 6 named chips + a "+N more" pill (with remaining names in
the tooltip) + "N sites in your circle" line. Compact regardless of count.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@…>

  • Property mode set to 100644
File size: 4.4 KB
Line 
1<div class="container cirkel-hero">
2 <span class="cirkel-badge" aria-hidden="true">
3 <svg viewBox="0 0 64 64" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round">
4 <line x1="32" y1="16" x2="17" y2="45"/>
5 <line x1="32" y1="16" x2="47" y2="45"/>
6 <line x1="17" y1="45" x2="47" y2="45"/>
7 <circle cx="32" cy="16" r="8" fill="currentColor" fill-opacity=".16"/>
8 <circle cx="17" cy="45" r="8" fill="currentColor" fill-opacity=".16"/>
9 <circle cx="47" cy="45" r="8" fill="currentColor" fill-opacity=".16"/>
10 </svg>
11 </span>
12 <h1>Cirkel</h1>
13 <p class="cirkel-sub">Wat er speelt bij de andere sites in mijn cirkel.</p>
14 <% if (typeof sites !== 'undefined' && sites && sites.length) { %>
15 <% var _max = 6; var _more = sites.slice(_max); %>
16 <div class="cirkel-members">
17 <% sites.slice(0, _max).forEach(function(s){ %>
18 <% if (s.url) { %><a class="cirkel-member" href="<%= s.url %>" target="_blank" rel="noopener" title="<%= s.name %>"><% } else { %><span class="cirkel-member" title="<%= s.name %>"><% } %>
19 <span class="cirkel-avatar"<% if (s.avatar) { %> style="background-image:url('<%= s.avatar %>')"<% } %>><% if (!s.avatar) { %><%= (s.name || '?').charAt(0).toUpperCase() %><% } %></span>
20 <span class="cirkel-member-name"><%= s.name %></span>
21 <% if (s.url) { %></a><% } else { %></span><% } %>
22 <% }); %>
23 <% if (_more.length) { %>
24 <span class="cirkel-member cirkel-member--more" title="<%= _more.map(function(s){ return s.name; }).join(', ') %>">+<%= _more.length %> meer</span>
25 <% } %>
26 </div>
27 <% if (sites.length > _max) { %>
28 <p class="cirkel-count"><%= sites.length %> sites in je cirkel</p>
29 <% } %>
30 <% } %>
31</div>
32
33<% if (!posts.length) { %>
34 <div class="container">
35 <p class="cirkel-empty">Nog niets in je cirkel. Voeg sites toe via
36 <a href="/admin/circle">Beheer &rsaquo; Cirkel</a> en ververs ze.</p>
37 </div>
38<% } else { %>
39
40 <%# Dezelfde view als de hoofdpagina: timeline (post-card) + grid (post-tile),
41 gewisseld door de view-switcher via body[data-feed-view]. De remote-posts
42 zijn in circle.js naar het lokale post-shape gevormd (met external_url,
43 zodat de kaarten naar de bron-site linken). %>
44
45 <!-- ===== TIMELINE (standaard) ===== -->
46 <div class="container feed-timeline">
47 <ul class="post-list feed-timeline-list">
48 <% posts.forEach(function(post){ %>
49 <%- include('../partials/post-card', { post: post }) %>
50 <% }); %>
51 </ul>
52 </div>
53
54 <!-- ===== GRID (body[data-feed-view="grid"]) ===== -->
55 <section class="feed-grid container" aria-label="Grid-weergave">
56 <div class="grid-tiles">
57 <% posts.forEach(function(post){ %>
58 <%- include('../partials/post-tile', { post: post }) %>
59 <% }); %>
60 </div>
61 </section>
62
63<% } %>
64
65<style>
66.cirkel-hero { text-align: center; max-width: 640px; margin: 2.5rem auto 2rem; }
67.cirkel-badge { display: block; width: 60px; height: 60px; margin: 0 auto .6rem; color: var(--accent); }
68.cirkel-badge svg { width: 100%; height: 100%; }
69.cirkel-hero h1 { font-family: var(--font-display, serif); font-size: 2.4rem; margin: 0 0 .3rem; }
70.cirkel-sub { color: var(--ink-muted); margin: 0 0 1.25rem; font-size: 1.02rem; }
71.cirkel-members { display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center; }
72.cirkel-member { display: inline-flex; align-items: center; gap: .45rem;
73 padding: .28rem .8rem .28rem .3rem; border: 1px solid var(--rule); border-radius: 999px;
74 text-decoration: none; color: var(--ink); background: var(--paper-2);
75 transition: border-color .15s, transform .15s; }
76.cirkel-member:hover { border-color: var(--accent); transform: translateY(-1px); }
77.cirkel-avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
78 background-size: cover; background-position: center; background-color: var(--accent);
79 color: #fff; display: inline-flex; align-items: center; justify-content: center;
80 font-weight: 700; font-size: .82rem; }
81.cirkel-member-name { font-size: .9rem; font-weight: 600; }
82.cirkel-member--more { padding: .28rem .85rem; font-size: .85rem; font-weight: 700; color: var(--ink-muted); cursor: default; }
83.cirkel-member--more:hover { border-color: var(--rule); transform: none; }
84.cirkel-count { color: var(--ink-muted); font-size: .82rem; margin: .6rem 0 0; }
85.cirkel-empty { color: var(--ink-muted); text-align: center; margin: 2rem auto; }
86.cirkel-empty a { color: var(--accent); }
87</style>
Note: See TracBrowser for help on using the repository browser.