File tree Expand file tree Collapse file tree 5 files changed +99
-2
lines changed
Expand file tree Collapse file tree 5 files changed +99
-2
lines changed Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import { AnimatePresence , motion , useCycle } from 'framer-motion' ;
3+ import Link from 'next/link' ;
4+
5+ export default function Hamburger ( ) {
6+ const [ isOpen , toggleOpen ] = useCycle ( false , true ) ;
7+
8+ return (
9+ < button
10+ onClick = { ( ) => {
11+ toggleOpen ( ) ;
12+ } }
13+ >
14+ < svg
15+ className = "w-10 h-10"
16+ fill = "none"
17+ stroke = "currentColor"
18+ viewBox = "0 0 24 24"
19+ xmlns = "http://www.w3.org/2000/svg"
20+ >
21+ < path
22+ strokeLinecap = "round"
23+ strokeLinejoin = "round"
24+ strokeWidth = { 2 }
25+ d = "M4 6h16M4 12h16m-7 6h7"
26+ />
27+ </ svg >
28+ < AnimatePresence >
29+ { isOpen && (
30+ < motion . div
31+ initial = { { opacity : 0 , y : - 10 } }
32+ animate = { { opacity : 1 , y : 0 } }
33+ exit = { { opacity : 0 , y : - 10 } }
34+ transition = { { duration : 0.2 } }
35+ className = "absolute top-16 right-0 bg-[#3977F9] p-4 shadow-lg w-40 rounded-2xl"
36+ >
37+ < ul >
38+ < li className = "py-2 text-lg" >
39+ < Link href = { './about' } > About Us</ Link >
40+ </ li >
41+ < li className = "py-2 text-lg" >
42+ < Link href = { './events' } > Events</ Link >
43+ </ li >
44+ < li className = "py-2 text-lg" >
45+ < Link href = { './resources' } > Resources</ Link >
46+ </ li >
47+ < li className = "py-2 text-lg" >
48+ < Link href = { './sponsors' } > Sponsors</ Link >
49+ </ li >
50+ </ ul >
51+ </ motion . div >
52+ ) }
53+ </ AnimatePresence >
54+ </ button >
55+ ) ;
56+ }
Original file line number Diff line number Diff line change 11import Image from 'next/image' ;
22import Link from 'next/link' ;
33import { useEffect , useState } from 'react' ;
4+ import Hamburger from './Hamburger' ;
45
56const Navbar = ( ) => {
67 const [ path , setPath ] = useState < string > ( '' ) ;
@@ -28,7 +29,7 @@ const Navbar = () => {
2829 < p className = "text-[0.6rem] text-[#C4C5C8]" > 01</ p >
2930 < div > { '//' } about us</ div >
3031 </ Link >
31- < Link href = "events" >
32+ < Link href = "# events" >
3233 < p className = "text-[0.6rem] text-[#C4C5C8]" > 02</ p >
3334 < div > { '//' } events</ div >
3435 </ Link >
@@ -41,6 +42,9 @@ const Navbar = () => {
4142 < div > { '//' } sponsors</ div >
4243 </ Link >
4344 </ div >
45+ < div className = "md:hidden xl:hidden lg:hidden text-right font-bold block" >
46+ < Hamburger />
47+ </ div >
4448 </ div >
4549 </ nav >
4650 ) ;
Original file line number Diff line number Diff line change @@ -9,7 +9,10 @@ const Sponsors = () => {
99 'xl:p-16 p-10 flex justify-center items-center xl:col-span-3 sm:col-span-5 col-span-10 xl:row-start-2 xl:row-end-3 sm:row-start-4 sm:row-end-5 sm:h-auto h-36' ;
1010
1111 return (
12- < section className = "flex flex-col min-h-screen py-8 xl:px-24 sm:px-10 px-8 relative mt-20" >
12+ < section
13+ className = "flex flex-col min-h-screen py-8 xl:px-24 sm:px-10 px-8 relative mt-20"
14+ id = "sponsors"
15+ >
1316 < div className = "text-center" >
1417 < p className = "text-[#3977F8] font-game text-xl" > 04</ p >
1518 < h2 className = "font-bold text-6xl" > SUPPORT CSESOC</ h2 >
Original file line number Diff line number Diff line change 1919 "@types/react-dom" : " 18.2.7" ,
2020 "autoprefixer" : " 10.4.15" ,
2121 "eslint-config-next" : " 13.4.19" ,
22+ "framer-motion" : " ^11.1.2" ,
2223 "next" : " 13.4.19" ,
2324 "postcss" : " 8.4.29" ,
2425 "react" : " 18.2.0" ,
You can’t perform that action at this time.
0 commit comments