src/components/layout/Header.astro 1.6 K raw
1
---
2
import { MENU_LINKS } from "@/data/constants";
3
4
const url = new URL(Astro.request.url);
5
---
6
7
<header
8
  id="main-header"
9
  class="relative mb-14"
10
>
11
  <div>
12
    <a
13
      href="/"
14
      class="inline-flex items-center mb-4"
15
      aria-current={url.pathname === "/" ? "page" : false}
16
      data-astro-reload
17
    >
18
      <svg
19
        xmlns="http://www.w3.org/2000/svg"
20
        class="mr-3 h-10 w-6 sm:w-10"
21
        fill="none"
22
        stroke="currentColor"
23
        stroke-linecap="round"
24
        stroke-linejoin="round"
25
        viewBox="0 0 256 256"
26
        >
27
        <path
28
          fill="currentColor"
29
          d="M164 78a26 26 0 1 0-26-26a26 26 0 0 0 26 26m0-40a14 14 0 1 1-14 14a14 14 0 0 1 14-14m89.16 158.94l-54.56-92.08a13.9 13.9 0 0 0-12-6.86a13.88 13.88 0 0 0-12 6.86l-27.88 47.05l-46.56-79a14 14 0 0 0-24.13 0L2.83 197A6 6 0 0 0 8 206h240a6 6 0 0 0 5.16-9.06M86.27 79a2 2 0 0 1 3.46 0l25.34 43H60.93ZM18.5 194l35.36-60h68.29l19.3 32.77l16 27.2Zm152.93 0l-17.85-30.29L184.83 111a2 2 0 0 1 1.72-1a1.93 1.93 0 0 1 1.72 1l49.2 83Z"
30
        ></path></svg
31
      >
32
      <span class="text-xl sm:text-3xl font-bold">Steve Simkins</span>
33
    </a>
34
    <nav
35
      id="navigation-menu"
36
      class="grid grid-cols-4 gap-y-2 text-accent"
37
      aria-label="Main menu"
38
    >
39
      {
40
        MENU_LINKS.map((link) => (
41
          <a
42
            href={link.path}
43
            class="hover:underline"
44
            aria-current={url.pathname === link.path ? "page" : false}
45
            rel="prefetch"
46
          >
47
            {link.title}
48
          </a>
49
        ))
50
      }
51
    </nav>
52
  </div>
53
</header>