-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHamburger.tsx
More file actions
109 lines (97 loc) · 4.07 KB
/
Copy pathHamburger.tsx
File metadata and controls
109 lines (97 loc) · 4.07 KB
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
import React, { useState, useEffect } from 'react';
import Link from 'next/link';
import { motion } from 'framer-motion';
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
export default function Hamburger() {
const [isOpenDropdown, setIsOpenDropdown] = useState(false);
useEffect(() => {
const handleResize = () => {
setIsOpenDropdown(false);
};
window.addEventListener('resize', handleResize);
return () => window.removeEventListener('resize', handleResize);
}, []);
return (
<DropdownMenu modal={false} open={isOpenDropdown} onOpenChange={setIsOpenDropdown}>
<DropdownMenuTrigger asChild>
<button className="p-2 rounded-lg">
<div className="w-10 h-10 flex flex-col justify-center items-center">
<motion.div
className="h-0.5 w-6 bg-white"
animate={{
rotate: isOpenDropdown ? 45 : 0,
y: isOpenDropdown ? 2 : -4,
}}
transition={{ duration: 0.3, ease: "easeInOut" }}
/>
<motion.div
className="h-0.5 w-6 bg-white"
animate={{
opacity: isOpenDropdown ? 0 : 1,
x: isOpenDropdown ? -10 : 0,
}}
transition={{ duration: 0.2, ease: "easeInOut" }}
/>
<motion.div
className="h-0.5 w-6 bg-white"
animate={{
rotate: isOpenDropdown ? -45 : 0,
y: isOpenDropdown ? -2 : 4,
}}
transition={{ duration: 0.3, ease: "easeInOut" }}
/>
</div>
</button>
</DropdownMenuTrigger>
<DropdownMenuContent
align="end"
className="w-44 bg-[#3977F9] border-none shadow-lg rounded-2xl text-white dropdown-content overflow-hidden"
>
{/* <DropdownMenuItem asChild className="text-white text-lg py-2 px-4 rounded-2xl focus:bg-white/10 hover:bg-white/10 cursor-pointer dropdown-item">
<Link href="https://docs.google.com/forms/d/1EkNgm9HQc1b3C8Pvk7AqHvXF6N65txmOxmKjdMpfwBs" className="w-full block">
Apply to Subcommittee
</Link>
</DropdownMenuItem> */}
<DropdownMenuItem asChild className="text-white text-lg py-2 px-4 rounded-2xl focus:bg-white/10 hover:bg-white/10 cursor-pointer dropdown-item">
<Link href="/about" className="w-full block">
About Us
</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild className="text-white text-lg py-2 px-4 rounded-2xl focus:bg-white/10 hover:bg-white/10 cursor-pointer dropdown-item">
<Link href="/events" className="w-full block">
Events
</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild className="text-white text-lg py-2 px-4 rounded-2xl focus:bg-white/10 hover:bg-white/10 cursor-pointer dropdown-item">
<Link href="/resources" className="w-full block">
Resources
</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild className="text-white text-lg py-2 px-4 rounded-2xl focus:bg-white/10 hover:bg-white/10 cursor-pointer dropdown-item">
<Link href="/sponsors" className="w-full block">
Sponsors
</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild className="text-white text-lg py-2 px-4 rounded-2xl focus:bg-white/10 hover:bg-white/10 cursor-pointer dropdown-item">
<Link href="/contact-us" className="w-full block">
Contact Us
</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild className="text-white text-lg py-2 px-4 rounded-2xl focus:bg-white/10 hover:bg-white/10 cursor-pointer dropdown-item">
<a
target="_blank"
href="https://csesoc-merch.square.site/"
className="w-full block"
>
Merch
</a>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
);
}