11import { ModeToggle } from "@/components/mode-toggle" ;
22import { Button } from "@/components/ui/button" ;
3- import {
4- DropdownMenu ,
5- DropdownMenuContent ,
6- DropdownMenuItem ,
7- DropdownMenuTrigger ,
8- } from "@/components/ui/dropdown-menu" ;
93import { motion , useScroll } from "framer-motion" ;
104import { cn } from "@/lib/utils" ;
115import { useEffect , useRef , useState } from "react" ;
126import { useNavigate , useLocation } from "react-router" ;
7+ import {
8+ Sheet ,
9+ SheetClose ,
10+ SheetContent ,
11+ SheetFooter ,
12+ SheetHeader ,
13+ SheetTitle ,
14+ SheetTrigger ,
15+ } from "./ui/sheet" ;
16+ import { X } from "lucide-react" ;
1317
1418export function Header ( ) {
1519 const [ isScrolled , setIsScrolled ] = useState ( false ) ;
@@ -56,7 +60,7 @@ export function Header() {
5660
5761 return (
5862 < motion . header
59- className = "fixed w-full z-55 "
63+ className = "fixed left-0 right-0 z-5 "
6064 animate = { {
6165 top : isScrolled ? ( isVisible ? "20px" : "-80px" ) : "0" ,
6266 } }
@@ -65,66 +69,100 @@ export function Header() {
6569 < div className = "container mx-auto px-4" >
6670 < motion . div
6771 className = { cn (
68- "mx-auto rounded-xl transition-colors max-w-5xl" ,
72+ "mx-auto rounded-full transition-colors max-w-5xl flex justify-between items-center mx-auto " ,
6973 isScrolled
7074 ? "bg-card shadow-lg backdrop-blur-lg supports-[backdrop-filter]:bg-card/50"
7175 : "bg-transparent"
7276 ) }
7377 animate = { {
74- padding : isScrolled ? "0.5rem 1.5rem " : "0.5rem 0rem " ,
78+ padding : isScrolled ? "4px 24px " : "4px 4px " ,
7579 } }
7680 transition = { { duration : 0.3 , ease : [ 0.1 , 0.6 , 0.3 , 0.95 ] } }
7781 >
78- < div className = "h-12 flex justify-between items-center mx-auto" >
79- < Button variant = "ghost" onClick = { ( e ) => handleClick ( "home" , e ) } >
80- < span className = "font-bold" > Simon Manzler</ span >
81- </ Button >
82+ < Button
83+ variant = "ghost"
84+ size = "icon"
85+ onClick = { ( e ) => handleClick ( "home" , e ) }
86+ >
87+ < img
88+ src = "/src/assets/simon-icon.png"
89+ alt = "Simon Manzler"
90+ className = "h-6 w-6"
91+ />
92+ </ Button >
8293
83- < nav className = "flex items-center" >
84- < div className = "hidden md:flex" >
85- < Button
86- variant = "ghost"
87- onClick = { ( e ) => handleClick ( "projects" , e ) }
88- >
89- Projects
90- </ Button >
91- < Button
92- variant = "ghost"
93- onClick = { ( e ) => handleClick ( "about" , e ) }
94- >
95- About
96- </ Button >
97- < Button
98- variant = "ghost"
99- onClick = { ( e ) => handleClick ( "contact" , e ) }
100- >
101- Contact
102- </ Button >
103- </ div >
94+ < nav className = "flex items-center" >
95+ < div className = "hidden md:flex" >
96+ < Button
97+ variant = "ghost"
98+ onClick = { ( e ) => handleClick ( "projects" , e ) }
99+ >
100+ Projects
101+ </ Button >
102+ < Button variant = "ghost" onClick = { ( e ) => handleClick ( "about" , e ) } >
103+ About
104+ </ Button >
105+ < Button
106+ variant = "ghost"
107+ onClick = { ( e ) => handleClick ( "contact" , e ) }
108+ >
109+ Contact
110+ </ Button >
111+ </ div >
104112
105- < div className = "flex items-center" >
106- < ModeToggle />
107- < DropdownMenu >
108- < DropdownMenuTrigger asChild className = "md:hidden" >
109- < Button variant = "ghost" size = "icon" >
110- < MenuIcon className = "h-6 w-6" />
111- </ Button >
112- </ DropdownMenuTrigger >
113- < DropdownMenuContent align = "end" >
114- < DropdownMenuItem onSelect = { ( ) => handleClick ( "projects" ) } >
113+ < div className = "flex items-center" >
114+ < ModeToggle />
115+ < Sheet >
116+ < SheetTrigger asChild className = "md:hidden" >
117+ < Button variant = "ghost" size = "icon" >
118+ < MenuIcon className = "h-6 w-6" />
119+ </ Button >
120+ </ SheetTrigger >
121+ < SheetContent side = "right" >
122+ < SheetHeader >
123+ < SheetTitle >
124+ < img
125+ src = "/src/assets/simon-icon.png"
126+ alt = "Simon Manzler"
127+ className = "h-6 w-6"
128+ />
129+ </ SheetTitle >
130+ </ SheetHeader >
131+ < div className = "flex flex-col" >
132+ < Button
133+ variant = "link"
134+ className = "justify-start"
135+ onClick = { ( e ) => handleClick ( "projects" , e ) }
136+ >
115137 Projects
116- </ DropdownMenuItem >
117- < DropdownMenuItem onSelect = { ( ) => handleClick ( "about" ) } >
138+ </ Button >
139+ < Button
140+ variant = "link"
141+ className = "justify-start"
142+ onClick = { ( e ) => handleClick ( "about" , e ) }
143+ >
118144 About
119- </ DropdownMenuItem >
120- < DropdownMenuItem onSelect = { ( ) => handleClick ( "contact" ) } >
145+ </ Button >
146+ < Button
147+ variant = "link"
148+ className = "justify-start"
149+ onClick = { ( e ) => handleClick ( "contact" , e ) }
150+ >
121151 Contact
122- </ DropdownMenuItem >
123- </ DropdownMenuContent >
124- </ DropdownMenu >
125- </ div >
126- </ nav >
127- </ div >
152+ </ Button >
153+ </ div >
154+ < SheetFooter >
155+ < SheetClose asChild >
156+ < Button variant = "ghost" >
157+ < X className = "h-6 w-6" />
158+ Close
159+ </ Button >
160+ </ SheetClose >
161+ </ SheetFooter >
162+ </ SheetContent >
163+ </ Sheet >
164+ </ div >
165+ </ nav >
128166 </ motion . div >
129167 </ div >
130168 </ motion . header >
0 commit comments