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
|
"use client";
import { Dialog, DialogPanel } from "@headlessui/react";
import {
ArrowLeftCircleIcon,
Bars3Icon,
XMarkIcon,
} from "@heroicons/react/24/outline";
import { motion } from "motion/react";
import Image from "next/image";
import Link from "next/link";
import { useState } from "react";
export default function Header() {
const navigation = [
{ name: "About", href: "/about" },
{ name: "Blog", href: "/blog" },
];
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="lg:flex lg:flex-1">
<motion.div
whileHover={{ scale: 1.15, y: -2, rotate: 1 }}
whileTap={{ scale: 0.9 }}
transition={{
type: "spring",
stiffness: 400,
damping: 17,
duration: 0.2,
}}
>
<Link href="/">
<button className=" text-black flex items-center space-x-2 cursor-pointer">
<ArrowLeftCircleIcon className="size-9 my-auto button-gradient rounded-full inline" />
</button>
</Link>
</motion.div>
</div>
<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>
</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>
<Link href="/" className="-m-1.5 p-1.5">
<span className="sr-only">Your Company</span>
<Image
alt="Sensible Scholars Logo"
src="/favicon.png"
width={36}
height={36}
className="rounded-md"
/>
</Link>
</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">→</span>
</Link>
</div>
</div>
</div>
</DialogPanel>
</Dialog>
</div>
);
}
|