source: Klonkt/src/views/partials/topnav.ejs@ cb01666

main
Last change on this file since cb01666 was 8f2f97c, checked in by Robin Genis <roboburr@…>, 3 months ago

Prutter (DM feature) fully removed

Reason: redundant feature + unnecessary attack surface (real-time WebSocket +
storing private messages = privacy/abuse risk). Removed: routes/prutter.js,
PrutterService, the WebSocket server in server.js, both DM views, all nav links
(topnav/bottom-tab), the DM button on profiles, the per-site enable_prutter
toggle and column. Existing (empty) DM tables in old DBs remain untouched but
are no longer referenced anywhere. No WebSocket left in the app.

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

  • Property mode set to 100644
File size: 29.1 KB
Line 
1<%
2// Top nav — RESPONSIVE.
3//
4// Mobile (<768px):
5// - Brand centered, small theme-toggle right.
6// - All other actions live in the bottom-tab nav.
7// - Sticky top, blur background, safe-area-top respected.
8//
9// Desktop (≥768px):
10// - Full v9 masthead: brand left, action row right
11// (Archief / Search / Install / Theme / Prutter / User-menu).
12// - bottom-tab is hidden via CSS, so all nav must live here.
13
14const _siteUrlBase = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '';
15const _isAdmin = typeof bodyClass !== 'undefined' && bodyClass.indexOf('on-admin') >= 0;
16const _hasSearch = !site || site.show_search === undefined || site.show_search;
17const _canPost = user && (typeof canMutate === 'undefined' || canMutate)
18 && permissions && permissions.canCreatePost && permissions.canCreatePost(user, site);
19%>
20
21<header class="masthead">
22 <div class="container masthead-inner">
23
24 <!-- Brand block (always visible) -->
25 <div class="masthead-brand">
26 <% if (_isAdmin) { %>
27 <a href="<%= _siteUrlBase %>/" class="nav-link nav-link-admin"><%= t('nav.back_to_site') %></a>
28 <% } else if (typeof tenancy !== 'undefined' && tenancy === 'hub') { %>
29 <%# Hub: de brand gaat naar de hub-home via HTMX. De chrome wordt in hub-modus
30 altijd gerenderd en via body.on-hub (CSS) verborgen op de landing, dus htmx
31 kan schakelen zonder full-reload → de audioplayer blijft leven. %>
32 <a class="nav-hub-home" href="/" aria-label="Home" title="Home"
33 hx-get="/?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="/" hx-indicator="#pcms-loading">
34 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
35 </a>
36 <% } else if (site) { %>
37 <a class="site-title" href="<%= _siteUrlBase %>/"
38 hx-get="<%= _siteUrlBase %>/?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
39 hx-push-url="<%= _siteUrlBase %>/" hx-indicator="#pcms-loading"><%= site.title %></a>
40 <% } else { %>
41 <a class="site-title" href="/">Klonkt</a>
42 <% } %>
43 </div>
44
45 <!-- Mobile: theme toggle ONLY for logged-out users.
46 Logged-in users get the toggle inside the profile sheet
47 (bottom-tab → Profiel → Thema). All other actions in bottom-tab. -->
48 <% if (!user) { %>
49 <div class="top-nav-mobile">
50 <button type="button" class="nav-btn" id="theme-toggle-mobile" aria-label="Thema wisselen" title="Thema wisselen">
51 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"/></svg>
52 </button>
53 </div>
54 <% } %>
55
56 <!-- Desktop-only: full action row -->
57 <nav class="top-nav top-nav-desktop" aria-label="Hoofdnavigatie">
58
59 <% if (!_isAdmin) { %>
60 <a class="nav-link" href="<%= _siteUrlBase %>/archive"
61 hx-get="<%= _siteUrlBase %>/archive?partial=1" hx-target="#pcms-main"
62 hx-swap="innerHTML" hx-push-url="<%= _siteUrlBase %>/archive"
63 hx-indicator="#pcms-loading">
64 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 8v13H3V8"/><rect x="1" y="3" width="22" height="5" rx="1"/><line x1="10" y1="12" x2="14" y2="12"/></svg>
65 <span class="nav-label"><%= t('nav.archive') %></span>
66 </a>
67 <% } %>
68
69 <% if (_hasSearch) { %>
70 <button type="button" class="nav-btn" id="search-toggle" aria-label="<%= t('nav.search') %>" title="<%= t('nav.search') %>">
71 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
72 </button>
73 <% } %>
74
75 <button type="button" class="nav-btn" id="pwa-install-btn" hidden aria-label="App installeren" title="App installeren">
76 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
77 </button>
78
79 <button type="button" class="nav-btn" id="theme-toggle" aria-label="Thema wisselen" title="Thema wisselen">
80 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"/></svg>
81 </button>
82
83 <% if (typeof langs !== 'undefined' && langs && langs.length > 1) {
84 var _curLang = (langs.find(function(l){ return l.active; }) || { code: 'nl' }).code;
85 var _langR = (typeof currentPath !== 'undefined' && currentPath) ? currentPath : '/';
86 %>
87 <details class="lang-menu">
88 <summary class="nav-btn lang-toggle" aria-label="<%= t('nav.language') %>" title="<%= t('nav.language') %>">
89 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>
90 <span class="lang-code"><%= _curLang.toUpperCase() %></span>
91 <svg class="lang-caret" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>
92 </summary>
93 <div class="lang-dropdown" role="menu">
94 <% langs.forEach(function(l){ %>
95 <a class="lang-item<%= l.active ? ' is-active' : '' %>" role="menuitem" href="/lang/<%= l.code %>?r=<%= encodeURIComponent(_langR) %>"><span class="lang-item-code"><%= l.code.toUpperCase() %></span><%= l.name %></a>
96 <% }); %>
97 </div>
98 </details>
99 <% } %>
100
101 <% if (user) { %>
102 <a class="nav-btn nav-notif" href="/notifications" aria-label="<%= t('nav.notifications') %>" title="<%= t('nav.notifications') %>"
103 hx-get="/notifications?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="/notifications" hx-indicator="#pcms-loading">
104 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 0 1-3.46 0"/></svg>
105 <% if (typeof notifUnread !== 'undefined' && notifUnread > 0) { %><span class="notif-badge"><%= notifUnread > 9 ? '9+' : notifUnread %></span><% } %>
106 </a>
107 <% } %>
108
109 <% if (user) { %>
110 <details class="user-menu">
111 <summary class="nav-btn user-toggle" aria-label="Gebruikersmenu">
112 <% if (user.avatar_url) { %>
113 <img class="user-avatar user-avatar-img" src="<%= user.avatar_url %>" alt="">
114 <% } else { %>
115 <span class="user-avatar"><%= user.username.charAt(0).toUpperCase() %></span>
116 <% } %>
117 </summary>
118 <div class="user-dropdown" role="menu">
119 <div class="user-dropdown-header">
120 <% if (user.avatar_url) { %>
121 <img class="udh-avatar" src="<%= user.avatar_url %>" alt="">
122 <% } else { %>
123 <span class="udh-avatar udh-avatar-fallback"><%= user.username.charAt(0).toUpperCase() %></span>
124 <% } %>
125 <div class="udh-meta">
126 <span class="udh-name"><%= user.username %></span>
127 <% if (user.role === 'god') { %>
128 <span class="udh-role">God</span>
129 <% } else if (user.role === 'admin' || user.role === 'moderator') { %>
130 <span class="udh-role"><%= user.role.charAt(0).toUpperCase() + user.role.slice(1) %></span>
131 <% } %>
132 </div>
133 </div>
134 <div class="user-dropdown-list">
135 <a href="/account" role="menuitem" class="udi"
136 hx-get="/account?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
137 hx-push-url="/account" hx-indicator="#pcms-loading">
138 <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
139 <span><%= t('nav.account') %></span>
140 </a>
141 <a href="/notifications" role="menuitem" class="udi"
142 hx-get="/notifications?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
143 hx-push-url="/notifications" hx-indicator="#pcms-loading">
144 <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 0 1-3.46 0"/></svg>
145 <span><%= t('nav.notifications') %><% if (typeof notifUnread !== 'undefined' && notifUnread > 0) { %> (<%= notifUnread %>)<% } %></span>
146 </a>
147 <a href="/favorieten" role="menuitem" class="udi"
148 hx-get="/favorieten?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
149 hx-push-url="/favorieten" hx-indicator="#pcms-loading">
150 <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/></svg>
151 <span><%= t('nav.favorites') %></span>
152 </a>
153 <% if (typeof canSeeBeheer !== 'undefined' && canSeeBeheer) { %>
154 <a href="/admin" role="menuitem" class="udi"
155 hx-get="/admin?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
156 hx-push-url="/admin" hx-indicator="#pcms-loading">
157 <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 3h7v7H3z"/><path d="M14 3h7v7h-7z"/><path d="M14 14h7v7h-7z"/><path d="M3 14h7v7H3z"/></svg>
158 <span><%= t('nav.admin') %></span>
159 </a>
160 <% } %>
161 <% if (_canPost) { %>
162 <a href="<%= _siteUrlBase %>/posts/new" role="menuitem" class="udi"
163 hx-get="<%= _siteUrlBase %>/posts/new?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
164 hx-push-url="<%= _siteUrlBase %>/posts/new" hx-indicator="#pcms-loading">
165 <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"/></svg>
166 <span><%= t('nav.new_post') %></span>
167 </a>
168 <% } %>
169 </div>
170 <div class="user-dropdown-divider" aria-hidden="true"></div>
171 <div class="user-dropdown-list">
172 <a href="/auth/logout" role="menuitem" class="udi udi-danger">
173 <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/></svg>
174 <span><%= t('nav.logout') %></span>
175 </a>
176 </div>
177 </div>
178 </details>
179 <% } else { %>
180 <a class="nav-link" href="/auth/login"
181 hx-get="/auth/login?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
182 hx-push-url="/auth/login" hx-indicator="#pcms-loading">
183 <span class="nav-label"><%= t('nav.login') %></span>
184 </a>
185 <% } %>
186
187 </nav>
188 </div>
189</header>
190
191<!-- Search overlay (shared by mobile bottom-tab + desktop top-nav) -->
192<div id="search-overlay" class="search-overlay" hidden data-suggest="<%= _siteUrlBase %>/search/suggest" data-action="<%= _siteUrlBase %>/search">
193 <div class="container">
194 <form class="search-overlay-form" method="get" action="<%= _siteUrlBase %>/search">
195 <input type="search" name="q" placeholder="<%= t('search.placeholder') %>" autocomplete="off">
196 <button type="submit" class="nav-btn" aria-label="<%= t('search.button') %>">
197 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
198 </button>
199 <button type="button" class="nav-btn" id="search-close" aria-label="<%= t('imed.cancel') %>">
200 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
201 </button>
202 </form>
203 <div id="search-suggest" class="search-suggest" data-lenis-prevent></div>
204 </div>
205</div>
206
207<script>
208(function() {
209 // EÉN keer bedraden. Deze chrome (topnav) wordt bij htmx-navigatie out-of-band
210 // opnieuw ingevoegd → zonder deze guard zou dit script bij elke navigatie EXTRA
211 // listeners stapelen, waardoor de thema-toggle 2× (of vaker) vuurde = geen netto
212 // wisseling ("toggle werkt niet meer"). Alles hieronder is event-delegatie op
213 // body/document, dus het werkt ook voor knoppen die ná deze run (OOB) verschijnen.
214 if (window.__pcmsChromeWired) return;
215 window.__pcmsChromeWired = true;
216
217 function toggleTheme() {
218 var cur = document.documentElement.getAttribute('data-theme') || 'dark';
219 var next = cur === 'dark' ? 'light' : 'dark';
220 document.documentElement.setAttribute('data-theme', next);
221 try { localStorage.setItem('pcms-theme', next); } catch (e) {}
222 }
223 function overlay() { return document.getElementById('search-overlay'); }
224 function openSearch() { var o = overlay(); if (o) { o.hidden = false; var i = o.querySelector('input'); if (i) i.focus(); } }
225 function closeSearch() { var o = overlay(); if (o) { o.hidden = true; var b = document.getElementById('search-suggest'); if (b) b.innerHTML = ''; } }
226
227 document.body.addEventListener('click', function(e) {
228 if (e.target.closest('#theme-toggle, #theme-toggle-mobile, #theme-toggle-footer')) { toggleTheme(); return; }
229 if (e.target.closest('#search-toggle')) { openSearch(); return; }
230 if (e.target.closest('#search-close')) { closeSearch(); return; }
231 // Open dropdowns (gebruikersmenu + taalkeuze) sluiten bij klik erbuiten.
232 document.querySelectorAll('.user-menu[open], .lang-menu[open]').forEach(function(d) {
233 if (!d.contains(e.target)) d.removeAttribute('open');
234 });
235 });
236
237 document.addEventListener('keydown', function(e) {
238 if (e.key === 'Escape') { var o = overlay(); if (o && !o.hidden) closeSearch(); }
239 });
240
241 // ── Live resultaten tijdens typen ───────────────────────────────
242 var _ST = {
243 posts: '<%= t('search.section_posts') %>', tracks: '<%= t('search.section_tracks') %>',
244 events: '<%= t('search.section_events') %>', pages: '<%= t('search.section_pages') %>',
245 all: '<%= t('search.suggest_all') %>', none: '<%= t('search.suggest_empty') %>'
246 };
247 function esc(s) { return String(s == null ? '' : s).replace(/[&<>"]/g, function(c){ return {'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;'}[c]; }); }
248 function renderSuggest(box, d, q, ov) {
249 var html = '';
250 function grp(title, items, fmt) {
251 if (!items || !items.length) return;
252 html += '<div class="ss-group"><div class="ss-title">' + esc(title) + '</div>' + items.map(fmt).join('') + '</div>';
253 }
254 grp(_ST.posts, d.posts, function(p){ return '<a class="ss-item" href="' + esc(p.url) + '">' + esc(p.title) + '</a>'; });
255 grp(_ST.tracks, d.tracks, function(tk){ var sub = tk.artist ? ' <span class="ss-sub">' + esc(tk.artist) + '</span>' : ''; return tk.url ? '<a class="ss-item" href="' + esc(tk.url) + '">' + esc(tk.title) + sub + '</a>' : '<span class="ss-item ss-noclick">' + esc(tk.title) + sub + '</span>'; });
256 grp(_ST.events, d.events, function(ev){ return '<a class="ss-item" href="' + esc(ev.url) + '">' + esc(ev.where || ev.when) + ' <span class="ss-sub">' + esc(ev.when) + '</span></a>'; });
257 grp(_ST.pages, d.pages, function(pg){ return '<a class="ss-item" href="' + esc(pg.url) + '">' + esc(pg.label) + '</a>'; });
258 var hasAny = (d.posts && d.posts.length) || (d.tracks && d.tracks.length) || (d.events && d.events.length) || (d.pages && d.pages.length);
259 if (!hasAny) { box.innerHTML = '<div class="ss-empty">' + esc(_ST.none) + '</div>'; return; }
260 var action = (ov && ov.getAttribute('data-action')) || '/search';
261 html += '<a class="ss-all" href="' + esc(action) + '?q=' + encodeURIComponent(q) + '">' + esc(_ST.all) + '</a>';
262 box.innerHTML = html;
263 }
264 var _sTimer;
265 document.addEventListener('input', function(e) {
266 var inp = e.target.closest && e.target.closest('#search-overlay input[name="q"]');
267 if (!inp) return;
268 var box = document.getElementById('search-suggest');
269 if (!box) return;
270 var q = inp.value.trim();
271 clearTimeout(_sTimer);
272 if (q.length < 2) { box.innerHTML = ''; return; }
273 _sTimer = setTimeout(function() {
274 var ov = document.getElementById('search-overlay');
275 var url = (ov && ov.getAttribute('data-suggest')) || '/search/suggest';
276 fetch(url + '?q=' + encodeURIComponent(q))
277 .then(function(r){ return r.ok ? r.json() : null; })
278 .then(function(d){ if (d) renderSuggest(box, d, q, ov); })
279 .catch(function(){});
280 }, 200);
281 });
282 // Klik op een suggestie → overlay sluiten (de link/boost doet de navigatie).
283 document.addEventListener('click', function(e) {
284 if (e.target.closest && e.target.closest('#search-suggest a')) { var o = overlay(); if (o) o.hidden = true; }
285 });
286})();
287</script>
288
289<style>
290/* ============================================================
291 TOP-NAV — responsive
292 Mobile: brand centered, small theme btn right, NOTHING else.
293 Desktop (≥768px): full v9 layout — brand left, action row right.
294 ============================================================ */
295
296.masthead-inner {
297 /* Override v9's flex-end → space-between so brand is on the left */
298 justify-content: space-between !important;
299 gap: 1rem;
300}
301.masthead-brand .site-title,
302.masthead-brand .nav-link-admin {
303 display: inline-block;
304 vertical-align: middle;
305}
306
307/* Site title is suppressed everywhere — the profile-header carries the brand
308 on content pages, and admin pages have their own "← Terug naar site" link
309 (a different selector, .nav-link-admin, which stays visible). The masthead
310 becomes a thin utility strip with just theme-toggle / search / etc. */
311.masthead-brand .site-title {
312 display: none;
313}
314
315/* Hub-home brand is WÉL zichtbaar — de thuisknop op artiest-/hub-pagina's. */
316.masthead-brand .nav-hub-home {
317 display: inline-flex; align-items: center; justify-content: center;
318 width: 40px; height: 40px;
319 color: var(--ink); text-decoration: none;
320 border-radius: 8px;
321 transition: color 120ms, background 120ms;
322}
323.masthead-brand .nav-hub-home:hover { color: var(--accent); background: var(--paper-2); }
324.masthead-brand .nav-hub-home svg { width: 22px; height: 22px; }
325
326/* On mobile, hide the entire masthead except for admin pages. The brand
327 appears in the profile-header on content pages, and the bottom-tab
328 provides all navigation. Admin keeps it because the "← Terug naar site"
329 link is the only way back to the public site from /admin/*. */
330@media (max-width: 767px) {
331 body:not(.on-admin) .masthead { display: none; }
332}
333
334/* On mobile, center the brand in the masthead */
335@media (max-width: 767px) {
336 .masthead-inner {
337 justify-content: center !important;
338 position: relative;
339 }
340 .masthead-brand {
341 text-align: center;
342 }
343 /* Lone theme button for logged-out users — minimal, icon-only,
344 no border/background to avoid the iOS sticky-hover look. */
345 .top-nav-mobile {
346 position: absolute;
347 right: 0;
348 top: 50%;
349 transform: translateY(-50%);
350 }
351 .top-nav-mobile .nav-btn {
352 width: 44px;
353 height: 44px;
354 padding: 0;
355 background: transparent !important;
356 border-color: transparent !important;
357 color: var(--ink-soft);
358 display: inline-flex;
359 align-items: center;
360 justify-content: center;
361 }
362 .top-nav-mobile .nav-btn:active {
363 transform: scale(0.92);
364 color: var(--ink);
365 }
366 /* Suppress sticky hover on touch — only show feedback for real hover devices */
367 @media (hover: none) {
368 .top-nav-mobile .nav-btn:hover {
369 background: transparent !important;
370 border-color: transparent !important;
371 color: var(--ink-soft);
372 }
373 }
374 .top-nav-desktop {
375 display: none !important;
376 }
377}
378
379/* On desktop, hide the mobile-only theme button */
380@media (min-width: 768px) {
381 .top-nav-mobile { display: none; }
382}
383
384/* ── Admin "back" link styling (inherited from v9 patterns) ── */
385.nav-link-admin {
386 background: var(--accent);
387 color: #fff !important;
388 padding: .5rem .85rem;
389 border-radius: 6px;
390 text-decoration: none;
391 font-family: var(--font-ui);
392 font-size: .875rem;
393 font-weight: 500;
394}
395.nav-link-admin:hover { opacity: .9; color: #fff !important; }
396
397/* ── Tap-target enforcement for all nav buttons on touch ── */
398@media (hover: none) {
399 .nav-btn, .nav-link {
400 min-height: 44px;
401 min-width: 44px;
402 }
403 .nav-btn:active {
404 transform: scale(0.95);
405 background: var(--paper-2);
406 }
407}
408
409/* ── User dropdown (desktop only — mobile uses bottom-tab → /account) ── */
410.user-menu { position: relative; list-style: none; }
411.user-menu > summary {
412 list-style: none; cursor: pointer;
413 padding: .25rem; border-radius: 6px;
414 display: inline-flex; align-items: center;
415 border: 1px solid transparent;
416 transition: all var(--transition);
417}
418.user-menu > summary::-webkit-details-marker { display: none; }
419.user-menu > summary::marker { content: ''; }
420.user-menu > summary:hover { background: var(--paper-2); border-color: var(--rule); }
421.user-avatar {
422 display: inline-flex; align-items: center; justify-content: center;
423 width: 28px; height: 28px; border-radius: 50%;
424 background: var(--paper-2); /* neutral so transparent avatars blend */
425 color: var(--accent); /* fallback initial color */
426 font-family: var(--font-ui); font-weight: 600; font-size: .8rem;
427 pointer-events: none;
428 overflow: hidden;
429}
430.user-avatar-img {
431 /* When the pill renders as <img> instead of <span>, fill it edge-to-edge. */
432 object-fit: cover;
433}
434.user-dropdown {
435 position: absolute; top: calc(100% + .55rem); right: 0;
436 min-width: 220px;
437 padding: .35rem;
438 /* Frosted glass: transparant + zware blur zodat het frosted effect duidelijk is. */
439 background: color-mix(in srgb, var(--paper) 60%, transparent);
440 backdrop-filter: blur(34px) saturate(190%);
441 -webkit-backdrop-filter: blur(34px) saturate(190%);
442 border: 1px solid var(--rule);
443 border-radius: 12px;
444 box-shadow:
445 0 1px 2px color-mix(in srgb, var(--ink) 8%, transparent),
446 0 8px 24px color-mix(in srgb, var(--ink) 14%, transparent),
447 0 16px 48px color-mix(in srgb, var(--ink) 10%, transparent);
448 z-index: 200;
449 font-family: var(--font-ui);
450 transform-origin: top right;
451}
452/* Open animation — only fires when <details open> matches, so closing the
453 dropdown doesn't replay the entry animation. */
454.user-menu[open] > .user-dropdown {
455 animation: ud-fade-in .14s cubic-bezier(.2, .8, .25, 1);
456}
457@keyframes ud-fade-in {
458 from { opacity: 0; transform: translateY(-6px) scale(.98); }
459 to { opacity: 1; transform: translateY(0) scale(1); }
460}
461
462/* Identity header — small avatar + username/role badge */
463.user-dropdown-header {
464 display: flex; align-items: center; gap: .65rem;
465 padding: .55rem .65rem .65rem;
466 border-bottom: 1px solid color-mix(in srgb, var(--rule) 65%, transparent);
467 margin-bottom: .35rem;
468}
469.udh-avatar {
470 width: 36px; height: 36px; border-radius: 50%;
471 object-fit: cover;
472 background: var(--paper-2);
473 display: inline-flex; align-items: center; justify-content: center;
474 flex-shrink: 0;
475}
476.udh-avatar-fallback {
477 color: var(--accent); font-weight: 700; font-size: .95rem;
478}
479.udh-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
480.udh-name {
481 font-weight: 600; font-size: .92rem; color: var(--ink);
482 white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px;
483}
484.udh-role {
485 font-size: .68rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
486 color: var(--accent); opacity: .85; margin-top: .12rem;
487}
488
489/* Item list group */
490.user-dropdown-list { display: flex; flex-direction: column; gap: 1px; }
491.user-dropdown-divider {
492 height: 1px;
493 margin: .35rem .25rem;
494 background: color-mix(in srgb, var(--rule) 60%, transparent);
495}
496
497/* Items — icon + label, rounded inner highlight on hover (macOS feel) */
498.user-dropdown .udi {
499 display: flex; align-items: center; gap: .65rem;
500 padding: .5rem .65rem;
501 color: var(--ink); text-decoration: none;
502 font-size: .88rem; font-weight: 500;
503 border-radius: 7px;
504 transition: background var(--transition), color var(--transition), transform var(--transition);
505}
506.user-dropdown .udi:hover,
507.user-dropdown .udi:focus-visible {
508 background: color-mix(in srgb, var(--accent) 10%, var(--paper-2));
509 color: var(--accent);
510 outline: none;
511}
512.user-dropdown .udi:active { transform: scale(.98); }
513.user-dropdown .udi-icon {
514 width: 16px; height: 16px;
515 opacity: .7;
516 flex-shrink: 0;
517 transition: opacity var(--transition);
518}
519.user-dropdown .udi:hover .udi-icon,
520.user-dropdown .udi:focus-visible .udi-icon { opacity: 1; }
521
522/* Logout: subtle danger tint on hover, never on rest. Uses a fixed red so
523 it always reads as a destructive action even if the user's accent is red. */
524.user-dropdown .udi-danger:hover,
525.user-dropdown .udi-danger:focus-visible {
526 background: color-mix(in srgb, #dc2626 14%, var(--paper-2));
527 color: #dc2626;
528}
529
530/* ── Search overlay ── */
531.search-overlay {
532 position: fixed; top: 0; left: 0; right: 0;
533 background: color-mix(in srgb, var(--paper) 96%, transparent);
534 backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
535 border-bottom: 1px solid var(--rule);
536 padding: 1rem 0; z-index: 200;
537 padding-top: calc(1rem + env(safe-area-inset-top, 0));
538 box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 8%, transparent);
539}
540.search-overlay-form { display: flex; gap: .5rem; align-items: center; }
541.search-overlay-form input {
542 flex: 1; padding: .85rem 1rem;
543 min-height: 44px;
544 border: 1px solid var(--rule); border-radius: 8px;
545 font-family: var(--font-ui); font-size: 1rem;
546 background: var(--paper); color: var(--ink);
547}
548.search-overlay-form input:focus {
549 outline: 2px solid var(--accent); outline-offset: 0;
550}
551.search-overlay-form .nav-btn {
552 width: 44px; height: 44px;
553 display: inline-flex; align-items: center; justify-content: center;
554}
555/* Live-resultaten dropdown */
556.search-suggest { margin-top: .6rem; max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: .25rem; }
557.search-suggest:empty { display: none; }
558.ss-group { padding: .25rem 0; }
559.ss-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft, var(--ink-muted)); padding: .35rem .25rem .2rem; }
560.ss-item { display: block; padding: .55rem .6rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .95rem; }
561.ss-item:hover { background: var(--paper-2); color: var(--accent); }
562.ss-item.ss-noclick { opacity: .7; cursor: default; }
563.ss-sub { color: var(--ink-soft, var(--ink-muted)); font-size: .85em; }
564.ss-empty { padding: .8rem .6rem; color: var(--ink-soft, var(--ink-muted)); font-size: .9rem; }
565.ss-all { display: block; margin-top: .35rem; padding: .55rem .6rem; border-top: 1px solid var(--rule); color: var(--accent); font-weight: 600; text-decoration: none; font-size: .9rem; }
566.ss-all:hover { text-decoration: underline; }
567/* Meldingen-bel + ongelezen-badge */
568.nav-notif { position: relative; }
569.notif-badge {
570 position: absolute; top: 1px; right: 1px;
571 min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
572 display: inline-flex; align-items: center; justify-content: center;
573 background: #e0245e; color: #fff; font-size: 10px; font-weight: 700;
574 border-radius: 999px; line-height: 1; pointer-events: none;
575}
576</style>
Note: See TracBrowser for help on using the repository browser.