source: Klonkt/src/views/partials/topnav.ejs@ 999aad2

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

feat(i18n): styled language dropdown in the header (instead of native select)

Custom dropdown (details/summary, like the user menu): toggle = globe + code +
chevron; menu = full names with code, accent on the active language, clean
shadow/border. Closes on outside click (handler extended). style.css?v=28.

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

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