source: Klonkt/src/views/pages/hub-home.ejs@ 3cd1aaa

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

Hub: always render chrome + CSS toggle (body.on-hub) → hub nav via htmx (no audio jumping)

In hub mode, topnav/view-switcher are now always in the DOM; CSS hides them
on the hub landing (body.on-hub, also toggled in the htmx body-class swap).
Roster, main card, feed, and brand links are now htmx → navigating between
hub-home and an artist happens in-place, so the persistent audio player
stays alive (no jumping). Solo/circle completely unchanged
(renderChrome = !bareChrome there).

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

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