-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHamburger.tsx
62 lines (60 loc) · 1.82 KB
/
Hamburger.tsx
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
import React from 'react';
import { AnimatePresence, motion, useCycle } from 'framer-motion';
import Link from 'next/link';
export default function Hamburger() {
const [isOpen, toggleOpen] = useCycle(false, true);
return (
<button
onClick={() => {
toggleOpen();
}}
>
<svg
className="w-10 h-10"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M4 6h16M4 12h16m-7 6h7"
/>
</svg>
<AnimatePresence>
{isOpen && (
<motion.div
initial={{ opacity: 0, y: -10 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -10 }}
transition={{ duration: 0.2 }}
className="absolute top-16 right-0 bg-[#3977F9] p-4 shadow-lg w-40 rounded-2xl"
>
<ul>
<li className="py-2 text-lg">
<Link href={'./about'}>About Us</Link>
</li>
<li className="py-2 text-lg">
<Link href={'./events'}>Events</Link>
</li>
<li className="py-2 text-lg">
<Link href={'./resources'}>Resources</Link>
</li>
<li className="py-2 text-lg">
<Link href={'./sponsors'}>Sponsors</Link>
</li>
<li className="py-2 text-lg">
<Link href={'./contact-us'}>Contact Us</Link>
</li>
<li className="py-2 text-lg">
<a target="_blank" href="https://csesoc-merch.square.site/">Merch Store</a>
</li>
</ul>
</motion.div>
)}
</AnimatePresence>
</button>
);
}