66 lines
2.5 KiB
Plaintext
66 lines
2.5 KiB
Plaintext
---
|
|
import { t } from '../../i18n/translations';
|
|
import { localizedPath, type Locale } from '../../i18n/types';
|
|
import { HeaderControls } from './HeaderControls';
|
|
|
|
interface Props {
|
|
locale: Locale;
|
|
activeSection?: 'features' | 'docs' | 'plugins' | 'compatibility' | 'changelog';
|
|
}
|
|
|
|
const { locale, activeSection = 'features' } = Astro.props;
|
|
const strings = t(locale);
|
|
const pathname = Astro.url.pathname;
|
|
|
|
const navLinks = [
|
|
{ key: 'features', label: strings.nav.features, href: localizedPath(locale, '/') },
|
|
{ key: 'docs', label: strings.nav.docs, href: localizedPath(locale, '/docs/quick-start') },
|
|
{ key: 'plugins', label: strings.nav.plugins, href: localizedPath(locale, '/plugins') },
|
|
{ key: 'compatibility', label: strings.nav.compatibility, href: localizedPath(locale, '/compatibility') },
|
|
{ key: 'changelog', label: strings.nav.changelog, href: localizedPath(locale, '/changelog') },
|
|
] as const;
|
|
---
|
|
|
|
<header
|
|
transition:name="site-header"
|
|
transition:animate="none"
|
|
class="fixed inset-x-0 top-0 z-50 border-b border-border bg-[var(--c-nav-glass)] backdrop-blur-xl backdrop-saturate-150"
|
|
>
|
|
<nav
|
|
aria-label="Main"
|
|
class="mx-auto flex h-14 w-full max-w-6xl items-center justify-between gap-2 px-4 sm:px-8 lg:grid lg:grid-cols-[1fr_auto_1fr]"
|
|
>
|
|
<a
|
|
href={localizedPath(locale, '/')}
|
|
class="inline-flex shrink-0 items-center gap-2 whitespace-nowrap transition-opacity duration-150 hover:opacity-80 sm:gap-2.5 lg:col-start-1 lg:justify-self-start"
|
|
>
|
|
<img src="/logo.svg" alt="Reims-Go" class="size-7 shrink-0" width="28" height="28" />
|
|
<span class="text-[15px] font-semibold tracking-[-0.015em] text-ink">Reims-Go</span>
|
|
</a>
|
|
|
|
<ul class="hidden items-center gap-1 lg:col-start-2 lg:flex">
|
|
{navLinks.map((item) => {
|
|
const isActive = activeSection === item.key;
|
|
return (
|
|
<li>
|
|
<a
|
|
href={item.href}
|
|
aria-current={isActive ? 'page' : undefined}
|
|
class:list={[
|
|
'inline-flex items-center whitespace-nowrap rounded-full px-3.5 py-1.5 text-sm transition-colors duration-150',
|
|
isActive
|
|
? 'bg-surface font-medium text-ink'
|
|
: 'text-slate hover:bg-surface hover:text-ink',
|
|
]}
|
|
>
|
|
{item.label}
|
|
</a>
|
|
</li>
|
|
);
|
|
})}
|
|
</ul>
|
|
|
|
<HeaderControls client:load locale={locale} pathname={pathname} activeSection={activeSection} />
|
|
</nav>
|
|
</header>
|