JOWilkins's picture
create a new information page with the following info: 1,020 vehicles
3b53676 verified
Raw History Blame Contribute Delete
3.57 kB
class CustomHeader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
header {
transition: all 0.3s ease;
position: fixed;
width: 100%;
top: 0;
z-index: 1000;
}
.nav-link {
position: relative;
transition: color 0.3s ease;
}
.nav-link:hover {
color: #3b82f6;
}
.nav-link::after {
content: '';
position: absolute;
width: 0;
height: 2px;
bottom: -5px;
left: 0;
background-color: #3b82f6;
transition: width 0.3s ease;
}
.nav-link:hover::after {
width: 100%;
}
.mobile-menu {
transition: all 0.3s ease;
}
</style>
<header class="bg-transparent py-4">
<div class="container mx-auto px-6">
<div class="flex justify-between items-center">
<!-- Logo -->
<div class="flex items-center">
<a href="/" class="text-2xl font-bold text-white flex items-center">
<i data-feather="truck" class="w-8 h-8 mr-2"></i>
FleetFlex Pro
</a>
</div>
<!-- Desktop Navigation -->
<nav class="hidden md:flex space-x-8">
<a href="#services" class="nav-link text-white font-semibold">Services</a>
<a href="#leadership" class="nav-link text-white font-semibold">Leadership</a>
<a href="#contact" class="nav-link text-white font-semibold">Contact</a>
</nav>
<!-- Mobile Menu Button -->
<button class="md:hidden text-white" onclick="FleetFlex.toggleMobileMenu()">
<i data-feather="menu" class="w-6 h-6"></i>
</button>
</div>
<!-- Mobile Menu -->
<div id="mobile-menu" class="mobile-menu hidden md:hidden mt-4 bg-white rounded-lg shadow-lg p-4">
<a href="#services" class="block py-2 text-gray-800 font-semibold hover:text-blue-600">Services</a>
<a href="#leadership" class="block py-2 text-gray-800 font-semibold hover:text-blue-600">Leadership</a>
<a href="#contact" class="block py-2 text-gray-800 font-semibold hover:text-blue-600">Contact</a>
</div>
</div>
</header>
`;
// Initialize Feather icons in shadow DOM
setTimeout(() => {
if (typeof feather !== 'undefined') {
feather.replace();
}
}, 100);
}
}
customElements.define('custom-header', CustomHeader);