|
1 | | -"use client" |
| 1 | +"use client"; |
2 | 2 | import Link from "next/link"; |
3 | | -import { Abel } from 'next/font/google'; |
| 3 | +import { Abel } from "next/font/google"; |
4 | 4 | // import Image from "next/image"; |
5 | 5 | import { amstelvar, canela } from "@/lib/fonts"; |
6 | 6 | import { useState } from "react"; |
7 | 7 | import MenuLink from "../@ui/menu-link"; |
8 | 8 |
|
9 | | - const acme = Abel({ |
10 | | - subsets: ['latin'], |
11 | | - weight: ['400'] |
12 | | - }) |
13 | | - |
| 9 | +const acme = Abel({ |
| 10 | + subsets: ["latin"], |
| 11 | + weight: ["400"], |
| 12 | +}); |
14 | 13 |
|
15 | 14 | const Header = () => { |
| 15 | + const [isMenuClicked, setMenuClicked] = useState(false); |
16 | 16 |
|
17 | | - const [isMenuClicked, setMenuClicked] = useState(false) |
18 | | - |
19 | | - const toggleMenuButton = () => { |
20 | | - setMenuClicked(!isMenuClicked) |
21 | | - } |
22 | | - |
23 | | - return ( |
24 | | - <header id="site-header" className={`text-lg max-md:py-[1.5px] py-3 ${acme.className} flex flex-col justify-center text-xl items-center gap-[18px] `}> |
25 | | - {/* for large image */} |
26 | | - <div className=" w-full max-md:hidden flex items-center justify-between px-4"> |
27 | | - {/* icon */} |
28 | | - <div className="flex gap-2 items-center"> |
29 | | - <Link href="/" className="inline-block transition-transform duration-800 hover:text-tealBright text-grey hover:animate-shrinkAndExpand"> |
30 | | - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" className="w-12 h-12"> |
31 | | - <text x="10" y="70" fontSize="70" fill="currentColor" fontWeight={800} fontFamily={canela.className}>S</text> |
32 | | - </svg> |
33 | | - </Link> |
34 | | - </div> |
35 | | - {/* links */} |
36 | | - <div className={`${amstelvar.className} flex items-center gap-4`}> |
37 | | - <MenuLink |
38 | | - href="/" |
39 | | - value="Home" |
40 | | - /> |
41 | | - <MenuLink |
42 | | - href="/explora" |
43 | | - value="Explora" |
44 | | - postText="+" |
45 | | - /> |
46 | | - <MenuLink |
47 | | - href="/blogs" |
48 | | - value="Blogs" |
49 | | - /> |
50 | | - <MenuLink |
51 | | - href="/contact" |
52 | | - value="Contact" |
53 | | - /> |
54 | | - </div> |
55 | | - </div> |
56 | | - <div className="hidden max-md:flex justify-between relative w-[100%] px-4"> |
57 | | - {/* icon */} |
| 17 | + const toggleMenuButton = () => { |
| 18 | + setMenuClicked(!isMenuClicked); |
| 19 | + }; |
58 | 20 |
|
59 | | - <div className="flex gap-2 items-center"> |
60 | | - <Link href="/" className="inline-block transition-transform duration-800 hover:text-tealBright text-teal hover:animate-shrinkAndExpand"> |
61 | | - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" className="w-12 h-12"> |
62 | | - <text x="10" y="70" fontSize="70" fill="currentColor" fontWeight={800} fontFamily={canela.className}>S</text> |
63 | | - </svg> |
64 | | - </Link> |
65 | | - </div> |
| 21 | + return ( |
| 22 | + <header |
| 23 | + id="site-header" |
| 24 | + className={`text-lg max-md:py-[1.5px] py-3 ${acme.className} flex flex-col justify-center text-xl items-center gap-[18px] `} |
| 25 | + > |
| 26 | + {/* for large image */} |
| 27 | + <div className=" w-full max-md:hidden flex items-center justify-between px-4"> |
| 28 | + {/* icon */} |
| 29 | + <div className="flex gap-2 items-center"> |
| 30 | + <Link |
| 31 | + href="/" |
| 32 | + className="inline-block transition-transform duration-800 hover:text-tealBright text-grey hover:animate-shrinkAndExpand" |
| 33 | + > |
| 34 | + <svg |
| 35 | + xmlns="http://www.w3.org/2000/svg" |
| 36 | + viewBox="0 0 100 100" |
| 37 | + className="w-12 h-12" |
| 38 | + > |
| 39 | + <text |
| 40 | + x="10" |
| 41 | + y="70" |
| 42 | + fontSize="70" |
| 43 | + fill="currentColor" |
| 44 | + fontWeight={800} |
| 45 | + fontFamily={canela.className} |
| 46 | + > |
| 47 | + S |
| 48 | + </text> |
| 49 | + </svg> |
| 50 | + </Link> |
| 51 | + </div> |
| 52 | + {/* links */} |
| 53 | + <div className={`${amstelvar.className} flex items-center gap-4`}> |
| 54 | + <MenuLink href="/" value="Home" /> |
| 55 | + <MenuLink href="/explora" value="Explora" postText="+" /> |
| 56 | + <MenuLink href="/blogs" value="Blogs" /> |
| 57 | + </div> |
| 58 | + </div> |
| 59 | + <div className="hidden max-md:flex justify-between relative w-[100%] px-4"> |
| 60 | + {/* icon */} |
66 | 61 |
|
67 | | - {/* menu */} |
68 | | - <div onClick={toggleMenuButton} className="flex flex-col p-4 items-center justify-center cursor-pointer"> |
69 | | - <div className="flex gap-1 items-center justify-center"> |
70 | | - <div className="w-[5px] h-[5px] rounded-full bg-slate-500"></div> |
71 | | - <div className="w-[5px] h-[5px] rounded-full bg-slate-500"></div> |
72 | | - <div className="w-[5px] h-[5px] rounded-full bg-slate-500"></div> |
73 | | - </div> |
74 | | - <div className="text-sm select-none">menu</div> |
75 | | - </div> |
| 62 | + <div className="flex gap-2 items-center"> |
| 63 | + <Link |
| 64 | + href="/" |
| 65 | + className="inline-block transition-transform duration-800 hover:text-tealBright text-teal hover:animate-shrinkAndExpand" |
| 66 | + > |
| 67 | + <svg |
| 68 | + xmlns="http://www.w3.org/2000/svg" |
| 69 | + viewBox="0 0 100 100" |
| 70 | + className="w-12 h-12" |
| 71 | + > |
| 72 | + <text |
| 73 | + x="10" |
| 74 | + y="70" |
| 75 | + fontSize="70" |
| 76 | + fill="currentColor" |
| 77 | + fontWeight={800} |
| 78 | + fontFamily={canela.className} |
| 79 | + > |
| 80 | + S |
| 81 | + </text> |
| 82 | + </svg> |
| 83 | + </Link> |
| 84 | + </div> |
76 | 85 |
|
77 | | - </div> |
78 | | - {isMenuClicked && ( |
79 | | - <div className="fixed hidden max-md:flex inset-0 bg-white z-50 flex-col items-center overflow-y-hidden"> |
80 | | - <div className={`cursor-pointer top-3 py-2 w-full text-right px-4`} onClick={toggleMenuButton}>x <b>close</b></div> |
81 | | - <ul className="w-[100%] border-solid border-[0.1rem] border-t-0 border-b-0"> |
82 | | - <li className="border-t border-b-0 border-[0.1rem] py-1 flex leading-1"> |
83 | | - <Link className="px-3 w-full text-left text-grey py-2" href="/" onClick={toggleMenuButton}> |
84 | | - Home |
85 | | - </Link> |
86 | | - </li> |
87 | | - <li className="border-t border-b-0 border-[0.1rem] flex leading-1"> |
88 | | - <Link className="px-3 w-full text-left text-grey py-2" href="/explora" onClick={toggleMenuButton}> |
89 | | - Explorations |
90 | | - </Link> |
91 | | - </li> |
92 | | - <li className="border-t border-b-0 border-[0.1rem] flex leading-1"> |
93 | | - <Link className="px-3 w-full text-left text-grey py-2" href="/blogs" onClick={toggleMenuButton}> |
94 | | - Blogs |
95 | | - </Link> |
96 | | - </li> |
97 | | - <li className="border-t border-b-0 border-[0.1rem] flex leading-1"> |
98 | | - <Link className="px-3 w-full text-left text-grey py-2" href="/contact" onClick={toggleMenuButton}> |
99 | | - Contact |
100 | | - </Link> |
101 | | - </li> |
102 | | - <li className="border-t border-b border-[0.1rem] flex leading-1"> |
103 | | - <Link className="px-3 w-full text-left text-grey py-2" href="https://youtube.com/@howdevyou" target="_blank" onClick={toggleMenuButton}> |
104 | | - Youtube |
105 | | - </Link> |
106 | | - </li> |
107 | | -</ul> |
| 86 | + {/* menu */} |
| 87 | + <div |
| 88 | + onClick={toggleMenuButton} |
| 89 | + className="flex flex-col p-4 items-center justify-center cursor-pointer" |
| 90 | + > |
| 91 | + <div className="flex gap-1 items-center justify-center"> |
| 92 | + <div className="w-[5px] h-[5px] rounded-full bg-slate-500"></div> |
| 93 | + <div className="w-[5px] h-[5px] rounded-full bg-slate-500"></div> |
| 94 | + <div className="w-[5px] h-[5px] rounded-full bg-slate-500"></div> |
| 95 | + </div> |
| 96 | + <div className="text-sm select-none">menu</div> |
| 97 | + </div> |
| 98 | + </div> |
| 99 | + {isMenuClicked && ( |
| 100 | + <div className="fixed hidden max-md:flex inset-0 bg-white z-50 flex-col items-center overflow-y-hidden"> |
| 101 | + <div |
| 102 | + className={`cursor-pointer top-3 py-2 w-full text-right px-4`} |
| 103 | + onClick={toggleMenuButton} |
| 104 | + > |
| 105 | + x <b>close</b> |
| 106 | + </div> |
| 107 | + <ul className="w-[100%] border-solid border-[0.1rem] border-t-0 border-b-0"> |
| 108 | + <li className="border-t border-b-0 border-[0.1rem] py-1 flex leading-1"> |
| 109 | + <Link |
| 110 | + className="px-3 w-full text-left text-grey py-2" |
| 111 | + href="/" |
| 112 | + onClick={toggleMenuButton} |
| 113 | + > |
| 114 | + Home |
| 115 | + </Link> |
| 116 | + </li> |
| 117 | + <li className="border-t border-b-0 border-[0.1rem] flex leading-1"> |
| 118 | + <Link |
| 119 | + className="px-3 w-full text-left text-grey py-2" |
| 120 | + href="/explora" |
| 121 | + onClick={toggleMenuButton} |
| 122 | + > |
| 123 | + Explorations |
| 124 | + </Link> |
| 125 | + </li> |
| 126 | + <li className="border-t border-b-0 border-[0.1rem] flex leading-1"> |
| 127 | + <Link |
| 128 | + className="px-3 w-full text-left text-grey py-2" |
| 129 | + href="/blogs" |
| 130 | + onClick={toggleMenuButton} |
| 131 | + > |
| 132 | + Blogs |
| 133 | + </Link> |
| 134 | + </li> |
| 135 | + <li className="border-t border-b border-[0.1rem] flex leading-1"> |
| 136 | + <Link |
| 137 | + className="px-3 w-full text-left text-grey py-2" |
| 138 | + href="https://youtube.com/@howdevyou" |
| 139 | + target="_blank" |
| 140 | + onClick={toggleMenuButton} |
| 141 | + > |
| 142 | + Youtube |
| 143 | + </Link> |
| 144 | + </li> |
| 145 | + </ul> |
| 146 | + </div> |
| 147 | + )} |
| 148 | + </header> |
| 149 | + ); |
| 150 | +}; |
108 | 151 |
|
109 | | - </div> |
110 | | - )} |
111 | | - </header> |
112 | | - ); |
113 | | -} |
114 | | - |
115 | 152 | export default Header; |
0 commit comments