Header
The Header component provides a fixed navigation bar with smooth scrolling functionality to different sections of the page. It features a glassmorphic design with backdrop blur effects.Overview
This navigation component is positioned at the bottom on mobile and at the top on desktop. It includes smooth scroll behavior to navigate between page sections without page reloads.Props
The Header component does not accept any props. It uses hardcoded navigation links to specific section IDs.Usage
Features
Smooth Scrolling
The header usesscrollIntoView with smooth behavior to navigate to sections:
Navigation Links
The component includes four navigation buttons:- HOME - Scrolls to
#presentation - PROJECTS - Scrolls to
#projects - ABOUT ME - Scrolls to
#aboutme - CONTACT ME - Scrolls to
#contact
Responsive Design
The header automatically repositions based on screen size:
- Mobile (default): Fixed at bottom
- Desktop (md breakpoint): Fixed at top
Styling
Glassmorphism Effect
The header uses a modern glassmorphic design:- Semi-transparent white background (5% opacity)
- Backdrop blur effect
- Subtle white border (20% opacity)
- Rounded corners
Button Hover States
Each button includes hover effects:Customization
Modifying Navigation Links
To customize the navigation links, edit the button elements:Changing Position
To keep header at top on all screen sizes:Custom Styling
Required Section IDs
Responsive Breakpoints
Tailwind CSS breakpoints used:- Default (mobile): < 768px
- Bottom position
- Smaller gaps (gap-1)
- Smaller padding (px-3)
- Smaller text (text-xs)
- md (tablet/desktop): ≥ 768px
- Top position
- Larger gaps (gap-2)
- Larger padding (px-5)
- Larger text (text-sm)
Accessibility
The component includes:- Semantic
<header>element - Proper button elements with click handlers
- Keyboard accessible buttons
- Clear text labels
- High z-index (50) to stay above content
Best Practices
- Section IDs: Use descriptive, lowercase IDs without spaces
- Z-Index: Ensure the header’s z-index is higher than other fixed elements
- Scroll Padding: Consider adding scroll padding to your sections to account for the fixed header:
- Active States: Consider adding active state styling to indicate current section:
Browser Compatibility
The smooth scroll behavior is supported in:- Chrome 61+
- Firefox 36+
- Safari 15.4+
- Edge 79+
For older browsers, the navigation will still work but will use instant scrolling instead of smooth scrolling.