File tree Expand file tree Collapse file tree 6 files changed +126
-2
lines changed Expand file tree Collapse file tree 6 files changed +126
-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
+
7
+ const [ isOpen , toggleOpen ] = useCycle ( false , true ) ;
8
+
9
+ return (
10
+ < button onClick = { ( ) => { toggleOpen ( ) } } className = "focus:outline-none" >
11
+ < svg
12
+ className = "w-6 h-6"
13
+ fill = "none"
14
+ stroke = "currentColor"
15
+ viewBox = "0 0 24 24"
16
+ xmlns = "http://www.w3.org/2000/svg"
17
+ >
18
+ < path
19
+ strokeLinecap = "round"
20
+ strokeLinejoin = "round"
21
+ strokeWidth = { 2 }
22
+ d = "M4 6h16M4 12h16m-7 6h7"
23
+ />
24
+ </ svg >
25
+ < AnimatePresence >
26
+ { isOpen && (
27
+ < motion . div
28
+ initial = { { opacity : 0 , y : - 10 } }
29
+ animate = { { opacity : 1 , y : 0 } }
30
+ exit = { { opacity : 0 , y : - 10 } }
31
+ transition = { { duration : 0.2 } }
32
+ className = "absolute top-16 right-0 bg-[#3977F9] p-4 shadow-lg w-40 rounded-2xl"
33
+ style = { { height : "85vh" } }
34
+ >
35
+ < ul >
36
+ < li className = "py-2" > < Link href = { "#about" } > About Us</ Link > </ li >
37
+ < li className = "py-2" > < Link href = { "#events" } > Events</ Link > </ li >
38
+ < li className = "py-2" > < Link href = { "/resources" } > Resources</ Link > </ li >
39
+ < li className = "py-2" > < Link href = { "#sponsors" } > Sponsors</ Link > </ li >
40
+ </ ul >
41
+ </ motion . div >
42
+ ) }
43
+ </ AnimatePresence >
44
+ </ button >
45
+ ) ;
46
+ }
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 @@ -8,7 +8,7 @@ const Sponsors = () => {
8
8
'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' ;
9
9
10
10
return (
11
- < section className = "flex flex-col min-h-screen py-8 xl:px-24 sm:px-10 px-8 relative mt-20" >
11
+ < section className = "flex flex-col min-h-screen py-8 xl:px-24 sm:px-10 px-8 relative mt-20" id = "sponsors" >
12
12
< div className = "text-center" >
13
13
< p className = "text-[#3977F8] font-game text-xl" > 04</ p >
14
14
< h2 className = "font-bold text-6xl" > SUPPORT CSESOC</ h2 >
Original file line number Diff line number Diff line change
1
+ body {
2
+ background-color : # 1a0554 ;
3
+ font-family : "Roboto" , sans-serif;
4
+ }
5
+
6
+ main {
7
+ display : flex;
8
+ }
9
+
10
+ aside {
11
+ background-color : # c4a8ff ;
12
+ width : 18.75rem ;
13
+ height : 100vh ;
14
+ }
15
+
16
+ .container {
17
+ margin : 4.5rem 1.4rem ;
18
+ }
19
+
20
+ .btn-container {
21
+ position : fixed;
22
+ }
23
+
24
+ .container a {
25
+ color : # f9fafb ;
26
+ text-decoration : none;
27
+ font-size : 1.75rem ;
28
+ font-weight : 600 ;
29
+ display : block;
30
+ margin : 20px ;
31
+ }
32
+
33
+ button {
34
+ cursor : pointer;
35
+ margin : 1.25rem ;
36
+ border : none;
37
+ padding : 0.5rem 1rem ;
38
+ background-color : # f9fafb ;
39
+ }
40
+
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