File tree 5 files changed +99
-2
lines changed
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 1
1
import Image from 'next/image' ;
2
2
import Link from 'next/link' ;
3
3
import { useEffect , useState } from 'react' ;
4
+ import Hamburger from './Hamburger' ;
4
5
5
6
const Navbar = ( ) => {
6
7
const [ path , setPath ] = useState < string > ( '' ) ;
@@ -28,7 +29,7 @@ const Navbar = () => {
28
29
< p className = "text-[0.6rem] text-[#C4C5C8]" > 01</ p >
29
30
< div > { '//' } about us</ div >
30
31
</ Link >
31
- < Link href = "events" >
32
+ < Link href = "# events" >
32
33
< p className = "text-[0.6rem] text-[#C4C5C8]" > 02</ p >
33
34
< div > { '//' } events</ div >
34
35
</ Link >
@@ -41,6 +42,9 @@ const Navbar = () => {
41
42
< div > { '//' } sponsors</ div >
42
43
</ Link >
43
44
</ div >
45
+ < div className = "md:hidden xl:hidden lg:hidden text-right font-bold block" >
46
+ < Hamburger />
47
+ </ div >
44
48
</ div >
45
49
</ nav >
46
50
) ;
Original file line number Diff line number Diff line change @@ -9,7 +9,10 @@ const Sponsors = () => {
9
9
'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' ;
10
10
11
11
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
+ >
13
16
< div className = "text-center" >
14
17
< p className = "text-[#3977F8] font-game text-xl" > 04</ p >
15
18
< h2 className = "font-bold text-6xl" > SUPPORT CSESOC</ h2 >
Original file line number Diff line number Diff line change 19
19
"@types/react-dom" : " 18.2.7" ,
20
20
"autoprefixer" : " 10.4.15" ,
21
21
"eslint-config-next" : " 13.4.19" ,
22
+ "framer-motion" : " ^11.1.2" ,
22
23
"next" : " 13.4.19" ,
23
24
"postcss" : " 8.4.29" ,
24
25
"react" : " 18.2.0" ,
You can’t perform that action at this time.
0 commit comments