Skip to content

📧✨ Beautiful email. For everyone.

2.2 KB
Raw Blame
---
import { Mark } from './Mark'
import { Wordmark } from '@inlark/ui/components/wordmark'
import { GitHubIcon } from './GitHubIcon'
import { links } from '../data/links'

interface Props {
  /** Hides the download button on the page it leads to. */
  page?: 'home' | 'download' | 'imprint'
}

const { page = 'home' } = Astro.props
const items = [
  { href: '/#keyboard', label: 'Keyboard' },
  { href: '/#features', label: 'Features' },
  { href: '/#privacy', label: 'Privacy' },
]
---

<header class="nav fixed inset-x-0 top-0 z-50">
  <div class="mx-auto flex h-16 max-w-6xl items-center gap-8 px-5 sm:px-8">
    <a
      href={page === 'home' ? '#top' : '/'}
      class="flex items-center gap-1.5"
      aria-label="inlark home"
    >
      <Mark size={24} />
      <Wordmark height={18} decorative />
    </a>
    <nav class="hidden items-center gap-7 text-sm text-ink-2 md:flex" aria-label="Sections">
      {items.map((item) => (
        <a href={item.href} class="transition-colors hover:text-ink">
          {item.label}
        </a>
      ))}
    </nav>
    <div class="ml-auto flex items-center gap-2">
      <a
        href={links.repo}
        class="hidden h-9 items-center gap-2 rounded-lg px-3 text-sm text-ink-2 transition-colors hover:bg-ink/5 hover:text-ink sm:flex"
      >
        <GitHubIcon className="size-4" /> Source
      </a>
      {page !== 'download' && (
        <a href={links.download} class="btn btn-primary h-9 rounded-lg px-3.5 text-sm">
          Download
        </a>
      )}
    </div>
  </div>
</header>

<style>
  .nav {
    background: color-mix(in srgb, var(--color-night) 55%, transparent);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
  }
  /* The scrolled look fades in as a layer: a scroll-driven colour animation ignores light mode. */
  .nav::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-bottom: 1px solid var(--color-line);
    background: color-mix(in srgb, var(--color-night) 55%, transparent);
    opacity: 0;
    animation: nav-line linear both;
    animation-timeline: scroll();
    animation-range: 0 120px;
  }
  @keyframes nav-line {
    to {
      opacity: 1;
    }
  }
</style>