feat(palette): synlig søge-/⌘K-knap i header (mobil-adgang til paletten + alle sider/værktøjer)
Build & Deploy / deploy (push) Successful in 1m39s

This commit is contained in:
Asger Geel Weirsøe
2026-06-15 18:23:58 +02:00
parent a4531482d1
commit d51ecf61da
2 changed files with 8 additions and 0 deletions
+6
View File
@@ -20,6 +20,12 @@ const isActive = (href: string) => (href === '/' ? path === '/' : path.startsWit
</li>
))}
</ul>
<button type="button" data-palette-open class="theme-toggle" title="Søg (⌘K / Ctrl K)" aria-label="Åbn søgning og kommandopalette">
<svg width="20" height="20" 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>
</button>
<button type="button" data-theme-toggle class="theme-toggle ml-1" title="Skift mellem lyst og mørkt tema" aria-label="Skift tema">
<svg class="sun-and-moon" aria-hidden="true" width="22" height="22" viewBox="0 0 24 24">
<mask class="moon" id="moon-mask">
+2
View File
@@ -128,6 +128,8 @@
});
document.addEventListener('input', (e) => { if (e.target?.id === 'palette-input') refresh(); });
document.addEventListener('click', (e) => {
const trigger = e.target.closest?.('[data-palette-open]');
if (trigger) { e.preventDefault(); el('palette')?.hidden ? open() : close(); return; }
if (e.target === el('palette')) close();
const li = e.target.closest?.('.palette-item[data-i]');
if (li) choose(+li.dataset.i);