Navbar Component
The Navbar component provides a glassmorphic, fixed-position navigation bar with responsive behavior, social media links, and theme switching capabilities.Overview
Located insrc/components/Navbar.tsx, this component features:
- Fixed positioning with glassmorphism styling
- Responsive mobile menu with smooth transitions
- Integrated dark/light mode toggle
- Social media links (GitHub, LinkedIn, Email)
- Animated “Chat” button with bounce effect
- Smooth scroll navigation
Props
Callback function triggered when the Chat button is clicked. Use this to open the ChatBox component.
Controls the navbar’s color scheme. Pass
true for dark mode styling.Callback function for the dark/light mode toggle button. Should update the app’s theme state.
Usage
Features
Navigation Links
The navbar includes smooth-scroll anchor links to main sections:- Home (
#home) - About (
#about) - Projects (
#projects) - Contact (
#contact)
Chat Button Animation
The Chat button features a special animation effect:The Chat button has a continuous bounce animation (
animate-chat-bounce-slow) that stops after the first click, preventing distraction for returning users.Mobile Responsiveness
The navbar automatically adapts for mobile screens:- Desktop: Horizontal layout with all links visible
- Mobile: Hamburger menu with slide-down menu panel
- Social links appear in both desktop (top bar) and mobile (menu footer)
Social Links
Hardcoded social media links (update inNavbar.tsx:72-89):
Styling
The navbar uses dynamic Tailwind classes based on theisDarkMode prop:
- Dark Mode
- Light Mode
Component State
Internal state management:Customization
To customize the navbar:- Update social links: Edit URLs in
Navbar.tsx:72-89 - Change logo: Modify the “EC” text in
Navbar.tsx:30-32 - Add/remove navigation items: Update links in
Navbar.tsx:37-48 - Adjust styling: Modify Tailwind classes in the component