useEffect(() => {
const hash = location.hash;
if (hash) {
const element = document.querySelector(hash);
if (element) {
element.scrollIntoView({ behavior: 'smooth' }); // Smooth scroll to the element
}
}
}, [location]); // Run this effect whenever the location changes
return (
<Navbar bg="light" expand="lg" fixed="top" className="shadow-sm">
<Container>
<Navbar.Brand href='/' className="menu-title">
<img src={logo} alt="Little Great Minds Logo" className="nav-logo" />
Little Great Minds
</Navbar.Brand>
<Navbar.Toggle aria-controls="navbarNav" />
<Navbar.Collapse id="navbarNav" className="justify-content-end">
<Nav>
<Nav.Link as={Link} to="/#about">
{t('navbar.about')}
</Nav.Link>
<Nav.Link as={Link} to="/#programs">
{t('navbar.programs')}
</Nav.Link>
<Nav.Link as={Link} to="/#gallery">
{t('navbar.gallery')}
</Nav.Link>
<Nav.Link as={Link} to="/#testimonials">
{t('navbar.testimonials')}
</Nav.Link>
<Nav.Link as={Link} to="/services">
{t('services.title')}
</Nav.Link>
<Nav.Link as={Link} to="/#contact">
{t('navbar.contact')}
</Nav.Link>
<TranslateButton />
</Nav>
</Navbar.Collapse>
</Container>
</Navbar>
);
/* Professional Navbar Styles */
.professional-navbar {
background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
backdrop-filter: blur(10px);
transition: all 0.3s ease;
padding: 0.75rem 0;
min-height: 80px;
}
.professional-navbar.shadow-lg {
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
}
/* Brand Styling */
.brand-container {
display: flex;
align-items: center;
text-decoration: none !important;
transition: transform 0.2s ease;
padding: 0.5rem 0;
}
.brand-container:hover {
transform: translateY(-1px);
}
.brand-logo {
height: 45px;
width: auto;
margin-right: 12px;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}
.brand-text {
font-size: 1.5rem;
font-weight: 700;
color: #2c3e50;
letter-spacing: -0.5px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
/* Navigation Items */
.nav-item-custom {
font-weight: 500;
font-size: 0.95rem;
color: #495057 !important;
margin: 0 0.25rem;
padding: 0.75rem 1rem !important;
border-radius: 8px;
transition: all 0.3s ease;
position: relative;
text-decoration: none;
}
.nav-item-custom:hover {
color: #667eea !important;
background-color: rgba(102, 126, 234, 0.08);
transform: translateY(-1px);
}
.nav-item-custom::after {
content: '';
position: absolute;
width: 0;
height: 2px;
bottom: 0;
left: 50%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
transition: all 0.3s ease;
transform: translateX(-50%);
}
.nav-item-custom:hover::after {
width: 80%;
}
/* Special styling for Services link */
.services-link {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white !important;
font-weight: 600;
margin: 0 0.5rem;
border-radius: 25px;
padding: 0.75rem 1.5rem !important;
}
.services-link:hover {
background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
color: white !important;
transform: translateY(-2px);
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}
.services-link::after {
display: none;
}
/* Contact link styling */
.contact-link {
border: 2px solid #667eea;
color: #667eea !important;
font-weight: 600;
margin-left: 0.5rem;
border-radius: 25px;
padding: 0.75rem 1.5rem !important;
}
.contact-link:hover {
background-color: #667eea;
color: white !important;
transform: translateY(-1px);
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}
.contact-link::after {
display: none;
}
/* Translate Button Wrapper */
.translate-wrapper {
margin-left: 1rem;
display: flex;
align-items: center;
}
/* Custom Toggler */
.custom-toggler {
border: none;
padding: 0.5rem;
border-radius: 8px;
transition: all 0.3s ease;
}
.custom-toggler:focus {
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}
.custom-toggler .navbar-toggler-icon {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
/* Responsive Design */
@media (max-width: 991.98px) {
.professional-navbar {
padding: 0.5rem 0;
min-height: 70px;
}
.brand-logo {
height: 35px;
}
.brand-text {
font-size: 1.3rem;
}
.nav-item-custom {
margin: 0.25rem 0;
text-align: center;
}
.services-link,
.contact-link {
margin: 0.5rem 0;
display: inline-block;
text-align: center;
}
.translate-wrapper {
margin: 1rem 0 0 0;
justify-content: center;
}
}
@media (max-width: 575.98px) {
.brand-text {
font-size: 1.1rem;
}
.brand-logo {
height: 30px;
}
}
/* Smooth scrolling enhancement */
html {
scroll-behavior: smooth;
}
/* Active state for current page */
.nav-item-custom.active {
color: #667eea !important;
background-color: rgba(102, 126, 234, 0.1);
}
.nav-item-custom.active::after {
width: 80%;
}