Navbar Component
The Navbar component provides the main navigation interface for the portfolio. It integrates with the FloatingDock component to create a macOS-style navigation experience with route highlighting and internationalization support.Features
- Floating dock navigation with animated icons
- Active route highlighting with custom colors
- Integration with React Router for navigation
- i18n support for multiple languages
- Icon-based navigation using Tabler Icons
- Smooth transition effects on hover and selection
Source Code Location
Dependencies
Usage
Implementation Details
The Navbar component creates a navigation structure with four main sections:Component Structure
The Navbar returns a centered container that wraps the FloatingDock component:Route Highlighting
The component automatically highlights the active route by comparing the current pathname with each link’s href:- Active route:
text-icon-selectclass is applied - Inactive routes:
text-icon hover:text-icon-hoverclasses are applied - Smooth 300ms color transition between states
Navigation Items
The navbar includes these navigation sections:Home
Links to the portfolio homepage
About
Links to the about/bio section
Projects
Links to the projects showcase
Contact
Links to the contact information
Internationalization
The Navbar uses react-i18next for translations:- Navigation labels are translated:
t("navbar.home"),t("navbar.about"), etc. - Routes are localized:
t("routes.about-me"),t("routes.projects"), etc. - Language changes automatically update both labels and navigation paths
Styling
The component uses Tailwind CSS with custom color tokens:text-icon: Default icon colortext-icon-hover: Hover state colortext-icon-select: Selected/active route color- Icons use full width/height:
h-full w-full