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

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

fix: PrutFolio header + roster show the SITE OWNER's photo, not the viewer's

Bug: profile-header.ejs used user.avatar_url (the LOGGED-IN viewer) as the
profile photo -> every PrutFolio showed the picture of whoever was looking
("studionoord" appeared to change along with the viewer). Now: site.profile_photo
-> avatar of the site owner -> music/initial fallback; never the viewer.
siteOwnerAvatar comes from render.js. Roster (hub overview) likewise: per-site
owner avatar instead of nothing.

Result: an artist's account avatar (/account) is immediately their PrutFolio
photo; one "own picture" that is correct, per user.

Co-Authored-By: Claude <noreply@…>

  • Property mode set to 100644
File size: 8.7 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 (user.role === 'god' || user.role === 'admin' || (typeof userOwnsSite !== 'undefined' && userOwnsSite)) { %>
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>
17
18 <%# ── HERO (label) — de pagina begint hier, geen header erboven ────── %>
19 <header class="hub-hero<%= hub.heroImage ? ' has-img' : '' %>"<% if (hub.heroImage) { %> style="--hero-img:url('<%= hub.heroImage %>')"<% } %>>
20 <div class="hub-hero-inner container">
21 <h1 class="hub-hero-title"><%= hub.title %></h1>
22 <% if (hub.tagline) { %>
23 <p class="hub-hero-tag"><%= hub.tagline %></p>
24 <% } %>
25 <% if (hub.intro) { %>
26 <p class="hub-hero-desc"><%= hub.intro %></p>
27 <% } %>
28 </div>
29 </header>
30
31 <div class="container hub-body">
32
33 <%# ── ARTIESTEN-ROSTER ─────────────────────────────────────────── %>
34 <% if (artists && artists.length) { %>
35 <section class="hub-sec">
36 <h2 class="hub-sec-title">Artiesten</h2>
37 <div class="roster">
38 <% artists.forEach(function(a){ %>
39 <a class="roster-card" href="/user/<%= a.slug %>">
40 <% var _ava = a.profile_photo || a.owner_avatar; %>
41 <span class="roster-avatar"<% if (_ava) { %> style="background-image:url('<%= _ava %>')"<% } else { %> style="background:<%= a.accent || 'var(--accent)' %>;color:#fff"<% } %>>
42 <% if (!_ava) { %><%= (a.title || a.slug).charAt(0).toUpperCase() %><% } %>
43 </span>
44 <span class="roster-name"><%= a.title %></span>
45 <% if (a.tagline) { %><span class="roster-tag"><%= a.tagline %></span><% } %>
46 <span class="roster-count"><%= a.post_count %> post<%= a.post_count === 1 ? '' : 's' %></span>
47 </a>
48 <% }); %>
49 </div>
50 </section>
51 <% } %>
52
53 <%# ── LAATSTE POSTS ────────────────────────────────────────────── %>
54 <% if (posts && posts.length) { %>
55 <section class="hub-sec">
56 <h2 class="hub-sec-title">Laatste posts van users</h2>
57 <div class="hub-feed">
58 <% posts.forEach(function(p){ %>
59 <a class="feed-item" href="/user/<%= p.site_slug %>/<%= p.slug %>">
60 <% if (p.cover_image_url) { %>
61 <span class="feed-cover" style="background-image:url('<%= p.cover_image_url %>')"></span>
62 <% } %>
63 <span class="feed-body">
64 <span class="feed-meta"><%= p.site_title %> · <%= formatDate(p.published_at || p.created_at) %></span>
65 <span class="feed-title"><%= p.title %></span>
66 <% if (p.excerpt) { %><span class="feed-excerpt"><%= p.excerpt %></span><% } %>
67 </span>
68 <span class="feed-arrow" aria-hidden="true">→</span>
69 </a>
70 <% }); %>
71 </div>
72 </section>
73 <% } %>
74
75 </div>
76</div>
77
78<style>
79.hub { width: 100%; position: relative; }
80
81/* ── Minimale auth-nav (over de hero) ─────────────────────────────── */
82.hub-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 5; padding: 1rem 0; }
83.hub-nav-inner { display: flex; justify-content: flex-end; align-items: center; gap: 1.4rem; }
84.hub-nav-link {
85 color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.9rem; opacity: 0.85;
86}
87.hub-nav-link:hover { opacity: 1; color: var(--accent); }
88.hub--img .hub-nav-link { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
89.hub--img .hub-nav-link:hover { color: #fff; opacity: 1; }
90
91/* ── Hero ─────────────────────────────────────────────────────────── */
92.hub-hero {
93 display: flex; align-items: center; justify-content: center;
94 min-height: clamp(340px, 58vh, 560px);
95 text-align: center;
96 background:
97 radial-gradient(130% 130% at 50% -10%, color-mix(in srgb, var(--accent) 26%, var(--paper)) 0%, var(--paper) 62%);
98 border-bottom: 1px solid var(--rule);
99}
100.hub-hero.has-img {
101 background:
102 linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,.55) 100%),
103 var(--hero-img) center / cover no-repeat;
104 border-bottom: 0;
105 color: #fff;
106}
107.hub-hero-inner { padding: 3.5rem 1rem; }
108.hub-hero-title {
109 font-family: var(--font-display, serif);
110 font-size: clamp(2.6rem, 7vw, 4.4rem);
111 line-height: 1.02; margin: 0; letter-spacing: -0.015em;
112}
113.hub-hero-tag {
114 margin: 0.7rem 0 0; font-size: 1.05rem; font-weight: 600;
115 text-transform: uppercase; letter-spacing: 0.1em;
116 color: var(--accent);
117}
118.hub-hero.has-img .hub-hero-tag { color: #fff; opacity: 0.92; }
119.hub-hero-desc {
120 margin: 1.1rem auto 0; max-width: 48ch;
121 font-size: 1.1rem; line-height: 1.55; color: var(--ink-muted);
122}
123.hub-hero.has-img .hub-hero-desc { color: rgba(255,255,255,.9); }
124
125.hub-body { padding-bottom: 4.5rem; }
126.hub-sec { margin-top: 3rem; }
127.hub-sec-title {
128 font-family: var(--font-display, serif);
129 font-size: 1.5rem; margin: 0 0 1.2rem;
130 display: flex; align-items: center; gap: 0.75rem;
131}
132.hub-sec-title::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
133
134/* ── Roster (artiesten) ───────────────────────────────────────────── */
135.roster {
136 display: grid;
137 grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
138 gap: 1rem;
139}
140.roster-card {
141 display: flex; flex-direction: column; align-items: center; text-align: center;
142 gap: 0.4rem; padding: 1.6rem 1rem 1.3rem;
143 border: 1px solid var(--rule); border-radius: 16px;
144 background: var(--paper-2); color: var(--ink); text-decoration: none;
145 transition: border-color 140ms, transform 140ms, box-shadow 140ms;
146}
147.roster-card:hover {
148 border-color: var(--accent); transform: translateY(-3px);
149 box-shadow: 0 10px 28px -14px color-mix(in srgb, var(--accent) 55%, transparent);
150}
151.roster-avatar {
152 width: 88px; height: 88px; border-radius: 50%; margin-bottom: 0.45rem;
153 background-size: cover; background-position: center;
154 display: inline-flex; align-items: center; justify-content: center;
155 font-family: var(--font-display, serif); font-size: 2.1rem; font-weight: 700; color: #fff;
156 box-shadow: inset 0 0 0 2px rgba(255,255,255,.18);
157}
158.roster-name { font-weight: 700; font-size: 1.1rem; }
159.roster-tag { color: var(--ink-muted); font-size: 0.82rem; }
160.roster-count {
161 margin-top: 0.35rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
162 color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
163 padding: 0.15rem 0.6rem; border-radius: 99px;
164}
165
166/* ── Feed (laatste posts) ─────────────────────────────────────────── */
167.hub-feed { display: flex; flex-direction: column; gap: 0.6rem; }
168.feed-item {
169 display: flex; align-items: center; gap: 1rem;
170 padding: 0.9rem 1rem; border: 1px solid var(--rule); border-radius: 12px;
171 background: var(--paper-2); color: var(--ink); text-decoration: none;
172 transition: border-color 140ms, background 140ms;
173}
174.feed-item:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--paper-2)); }
175.feed-cover {
176 width: 64px; height: 64px; border-radius: 8px; flex-shrink: 0;
177 background-size: cover; background-position: center; background-color: var(--paper);
178}
179.feed-body { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; flex: 1; }
180.feed-meta { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); }
181.feed-title { font-weight: 600; font-size: 1.05rem; line-height: 1.25; }
182.feed-excerpt {
183 color: var(--ink-muted); font-size: 0.88rem; line-height: 1.4;
184 display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
185}
186.feed-arrow { color: var(--ink-muted); font-size: 1.2rem; flex-shrink: 0; transition: transform 140ms, color 140ms; }
187.feed-item:hover .feed-arrow { color: var(--accent); transform: translateX(3px); }
188
189@media (max-width: 560px) {
190 .hub-hero-inner { padding: 2.5rem 1rem; }
191 .feed-cover { width: 52px; height: 52px; }
192 .feed-arrow { display: none; }
193}
194</style>
Note: See TracBrowser for help on using the repository browser.