@@ -8,34 +8,34 @@ const navs: Array<{
88 label : string ;
99 links : Array < { label : string ; href : string } > ;
1010} > = [
11- {
12- label : "Info" ,
13- links : [
14- { label : "About" , href : "#about" } ,
15- { label : "Core Skills" , href : "#core-skills" } ,
16- { label : "Services" , href : "#services" } ,
17- { label : "Projects" , href : "#projects" } ,
18- { label : "Blog" , href : "#blog" } ,
19- { label : "Contact" , href : "#contact" } ,
20- ] ,
21- } ,
22- {
23- label : "Projects" ,
24- links : [
25- { label : "CVE Forge" , href : "https://github.com/etherbeing/cveforge" } ,
26- {
27- label : "This Website" ,
28- href : "https://github.com/etherbeing/etherbeing.github.io" ,
29- } ,
30- { label : "Senjor" , href : "https://github.com/etherbeing/senjor" } ,
31- { label : "Powerhouse" , href : "https://github.com/etherbeing/powerhouse" } ,
32- { label : "TFProtocol" , href : "https://github.com/etherbeing/tfprotocol" } ,
33- ] ,
34- } ,
35- ] ;
11+ {
12+ label : "Info" ,
13+ links : [
14+ { label : "About" , href : "#about" } ,
15+ { label : "Core Skills" , href : "#core-skills" } ,
16+ { label : "Services" , href : "#services" } ,
17+ { label : "Projects" , href : "#projects" } ,
18+ { label : "Blog" , href : "#blog" } ,
19+ { label : "Contact" , href : "#contact" } ,
20+ ] ,
21+ } ,
22+ {
23+ label : "Projects" ,
24+ links : [
25+ { label : "CVE Forge" , href : "https://github.com/etherbeing/cveforge" } ,
26+ {
27+ label : "This Website" ,
28+ href : "https://github.com/etherbeing/etherbeing.github.io" ,
29+ } ,
30+ { label : "Senjor" , href : "https://github.com/etherbeing/senjor" } ,
31+ { label : "Powerhouse" , href : "https://github.com/etherbeing/powerhouse" } ,
32+ { label : "TFProtocol" , href : "https://github.com/etherbeing/tfprotocol" } ,
33+ ] ,
34+ } ,
35+ ] ;
3636
3737export default function Header ( ) {
38- const [ isOpen , setIsOpen ] = useState ( false ) ;
38+ const [ isOpen , setIsOpen ] = useState < boolean | undefined > ( ) ;
3939
4040 return (
4141 < header className = "z-20 fixed w-screen flex items-center justify-center mt-10" >
@@ -48,65 +48,71 @@ export default function Header() {
4848 src = { `https://github.com/${ import . meta. env . PUBLIC_GITHUB_USER } .png` }
4949 />
5050 </ a >
51+ < h1 className = "text-2xl font-bold my-0 py-0 cursor-default select-none" >
52+ etherbeing
53+ </ h1 >
5154 < Hamburger
5255 size = { 20 }
5356 label = "Show options"
5457 toggled = { isOpen }
5558 onToggle = { setIsOpen }
5659 > </ Hamburger >
5760 </ div >
58- < nav
59- style = { {
60- animationDelay : `${ navs . length * 100 } ms` ,
61- } }
62- className = { `w-full grid grid-cols-1 md:grid-cols-2 gap-3 overflow-hidden transition-all duration-300 h-0 ${ isOpen ? "nav-expand" : "nav-collapse" } ` }
63- >
64- { navs . map ( ( nav , i ) => (
65- < SpotlightCard
66- key = { i }
67- className = { `mt-5 w-full flex flex-col gap-3 translate-y-100 opacity-0` }
68- style = { {
69- animationDelay : `${ i * 100 + 100 } ms` ,
70- backgroundColor : oklchGradient (
71- 0 ,
72- 10 ,
73- 0.05 ,
74- 300 ,
75- i ,
76- navs . length ,
77- ) ,
78- } }
79- >
80- < h3 className = "text-lg font-bold cursor-default" > { nav . label } </ h3 >
81- < div className = "flex flex-col gap-3" >
82- { nav . links . map ( ( link , i ) => (
83- < a
84- onClick = { ( e ) => {
85- e . preventDefault ( ) ;
86- e . stopPropagation ( ) ;
87- const hash = new URL ( e . currentTarget . href ) . hash ;
88- let section = document . querySelector ( hash ) ;
89- if ( section ) {
90- section . scrollIntoView ( {
91- behavior : "smooth" ,
92- } ) ;
93- } else {
94- location . assign ( `/${ hash } ` ) ;
95- }
96- setIsOpen ( false ) ;
97- } }
98- key = { i }
99- href = { link . href }
100- className = "text-sm inline-flex items-center"
101- >
102- < GoArrowUpRight className = "mr-2" />
103- { link . label }
104- </ a >
105- ) ) }
106- </ div >
107- </ SpotlightCard >
108- ) ) }
109- </ nav >
61+ { isOpen !== undefined ? (
62+
63+ < nav
64+ style = { {
65+ animationDelay : `${ navs . length * 100 } ms` ,
66+ } }
67+ className = { `w-full grid grid-cols-1 md:grid-cols-2 gap-3 overflow-hidden transition-all duration-300 h-0 ${ isOpen ? "nav-expand" : "nav-collapse" } ` }
68+ >
69+ { navs . map ( ( nav , i ) => (
70+ < SpotlightCard
71+ key = { i }
72+ className = { `mt-5 w-full flex flex-col gap-3 translate-y-100 opacity-0` }
73+ style = { {
74+ animationDelay : `${ i * 100 + 100 } ms` ,
75+ backgroundColor : oklchGradient (
76+ 0 ,
77+ 10 ,
78+ 0.05 ,
79+ 300 ,
80+ i ,
81+ navs . length ,
82+ ) ,
83+ } }
84+ >
85+ < h3 className = "text-lg font-bold cursor-default" > { nav . label } </ h3 >
86+ < div className = "flex flex-col gap-3" >
87+ { nav . links . map ( ( link , i ) => (
88+ < a
89+ onClick = { ( e ) => {
90+ e . preventDefault ( ) ;
91+ e . stopPropagation ( ) ;
92+ const hash = new URL ( e . currentTarget . href ) . hash ;
93+ let section = document . querySelector ( hash ) ;
94+ if ( section ) {
95+ section . scrollIntoView ( {
96+ behavior : "smooth" ,
97+ } ) ;
98+ } else {
99+ location . assign ( `/${ hash } ` ) ;
100+ }
101+ setIsOpen ( false ) ;
102+ } }
103+ key = { i }
104+ href = { link . href }
105+ className = "text-sm inline-flex items-center"
106+ >
107+ < GoArrowUpRight className = "mr-2" />
108+ { link . label }
109+ </ a >
110+ ) ) }
111+ </ div >
112+ </ SpotlightCard >
113+ ) ) }
114+ </ nav >
115+ ) : null }
110116 </ SpotlightCard >
111117 </ header >
112118 ) ;
0 commit comments