source: Klonkt/src/views/partials/topnav.ejs@ 484adf8

main
Last change on this file since 484adf8 was 46f3dd6, checked in by Robin Genis <roboburr@…>, 3 months ago

feat(fediverse): split Tijdlijn (feed) from Volgend (following) + put Timeline in the menu

Phase 3 of the Cirkels-on-AP rework. /tijdlijn is now just the reading feed;
following management (follow box, follow list, auto-boost toggles) moves to a new
/volgend page. A shared tab nav switches between them. Timeline gets a top-bar
button next to the bell on desktop and a Tijdlijn entry in the mobile profile
sheet (both admin-only via canManageFedi). follow/unfollow/autoboost now redirect
to /volgend. nl/en/de.

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

  • Property mode set to 100644
File size: 28.6 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: the brand navigates to the hub home via HTMX. The chrome is always
30 rendered in hub mode and hidden on the landing via body.on-hub (CSS), so htmx
31 can switch without a full reload → the audio player stays alive. %>
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 && typeof canManageFedi !== 'undefined' && canManageFedi) { %>
102 <a class="nav-btn" href="/tijdlijn" aria-label="<%= t('tl.title') %>" title="<%= t('tl.title') %>"
103 hx-get="/tijdlijn?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="/tijdlijn" 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"><line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/></svg>
105 </a>
106 <% } %>
107
108 <% if (user && typeof canManageFedi !== 'undefined' && canManageFedi) { %>
109 <a class="nav-btn nav-notif" href="/meldingen" aria-label="<%= t('notif.title') %>" title="<%= t('notif.title') %>"
110 hx-get="/meldingen?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="/meldingen" hx-indicator="#pcms-loading">
111 <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>
112 <% if (typeof notifUnread !== 'undefined' && notifUnread > 0) { %><span class="notif-badge"><%= notifUnread > 9 ? '9+' : notifUnread %></span><% } %>
113 </a>
114 <% } %>
115
116 <% if (user) { %>
117 <details class="user-menu">
118 <summary class="nav-btn user-toggle" aria-label="Gebruikersmenu">
119 <% if (user.avatar_url) { %>
120 <img class="user-avatar user-avatar-img" src="<%= user.avatar_url %>" alt="">
121 <% } else { %>
122 <span class="user-avatar"><%= user.username.charAt(0).toUpperCase() %></span>
123 <% } %>
124 </summary>
125 <div class="user-dropdown" role="menu">
126 <div class="user-dropdown-header">
127 <% if (user.avatar_url) { %>
128 <img class="udh-avatar" src="<%= user.avatar_url %>" alt="">
129 <% } else { %>
130 <span class="udh-avatar udh-avatar-fallback"><%= user.username.charAt(0).toUpperCase() %></span>
131 <% } %>
132 <div class="udh-meta">
133 <span class="udh-name"><%= user.username %></span>
134 <% if (user.role === 'god') { %>
135 <span class="udh-role">God</span>
136 <% } else if (user.role === 'admin' || user.role === 'moderator') { %>
137 <span class="udh-role"><%= user.role.charAt(0).toUpperCase() + user.role.slice(1) %></span>
138 <% } %>
139 </div>
140 </div>
141 <div class="user-dropdown-list">
142 <a href="/account" role="menuitem" class="udi"
143 hx-get="/account?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
144 hx-push-url="/account" hx-indicator="#pcms-loading">
145 <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>
146 <span><%= t('nav.account') %></span>
147 </a>
148 <% if (typeof canSeeBeheer !== 'undefined' && canSeeBeheer) { %>
149 <a href="/admin" role="menuitem" class="udi"
150 hx-get="/admin?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
151 hx-push-url="/admin" hx-indicator="#pcms-loading">
152 <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>
153 <span><%= t('nav.admin') %></span>
154 </a>
155 <% } %>
156 <% if (_canPost) { %>
157 <a href="<%= _siteUrlBase %>/posts/new" role="menuitem" class="udi"
158 hx-get="<%= _siteUrlBase %>/posts/new?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
159 hx-push-url="<%= _siteUrlBase %>/posts/new" hx-indicator="#pcms-loading">
160 <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>
161 <span><%= t('nav.new_post') %></span>
162 </a>
163 <% } %>
164 </div>
165 <div class="user-dropdown-divider" aria-hidden="true"></div>
166 <div class="user-dropdown-list">
167 <a href="/auth/logout" role="menuitem" class="udi udi-danger">
168 <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>
169 <span><%= t('nav.logout') %></span>
170 </a>
171 </div>
172 </div>
173 </details>
174 <% } else { %>
175 <a class="nav-link" href="/auth/login"
176 hx-get="/auth/login?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
177 hx-push-url="/auth/login" hx-indicator="#pcms-loading">
178 <span class="nav-label"><%= t('nav.login') %></span>
179 </a>
180 <% } %>
181
182 </nav>
183 </div>
184</header>
185
186<!-- Search overlay (shared by mobile bottom-tab + desktop top-nav) -->
187<div id="search-overlay" class="search-overlay" hidden data-suggest="<%= _siteUrlBase %>/search/suggest" data-action="<%= _siteUrlBase %>/search">
188 <div class="container">
189 <form class="search-overlay-form" method="get" action="<%= _siteUrlBase %>/search">
190 <input type="search" name="q" placeholder="<%= t('search.placeholder') %>" autocomplete="off">
191 <button type="submit" class="nav-btn" aria-label="<%= t('search.button') %>">
192 <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>
193 </button>
194 <button type="button" class="nav-btn" id="search-close" aria-label="<%= t('imed.cancel') %>">
195 <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>
196 </button>
197 </form>
198 <div id="search-suggest" class="search-suggest" data-lenis-prevent></div>
199 </div>
200</div>
201
202<script>
203(function() {
204 // Wired ONCE. This chrome (topnav) is re-inserted out-of-band during htmx navigation
205 // → without this guard the script would stack EXTRA listeners on every navigation,
206 // causing the theme toggle to fire 2× (or more) = no net change ("toggle stops working").
207 // Everything below uses event delegation on body/document, so it also works for
208 // buttons that appear after this run (OOB).
209 if (window.__pcmsChromeWired) return;
210 window.__pcmsChromeWired = true;
211
212 function toggleTheme() {
213 var cur = document.documentElement.getAttribute('data-theme') || 'dark';
214 var next = cur === 'dark' ? 'light' : 'dark';
215 document.documentElement.setAttribute('data-theme', next);
216 try { localStorage.setItem('pcms-theme', next); } catch (e) {}
217 }
218 function overlay() { return document.getElementById('search-overlay'); }
219 function openSearch() { var o = overlay(); if (o) { o.hidden = false; var i = o.querySelector('input'); if (i) i.focus(); } }
220 function closeSearch() { var o = overlay(); if (o) { o.hidden = true; var b = document.getElementById('search-suggest'); if (b) b.innerHTML = ''; } }
221
222 document.body.addEventListener('click', function(e) {
223 if (e.target.closest('#theme-toggle, #theme-toggle-mobile, #theme-toggle-footer')) { toggleTheme(); return; }
224 if (e.target.closest('#search-toggle')) { openSearch(); return; }
225 if (e.target.closest('#search-close')) { closeSearch(); return; }
226 // Close open dropdowns (user menu + language picker) on click outside.
227 document.querySelectorAll('.user-menu[open], .lang-menu[open]').forEach(function(d) {
228 if (!d.contains(e.target)) d.removeAttribute('open');
229 });
230 });
231
232 document.addEventListener('keydown', function(e) {
233 if (e.key === 'Escape') { var o = overlay(); if (o && !o.hidden) closeSearch(); }
234 });
235
236 // ── Live results while typing ───────────────────────────────────
237 var _ST = {
238 posts: '<%= t('search.section_posts') %>', tracks: '<%= t('search.section_tracks') %>',
239 events: '<%= t('search.section_events') %>', pages: '<%= t('search.section_pages') %>',
240 all: '<%= t('search.suggest_all') %>', none: '<%= t('search.suggest_empty') %>'
241 };
242 function esc(s) { return String(s == null ? '' : s).replace(/[&<>"]/g, function(c){ return {'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;'}[c]; }); }
243 function renderSuggest(box, d, q, ov) {
244 var html = '';
245 function grp(title, items, fmt) {
246 if (!items || !items.length) return;
247 html += '<div class="ss-group"><div class="ss-title">' + esc(title) + '</div>' + items.map(fmt).join('') + '</div>';
248 }
249 grp(_ST.posts, d.posts, function(p){ return '<a class="ss-item" href="' + esc(p.url) + '">' + esc(p.title) + '</a>'; });
250 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>'; });
251 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>'; });
252 grp(_ST.pages, d.pages, function(pg){ return '<a class="ss-item" href="' + esc(pg.url) + '">' + esc(pg.label) + '</a>'; });
253 var hasAny = (d.posts && d.posts.length) || (d.tracks && d.tracks.length) || (d.events && d.events.length) || (d.pages && d.pages.length);
254 if (!hasAny) { box.innerHTML = '<div class="ss-empty">' + esc(_ST.none) + '</div>'; return; }
255 var action = (ov && ov.getAttribute('data-action')) || '/search';
256 html += '<a class="ss-all" href="' + esc(action) + '?q=' + encodeURIComponent(q) + '">' + esc(_ST.all) + '</a>';
257 box.innerHTML = html;
258 }
259 var _sTimer;
260 document.addEventListener('input', function(e) {
261 var inp = e.target.closest && e.target.closest('#search-overlay input[name="q"]');
262 if (!inp) return;
263 var box = document.getElementById('search-suggest');
264 if (!box) return;
265 var q = inp.value.trim();
266 clearTimeout(_sTimer);
267 if (q.length < 2) { box.innerHTML = ''; return; }
268 _sTimer = setTimeout(function() {
269 var ov = document.getElementById('search-overlay');
270 var url = (ov && ov.getAttribute('data-suggest')) || '/search/suggest';
271 fetch(url + '?q=' + encodeURIComponent(q))
272 .then(function(r){ return r.ok ? r.json() : null; })
273 .then(function(d){ if (d) renderSuggest(box, d, q, ov); })
274 .catch(function(){});
275 }, 200);
276 });
277 // Click on a suggestion → close the overlay (the link/boost handles navigation).
278 document.addEventListener('click', function(e) {
279 if (e.target.closest && e.target.closest('#search-suggest a')) { var o = overlay(); if (o) o.hidden = true; }
280 });
281})();
282</script>
283
284<style>
285/* ============================================================
286 TOP-NAV — responsive
287 Mobile: brand centered, small theme btn right, NOTHING else.
288 Desktop (≥768px): full v9 layout — brand left, action row right.
289 ============================================================ */
290
291.masthead-inner {
292 /* Override v9's flex-end → space-between so brand is on the left */
293 justify-content: space-between !important;
294 gap: 1rem;
295}
296.masthead-brand .site-title,
297.masthead-brand .nav-link-admin {
298 display: inline-block;
299 vertical-align: middle;
300}
301
302/* Site title is suppressed everywhere — the profile-header carries the brand
303 on content pages, and admin pages have their own "← Terug naar site" link
304 (a different selector, .nav-link-admin, which stays visible). The masthead
305 becomes a thin utility strip with just theme-toggle / search / etc. */
306.masthead-brand .site-title {
307 display: none;
308}
309
310/* Hub-home brand IS visible — the home button on artist/hub pages. */
311.masthead-brand .nav-hub-home {
312 display: inline-flex; align-items: center; justify-content: center;
313 width: 40px; height: 40px;
314 color: var(--ink); text-decoration: none;
315 border-radius: 8px;
316 transition: color 120ms, background 120ms;
317}
318.masthead-brand .nav-hub-home:hover { color: var(--accent); background: var(--paper-2); }
319.masthead-brand .nav-hub-home svg { width: 22px; height: 22px; }
320
321/* On mobile, hide the entire masthead except for admin pages. The brand
322 appears in the profile-header on content pages, and the bottom-tab
323 provides all navigation. Admin keeps it because the "← Terug naar site"
324 link is the only way back to the public site from /admin/*. */
325@media (max-width: 767px) {
326 body:not(.on-admin) .masthead { display: none; }
327}
328
329/* On mobile, center the brand in the masthead */
330@media (max-width: 767px) {
331 .masthead-inner {
332 justify-content: center !important;
333 position: relative;
334 }
335 .masthead-brand {
336 text-align: center;
337 }
338 /* Lone theme button for logged-out users — minimal, icon-only,
339 no border/background to avoid the iOS sticky-hover look. */
340 .top-nav-mobile {
341 position: absolute;
342 right: 0;
343 top: 50%;
344 transform: translateY(-50%);
345 }
346 .top-nav-mobile .nav-btn {
347 width: 44px;
348 height: 44px;
349 padding: 0;
350 background: transparent !important;
351 border-color: transparent !important;
352 color: var(--ink-soft);
353 display: inline-flex;
354 align-items: center;
355 justify-content: center;
356 }
357 .top-nav-mobile .nav-btn:active {
358 transform: scale(0.92);
359 color: var(--ink);
360 }
361 /* Suppress sticky hover on touch — only show feedback for real hover devices */
362 @media (hover: none) {
363 .top-nav-mobile .nav-btn:hover {
364 background: transparent !important;
365 border-color: transparent !important;
366 color: var(--ink-soft);
367 }
368 }
369 .top-nav-desktop {
370 display: none !important;
371 }
372}
373
374/* On desktop, hide the mobile-only theme button */
375@media (min-width: 768px) {
376 .top-nav-mobile { display: none; }
377}
378
379/* ── Admin "back" link styling (inherited from v9 patterns) ── */
380.nav-link-admin {
381 background: var(--accent);
382 color: #fff !important;
383 padding: .5rem .85rem;
384 border-radius: 6px;
385 text-decoration: none;
386 font-family: var(--font-ui);
387 font-size: .875rem;
388 font-weight: 500;
389}
390.nav-link-admin:hover { opacity: .9; color: #fff !important; }
391
392/* ── Tap-target enforcement for all nav buttons on touch ── */
393@media (hover: none) {
394 .nav-btn, .nav-link {
395 min-height: 44px;
396 min-width: 44px;
397 }
398 .nav-btn:active {
399 transform: scale(0.95);
400 background: var(--paper-2);
401 }
402}
403
404/* ── User dropdown (desktop only — mobile uses bottom-tab → /account) ── */
405.user-menu { position: relative; list-style: none; }
406.user-menu > summary {
407 list-style: none; cursor: pointer;
408 padding: .25rem; border-radius: 6px;
409 display: inline-flex; align-items: center;
410 border: 1px solid transparent;
411 transition: all var(--transition);
412}
413.user-menu > summary::-webkit-details-marker { display: none; }
414.user-menu > summary::marker { content: ''; }
415.user-menu > summary:hover { background: var(--paper-2); border-color: var(--rule); }
416.user-avatar {
417 display: inline-flex; align-items: center; justify-content: center;
418 width: 28px; height: 28px; border-radius: 50%;
419 background: var(--paper-2); /* neutral so transparent avatars blend */
420 color: var(--accent); /* fallback initial color */
421 font-family: var(--font-ui); font-weight: 600; font-size: .8rem;
422 pointer-events: none;
423 overflow: hidden;
424}
425.user-avatar-img {
426 /* When the pill renders as <img> instead of <span>, fill it edge-to-edge. */
427 object-fit: cover;
428}
429.user-dropdown {
430 position: absolute; top: calc(100% + .55rem); right: 0;
431 min-width: 220px;
432 padding: .35rem;
433 /* Frosted glass: transparent + heavy blur so the frosted effect is clearly visible. */
434 background: color-mix(in srgb, var(--paper) 60%, transparent);
435 backdrop-filter: blur(34px) saturate(190%);
436 -webkit-backdrop-filter: blur(34px) saturate(190%);
437 border: 1px solid var(--rule);
438 border-radius: 12px;
439 box-shadow:
440 0 1px 2px color-mix(in srgb, var(--ink) 8%, transparent),
441 0 8px 24px color-mix(in srgb, var(--ink) 14%, transparent),
442 0 16px 48px color-mix(in srgb, var(--ink) 10%, transparent);
443 z-index: 200;
444 font-family: var(--font-ui);
445 transform-origin: top right;
446}
447/* Open animation — only fires when <details open> matches, so closing the
448 dropdown doesn't replay the entry animation. */
449.user-menu[open] > .user-dropdown {
450 animation: ud-fade-in .14s cubic-bezier(.2, .8, .25, 1);
451}
452@keyframes ud-fade-in {
453 from { opacity: 0; transform: translateY(-6px) scale(.98); }
454 to { opacity: 1; transform: translateY(0) scale(1); }
455}
456
457/* Identity header — small avatar + username/role badge */
458.user-dropdown-header {
459 display: flex; align-items: center; gap: .65rem;
460 padding: .55rem .65rem .65rem;
461 border-bottom: 1px solid color-mix(in srgb, var(--rule) 65%, transparent);
462 margin-bottom: .35rem;
463}
464.udh-avatar {
465 width: 36px; height: 36px; border-radius: 50%;
466 object-fit: cover;
467 background: var(--paper-2);
468 display: inline-flex; align-items: center; justify-content: center;
469 flex-shrink: 0;
470}
471.udh-avatar-fallback {
472 color: var(--accent); font-weight: 700; font-size: .95rem;
473}
474.udh-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
475.udh-name {
476 font-weight: 600; font-size: .92rem; color: var(--ink);
477 white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px;
478}
479.udh-role {
480 font-size: .68rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
481 color: var(--accent); opacity: .85; margin-top: .12rem;
482}
483
484/* Item list group */
485.user-dropdown-list { display: flex; flex-direction: column; gap: 1px; }
486.user-dropdown-divider {
487 height: 1px;
488 margin: .35rem .25rem;
489 background: color-mix(in srgb, var(--rule) 60%, transparent);
490}
491
492/* Items — icon + label, rounded inner highlight on hover (macOS feel) */
493.user-dropdown .udi {
494 display: flex; align-items: center; gap: .65rem;
495 padding: .5rem .65rem;
496 color: var(--ink); text-decoration: none;
497 font-size: .88rem; font-weight: 500;
498 border-radius: 7px;
499 transition: background var(--transition), color var(--transition), transform var(--transition);
500}
501.user-dropdown .udi:hover,
502.user-dropdown .udi:focus-visible {
503 background: color-mix(in srgb, var(--accent) 10%, var(--paper-2));
504 color: var(--accent);
505 outline: none;
506}
507.user-dropdown .udi:active { transform: scale(.98); }
508.user-dropdown .udi-icon {
509 width: 16px; height: 16px;
510 opacity: .7;
511 flex-shrink: 0;
512 transition: opacity var(--transition);
513}
514.user-dropdown .udi:hover .udi-icon,
515.user-dropdown .udi:focus-visible .udi-icon { opacity: 1; }
516
517/* Logout: subtle danger tint on hover, never on rest. Uses a fixed red so
518 it always reads as a destructive action even if the user's accent is red. */
519.user-dropdown .udi-danger:hover,
520.user-dropdown .udi-danger:focus-visible {
521 background: color-mix(in srgb, #dc2626 14%, var(--paper-2));
522 color: #dc2626;
523}
524
525/* ── Search overlay ── */
526.search-overlay {
527 position: fixed; top: 0; left: 0; right: 0;
528 background: color-mix(in srgb, var(--paper) 96%, transparent);
529 backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
530 border-bottom: 1px solid var(--rule);
531 padding: 1rem 0; z-index: 200;
532 padding-top: calc(1rem + env(safe-area-inset-top, 0));
533 box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 8%, transparent);
534}
535.search-overlay-form { display: flex; gap: .5rem; align-items: center; }
536.search-overlay-form input {
537 flex: 1; padding: .85rem 1rem;
538 min-height: 44px;
539 border: 1px solid var(--rule); border-radius: 8px;
540 font-family: var(--font-ui); font-size: 1rem;
541 background: var(--paper); color: var(--ink);
542}
543.search-overlay-form input:focus {
544 outline: 2px solid var(--accent); outline-offset: 0;
545}
546.search-overlay-form .nav-btn {
547 width: 44px; height: 44px;
548 display: inline-flex; align-items: center; justify-content: center;
549}
550/* Live-resultaten dropdown */
551.search-suggest { margin-top: .6rem; max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: .25rem; }
552.search-suggest:empty { display: none; }
553.ss-group { padding: .25rem 0; }
554.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; }
555.ss-item { display: block; padding: .55rem .6rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .95rem; }
556.ss-item:hover { background: var(--paper-2); color: var(--accent); }
557.ss-item.ss-noclick { opacity: .7; cursor: default; }
558.ss-sub { color: var(--ink-soft, var(--ink-muted)); font-size: .85em; }
559.ss-empty { padding: .8rem .6rem; color: var(--ink-soft, var(--ink-muted)); font-size: .9rem; }
560.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; }
561.ss-all:hover { text-decoration: underline; }
562/* Notification bell + unread badge */
563.nav-notif { position: relative; }
564.notif-badge {
565 position: absolute; top: 1px; right: 1px;
566 min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
567 display: inline-flex; align-items: center; justify-content: center;
568 background: #e0245e; color: #fff; font-size: 10px; font-weight: 700;
569 border-radius: 999px; line-height: 1; pointer-events: none;
570}
571</style>
Note: See TracBrowser for help on using the repository browser.