source: Klonkt/src/views/pages/hub-home.ejs@ 44cf44d

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

Audio: Admin/Account navigation via htmx (player stays alive, no jumping)

User-menu (topnav) + hub-home Admin/Account links now use htmx ?partial=1
→ the admin/account page loads into #pcms-main + OOB-chrome (admin
variant), while the audio player in document.body stays alive. Admin pages
have no DOMContentLoaded scripts (IIFEs) so they work via htmx. Logout
remains a full page load.

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

  • Property mode set to 100644
File size: 13.6 KB
Line 
1<div class="hub<%= hub.heroImage ? ' hub--img' : '' %>">
2
3 <%# ── Minimale nav (alleen auth) — over de hero, geen brand/switcher ── %>
4 <nav class="hub-nav">
5 <div class="hub-nav-inner container">
6 <% if (user) { %>
7 <% if (typeof canSeeBeheer !== 'undefined' && canSeeBeheer) { %>
8 <a class="hub-nav-link" href="/admin"
9 hx-get="/admin?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
10 hx-push-url="/admin" hx-indicator="#pcms-loading">Beheer</a>
11 <% } %>
12 <a class="hub-nav-link" href="/account"
13 hx-get="/account?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
14 hx-push-url="/account" hx-indicator="#pcms-loading"><%= user.username %></a>
15 <a class="hub-nav-link" href="/auth/logout">Uitloggen</a>
16 <% } else { %>
17 <a class="hub-nav-link" href="/auth/login">Inloggen</a>
18 <% } %>
19 </div>
20 </nav>
21
22 <%# ── HERO (label) — de pagina begint hier, geen header erboven ────── %>
23 <header class="hub-hero<%= hub.heroImage ? ' has-img' : '' %>"<% if (hub.heroImage) { %> style="--hero-img:url('<%= hub.heroImage %>'); --hero-ov:<%= ((hub.heroOverlay == null ? 45 : hub.heroOverlay)/100).toFixed(2) %>"<% } %>>
24 <div class="hub-hero-inner container">
25 <h1 class="hub-hero-title"><%= hub.title %></h1>
26 <% if (hub.tagline) { %>
27 <p class="hub-hero-tag"><%= hub.tagline %></p>
28 <% } %>
29 <% if (hub.intro) { %>
30 <p class="hub-hero-desc"><%= hub.intro %></p>
31 <% } %>
32 </div>
33 </header>
34
35 <div class="container hub-body">
36
37 <%# ── HOOFDPAGINA (label-/hoofdaccount — geen artiest) ──────────── %>
38 <% if (mainSite) { %>
39 <section class="hub-sec hub-sec-main">
40 <a class="hub-main-card" href="/user/<%= mainSite.slug %>"
41 hx-get="/user/<%= mainSite.slug %>?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
42 hx-push-url="/user/<%= mainSite.slug %>" hx-indicator="#pcms-loading">
43 <% var _mAva = mainSite.profile_photo || mainSite.owner_avatar; %>
44 <span class="hub-main-avatar"<% if (_mAva) { %> style="background-image:url('<%= _mAva %>')"<% } else { %> style="background:<%= mainSite.accent || 'var(--accent)' %>;color:#fff"<% } %>>
45 <% if (!_mAva) { %><%= (mainSite.title || mainSite.slug).charAt(0).toUpperCase() %><% } %>
46 </span>
47 <span class="hub-main-info">
48 <span class="hub-main-badge">Hoofdpagina</span>
49 <span class="hub-main-name"><%= mainSite.title %></span>
50 <% if (mainSite.tagline) { %><span class="hub-main-tag"><%= mainSite.tagline %></span><% } %>
51 </span>
52 <span class="hub-main-cta">Bekijk de pagina <span aria-hidden="true">→</span></span>
53 </a>
54 </section>
55 <% } %>
56
57 <%# ── ARTIESTEN-ROSTER ─────────────────────────────────────────── %>
58 <% if (artists && artists.length) { %>
59 <% var _total = (typeof totalArtists !== 'undefined') ? totalArtists : artists.length; %>
60 <% var _hasMore = _total > artists.length; %>
61 <section class="hub-sec">
62 <h2 class="hub-sec-title">
63 Leden
64 <% if (_hasMore) { %><span class="hub-sec-count"><%= _total %></span><% } %>
65 </h2>
66 <div class="roster">
67 <% artists.forEach(function(a){ %>
68 <a class="roster-card" href="/user/<%= a.slug %>"
69 hx-get="/user/<%= a.slug %>?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
70 hx-push-url="/user/<%= a.slug %>" hx-indicator="#pcms-loading">
71 <% var _ava = a.profile_photo || a.owner_avatar; %>
72 <span class="roster-avatar"<% if (_ava) { %> style="background-image:url('<%= _ava %>')"<% } else { %> style="background:<%= a.accent || 'var(--accent)' %>;color:#fff"<% } %>>
73 <% if (!_ava) { %><%= (a.title || a.slug).charAt(0).toUpperCase() %><% } %>
74 </span>
75 <span class="roster-name"><%= a.title %></span>
76 <% if (a.tagline) { %><span class="roster-tag"><%= a.tagline %></span><% } %>
77 <span class="roster-count"><%= a.post_count %> post<%= a.post_count === 1 ? '' : 's' %></span>
78 </a>
79 <% }); %>
80 </div>
81 <% if (_hasMore) { %>
82 <div class="hub-more">
83 <a class="hub-more-link" href="/leden">Alle <%= _total %> leden <span aria-hidden="true">→</span></a>
84 </div>
85 <% } %>
86 </section>
87 <% } %>
88
89 <%# ── LAATSTE POSTS ────────────────────────────────────────────── %>
90 <% if (posts && posts.length) { %>
91 <section class="hub-sec">
92 <h2 class="hub-sec-title">Laatste posts van onze leden.</h2>
93 <div class="hub-feed">
94 <% posts.forEach(function(p){ %>
95 <a class="feed-item" href="/user/<%= p.site_slug %>/<%= p.slug %>"
96 hx-get="/user/<%= p.site_slug %>/<%= p.slug %>?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
97 hx-push-url="/user/<%= p.site_slug %>/<%= p.slug %>" hx-indicator="#pcms-loading">
98 <% if (p.cover_image_url) { %>
99 <span class="feed-cover" style="background-image:url('<%= p.cover_image_url %>')"></span>
100 <% } %>
101 <span class="feed-body">
102 <span class="feed-meta"><%= p.site_title %> · <%= formatDate(p.published_at || p.created_at) %></span>
103 <span class="feed-title"><%= p.title %></span>
104 <% if (p.excerpt) { %><span class="feed-excerpt"><%= p.excerpt %></span><% } %>
105 </span>
106 <span class="feed-arrow" aria-hidden="true">→</span>
107 </a>
108 <% }); %>
109 </div>
110 </section>
111 <% } %>
112
113 </div>
114</div>
115
116<style>
117.hub { width: 100%; position: relative; }
118
119/* ── Minimale auth-nav (over de hero) ─────────────────────────────── */
120.hub-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 5; padding: 1rem 0; }
121.hub-nav-inner { display: flex; justify-content: flex-end; align-items: center; gap: 1.4rem; }
122.hub-nav-link {
123 color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.9rem; opacity: 0.85;
124}
125.hub-nav-link:hover { opacity: 1; color: var(--accent); }
126.hub--img .hub-nav-link { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
127.hub--img .hub-nav-link:hover { color: #fff; opacity: 1; }
128
129/* ── Hero ─────────────────────────────────────────────────────────── */
130.hub-hero {
131 display: flex; align-items: center; justify-content: center;
132 min-height: clamp(340px, 58vh, 560px);
133 text-align: center;
134 background:
135 radial-gradient(130% 130% at 50% -10%, color-mix(in srgb, var(--accent) 26%, var(--paper)) 0%, var(--paper) 62%);
136 border-bottom: 1px solid var(--rule);
137}
138.hub-hero.has-img {
139 background:
140 linear-gradient(rgba(0,0,0,var(--hero-ov,.45)), rgba(0,0,0,var(--hero-ov,.45))),
141 var(--hero-img) center / cover no-repeat;
142 border-bottom: 0;
143 color: #fff;
144}
145.hub-hero-inner { padding: 3.5rem 1rem; }
146.hub-hero-title {
147 font-family: var(--font-display, serif);
148 font-size: clamp(2.6rem, 7vw, 4.4rem);
149 line-height: 1.02; margin: 0; letter-spacing: -0.015em;
150}
151.hub-hero-tag {
152 margin: 0.7rem 0 0; font-size: 1.05rem; font-weight: 600;
153 text-transform: uppercase; letter-spacing: 0.1em;
154 color: var(--accent);
155}
156.hub-hero.has-img .hub-hero-tag { color: #fff; opacity: 0.92; }
157.hub-hero-desc {
158 margin: 1.1rem auto 0; max-width: 48ch;
159 font-size: 1.1rem; line-height: 1.55; color: var(--ink-muted);
160}
161.hub-hero.has-img .hub-hero-desc { color: rgba(255,255,255,.9); }
162
163.hub-body { padding-bottom: 4.5rem; }
164.hub-sec { margin-top: 3rem; }
165.hub-sec-title {
166 font-family: var(--font-display, serif);
167 font-size: 1.5rem; margin: 0 0 1.2rem;
168 display: flex; align-items: center; gap: 0.75rem;
169}
170.hub-sec-title::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
171.hub-sec-count {
172 font-family: var(--font-ui, system-ui); font-size: 0.8rem; font-weight: 700;
173 color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
174 padding: 0.1rem 0.55rem; border-radius: 99px; order: 1;
175}
176.hub-more { margin-top: 1.25rem; text-align: center; }
177.hub-more-link {
178 display: inline-flex; align-items: center; gap: 0.4rem;
179 padding: 0.6rem 1.3rem; border: 1px solid var(--rule); border-radius: 99px;
180 background: var(--paper-2); color: var(--ink); text-decoration: none;
181 font-weight: 600; font-size: 0.92rem; transition: border-color 140ms, background 140ms;
182}
183.hub-more-link:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--paper-2)); }
184
185/* ── Hoofdpagina-kaart (label-/hoofdaccount, apart van de artiesten) ── */
186.hub-sec-main { margin-top: 2.25rem; }
187.hub-main-card {
188 display: flex; align-items: center; gap: 1.25rem;
189 padding: 1.2rem 1.5rem;
190 border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--rule));
191 border-radius: 18px;
192 background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 11%, var(--paper-2)) 0%, var(--paper-2) 72%);
193 color: var(--ink); text-decoration: none;
194 transition: border-color 140ms, transform 140ms, box-shadow 140ms;
195}
196.hub-main-card:hover {
197 border-color: var(--accent); transform: translateY(-2px);
198 box-shadow: 0 12px 30px -16px color-mix(in srgb, var(--accent) 60%, transparent);
199}
200.hub-main-avatar {
201 width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
202 background-size: cover; background-position: center;
203 display: inline-flex; align-items: center; justify-content: center;
204 font-family: var(--font-display, serif); font-size: 1.8rem; font-weight: 700; color: #fff;
205 box-shadow: inset 0 0 0 2px rgba(255,255,255,.18);
206}
207.hub-main-info { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; flex: 1; }
208.hub-main-badge {
209 align-self: flex-start; font-size: 0.65rem; font-weight: 700;
210 text-transform: uppercase; letter-spacing: 0.08em;
211 color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent);
212 padding: 0.12rem 0.55rem; border-radius: 99px;
213}
214.hub-main-name { font-family: var(--font-display, serif); font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
215.hub-main-tag { color: var(--ink-muted); font-size: 0.9rem; }
216.hub-main-cta { color: var(--accent); font-weight: 600; font-size: 0.9rem; white-space: nowrap; flex-shrink: 0; }
217@media (max-width: 560px) {
218 .hub-main-card { flex-direction: column; text-align: center; }
219 .hub-main-info { align-items: center; }
220 .hub-main-badge { align-self: center; }
221 .hub-main-cta { display: none; }
222}
223
224/* ── Roster (artiesten) ───────────────────────────────────────────── */
225.roster {
226 display: grid;
227 grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
228 gap: 1rem;
229}
230.roster-card {
231 display: flex; flex-direction: column; align-items: center; text-align: center;
232 gap: 0.4rem; padding: 1.6rem 1rem 1.3rem;
233 border: 1px solid var(--rule); border-radius: 16px;
234 background: var(--paper-2); color: var(--ink); text-decoration: none;
235 transition: border-color 140ms, transform 140ms, box-shadow 140ms;
236}
237.roster-card:hover {
238 border-color: var(--accent); transform: translateY(-3px);
239 box-shadow: 0 10px 28px -14px color-mix(in srgb, var(--accent) 55%, transparent);
240}
241.roster-avatar {
242 width: 88px; height: 88px; border-radius: 50%; margin-bottom: 0.45rem;
243 background-size: cover; background-position: center;
244 display: inline-flex; align-items: center; justify-content: center;
245 font-family: var(--font-display, serif); font-size: 2.1rem; font-weight: 700; color: #fff;
246 box-shadow: inset 0 0 0 2px rgba(255,255,255,.18);
247}
248.roster-name { font-weight: 700; font-size: 1.1rem; }
249.roster-tag { color: var(--ink-muted); font-size: 0.82rem; }
250.roster-count {
251 margin-top: 0.35rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
252 color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
253 padding: 0.15rem 0.6rem; border-radius: 99px;
254}
255
256/* ── Feed (laatste posts) ─────────────────────────────────────────── */
257.hub-feed { display: flex; flex-direction: column; gap: 0.6rem; }
258.feed-item {
259 display: flex; align-items: center; gap: 1rem;
260 padding: 0.9rem 1rem; border: 1px solid var(--rule); border-radius: 12px;
261 background: var(--paper-2); color: var(--ink); text-decoration: none;
262 transition: border-color 140ms, background 140ms;
263}
264.feed-item:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--paper-2)); }
265.feed-cover {
266 width: 64px; height: 64px; border-radius: 8px; flex-shrink: 0;
267 background-size: cover; background-position: center; background-color: var(--paper);
268}
269.feed-body { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; flex: 1; }
270.feed-meta { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); }
271.feed-title { font-weight: 600; font-size: 1.05rem; line-height: 1.25; }
272.feed-excerpt {
273 color: var(--ink-muted); font-size: 0.88rem; line-height: 1.4;
274 display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
275}
276.feed-arrow { color: var(--ink-muted); font-size: 1.2rem; flex-shrink: 0; transition: transform 140ms, color 140ms; }
277.feed-item:hover .feed-arrow { color: var(--accent); transform: translateX(3px); }
278
279@media (max-width: 560px) {
280 .hub-hero-inner { padding: 2.5rem 1rem; }
281 .feed-cover { width: 52px; height: 52px; }
282 .feed-arrow { display: none; }
283}
284</style>
Note: See TracBrowser for help on using the repository browser.