summary refs log tree commit diff
path: root/components/layout/Header.tsx
blob: 6fa16ff679a3436f695175a6cc25ee8894d3b324 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
'use client'

import React from 'react'
import Image from 'next/image'

import { usePathname } from 'next/navigation'

import header from '~/images/aurora-1197753.jpg'

export default function Title() {
  const pathname = usePathname()

  const isHomepage = pathname === '/'

  return (
    <header className={isHomepage ? 'homepage' : undefined}>
      {isHomepage
        ? <h1 className="siteTitle">tempest.dev</h1>
        : <a href="/" className="siteTitle">tempest.dev</a>
      }
      <nav>
        <a href="/about">about</a>
        {/* <a href="/posts">posts</a> */}
        <a href="/contact">contact</a>
        <a href="/webring">webring</a>
      </nav>
      <div className="headerBackground">
        <Image
          src={header}
          alt=""
          role="presentation"
          fill={true}
          sizes={`
            (max-width: 2560) 100vw,
            (max-width: 1920) 100vw,
            (max-width: 1280) 100vw,
            (max-width: 800) 100vw,
            (max-width: 600) 100vw,
          `}
        />
      </div>
    </header>
  )
}