aboutsummaryrefslogtreecommitdiff
path: root/src/app/Header.tsx
blob: 5efe62875f6477d9792c8af1e136bdbdfaa6286f (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
"use client";

import { HoverBorderGradient } from "@/components/ui/hover-border-gradient";
import { Dialog, DialogPanel } from "@headlessui/react";
import {
  ArrowUpCircleIcon,
  Bars3Icon,
  XMarkIcon,
} from "@heroicons/react/24/outline";
import { motion } from "motion/react";
import Link from "next/link";
import { useState } from "react";

export default function Header() {
  const navigation = [
    { name: "About Us", href: "/about" },
    { name: "People", href: "/people" },
    { name: "Contact", href: "/contact" },
  ];

  const [mobileMenuOpen, setMobileMenuOpen] = useState(false);

  return (
    <div className="fixed inset-x-0 top-0 z-50">
      <nav aria-label="Global" className="p-6 lg:px-8">
        <div className="flex items-center justify-between max-w-7xl mx-auto rounded-full p-1.5 shadow-lg shadow-gray-700/10 bg-white/30 backdrop-blur-sm">
          <div className="flex">
            <motion.button
              whileHover={{ scale: 1.1 }}
              whileTap={{ scale: 0.9 }}
              type="button"
              onClick={() => setMobileMenuOpen(true)}
              className="inline-flex cursor-pointer items-center justify-center rounded-full p-2 ring-1 ring-inset ring-gray-900/10 hover:ring-gray-900/20 shadow-lg bg-white/50"
            >
              <span className="sr-only">Open main menu</span>
              <Bars3Icon aria-hidden="true" className="size-6" />
            </motion.button>
          </div>
          <div className="lg:flex lg:flex-1 lg:justify-end">
            <motion.div
              whileHover={{ scale: 1.15, y: -2, rotate: 1 }}
              whileTap={{ scale: 0.9 }}
              initial={{ opacity: 0, y: -20 }}
              animate={{ opacity: 1, y: 0 }}
              transition={{
                type: "spring",
                stiffness: 400,
                damping: 17,
                duration: 0.2,
              }}
            >
              <Link href="/get-started">
                <HoverBorderGradient
                  containerClassName="rounded-full"
                  as="button"
                  className=" bg-white text-black flex items-center space-x-2 cursor-pointer"
                >
                  <span className="text-indigo-600 font-semibold">
                    Get Started
                  </span>
                  <ArrowUpCircleIcon className="size-6 my-auto rotate-45 button-gradient rounded-full inline" />
                </HoverBorderGradient>
              </Link>
            </motion.div>
          </div>
        </div>
      </nav>
      <Dialog open={mobileMenuOpen} onClose={setMobileMenuOpen}>
        <div className="fixed inset-0 z-50" />
        <DialogPanel className="fixed inset-y-0 left-0 z-50 w-full overflow-y-auto bg-gray-900 p-6 sm:max-w-sm sm:ring-1 sm:ring-gray-100/10">
          <div className="flex items-center justify-between">
            <button
              type="button"
              onClick={() => setMobileMenuOpen(false)}
              className="-m-2.5 rounded-md p-2.5 text-gray-200"
            >
              <span className="sr-only">Close menu</span>
              <XMarkIcon aria-hidden="true" className="size-6" />
            </button>
            <a href="#" className="-m-1.5 p-1.5">
              <span className="sr-only">Your Company</span>
              <img
                alt=""
                src="https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=500"
                className="h-8 w-auto"
              />
            </a>
          </div>
          <div className="mt-6 flow-root">
            <div className="-my-6 divide-y divide-white/10">
              <div className="space-y-2 py-6">
                {navigation.map((item) => (
                  <a
                    key={item.name}
                    href={item.href}
                    className="-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-white hover:bg-white/5"
                  >
                    {item.name}
                  </a>
                ))}
              </div>
              <div className="py-6">
                <Link
                  href="/get-started"
                  className="-mx-3 block rounded-lg px-3 py-2.5 text-base/7 font-semibold text-white hover:bg-white/5"
                >
                  Get Started <span aria-hidden="true">&rarr;</span>
                </Link>
              </div>
            </div>
          </div>
        </DialogPanel>
      </Dialog>
    </div>
  );
}