src/components/nav/NavGlass.astro
---
/**
* NavGlass
* Glassmorphism navigatie — blurred achtergrond, subtiele border.
*/
interface Props {
logo: string;
links: { label: string; href: string; active?: boolean }[];
cta?: { label: string; href: string };
dark?: boolean;
}
const { logo, links, cta, dark = false } = Astro.props;
---
<header class={`ng${dark ? ' ng--dark' : ''}`}>
<nav class="ng-inner">
<a href="/" class="ng-logo">{logo}</a>
<ul class="ng-links">
{links.map(l => (
<li><a href={l.href} class={`ng-link${l.active ? ' ng-link--active' : ''}`}>{l.label}</a></li>
))}
</ul>
{cta && <a href={cta.href} class="ng-cta">{cta.label}</a>}
</nav>
</header>
<style>
.ng { position: sticky; top: 0; z-index: 100; backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); }
.ng { background: rgba(255,255,255,0.7); border-bottom: 1px solid rgba(255,255,255,0.5); }
.ng--dark { background: rgba(10,10,20,0.65); border-bottom-color: rgba(255,255,255,0.08); }
.ng-inner { max-width: 1280px; margin: 0 auto; padding: 0 2rem; display: flex; align-items: center; height: 64px; gap: 2rem; }
.ng-logo { font-weight: 800; font-size: 1.0625rem; letter-spacing: -0.02em; text-decoration: none; }
.ng .ng-logo { color: #0a0a0a; }
.ng--dark .ng-logo { color: #fff; }
.ng-links { list-style: none; padding: 0; margin: 0; display: flex; flex: 1; gap: 0; }
.ng-link { display: block; font-size: 0.875rem; font-weight: 500; text-decoration: none; padding: 0.375rem 0.875rem; border-radius: 0.375rem; transition: all 0.15s; }
.ng .ng-link { color: #374151; }
.ng--dark .ng-link { color: rgba(255,255,255,0.7); }
.ng-link:hover, .ng-link--active { color: var(--color-accent,#6366f1) !important; background: rgba(99,102,241,0.1); }
.ng-cta { margin-left: auto; font-size: 0.875rem; font-weight: 600; padding: 0.5rem 1.25rem; background: var(--color-accent,#6366f1); color: #fff; border-radius: 0.5rem; text-decoration: none; transition: opacity 0.2s; white-space: nowrap; }
.ng-cta:hover { opacity: 0.88; }
@media (max-width: 768px) { .ng-links { display: none; } }
</style>
Props
| Prop | Type | Default | Beschrijving |
|---|---|---|---|
logo * | string | — | Merknaam |
links * | { label: string; href: string; active?: boolean }[] | — | Navigatielinks |
cta | { label: string; href: string } | — | CTA knop |
dark | boolean | false | Donkere glassmorphism variant |
* = verplicht