File size: 6,318 Bytes
3d536db e152d44 3d536db 1c7f7ca 3d536db 2946008 1c7f7ca 3d536db 2946008 1c7f7ca 3d536db 1c7f7ca 3d536db 2946008 1c7f7ca 3d536db 1c7f7ca 3d536db 1c7f7ca 3d536db 1c7f7ca dfe7ff4 3d536db dfe7ff4 3d536db 1c7f7ca 3d536db dfe7ff4 910af9d 1c7f7ca dfe7ff4 1c7f7ca dfe7ff4 1c7f7ca 3d536db 910af9d 3d536db 1c7f7ca dfe7ff4 1c7f7ca dfe7ff4 1c7f7ca 3d536db 1c7f7ca 3d536db 1c7f7ca 3d536db | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | class CustomHeader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
.header-container {
background-color: white;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
position: sticky;
top: 0;
z-index: 50;
}
.header-content {
max-width: 1200px;
margin: 0 auto;
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
transition: padding 0.3s ease;
}
.logo {
font-size: 1.5rem;
font-weight: 700;
color: #1d4ed8;
display: flex;
align-items: center;
}
.logo-icon {
margin-right: 0.5rem;
color: #fbbf24;
}
.nav-links {
display: flex;
gap: 2rem;
}
.nav-link {
color: #4b5563;
font-weight: 500;
transition: color 0.3s;
cursor: pointer;
}
.nav-link:hover {
color: #1d4ed8;
}
.contact-btn {
background-color: #10b981;
color: white;
padding: 0.5rem 1.5rem;
border-radius: 9999px;
font-weight: 600;
transition: all 0.3s;
animation: pulse 2s infinite;
}
.contact-btn:hover {
background-color: #059669;
transform: translateY(-2px);
animation: none;
}
.mobile-menu-btn {
display: none;
background: none;
border: none;
cursor: pointer;
padding: 0.5rem;
transition: transform 0.3s ease;
}
.mobile-menu-btn.active {
transform: rotate(90deg);
}
.hamburger {
display: flex;
flex-direction: column;
gap: 0.3rem;
width: 24px;
}
.hamburger span {
display: block;
width: 100%;
height: 2px;
background-color: #1d4ed8;
transition: all 0.3s ease;
}
.mobile-menu-btn.active .hamburger span:nth-child(1) {
transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-btn.active .hamburger span:nth-child(2) {
opacity: 0;
}
.mobile-menu-btn.active .hamburger span:nth-child(3) {
transform: rotate(-45deg) translate(5px, -5px);
}
@media (max-width: 768px) {
.header-content {
padding: 1rem;
}
.mobile-menu-btn {
display: block;
}
.nav-links {
position: absolute;
top: 100%;
left: 0;
right: 0;
background: white;
padding: 1rem;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
display: none;
flex-direction: column;
gap: 1rem;
max-height: 0;
opacity: 0;
overflow: hidden;
transition: max-height 0.3s ease-out, opacity 0.2s ease;
}
.nav-links.show {
display: flex;
max-height: 300px;
opacity: 1;
}
.contact-btn {
margin-left: auto;
margin-right: 1rem;
order: 1;
}
.mobile-menu-btn {
order: 0;
}
}
@keyframes pulse {
0%, 100% {
transform: scale(1);
}
50% {
transform: scale(1.05);
}
}
</style>
<div class="header-container">
<div class="header-content">
<div class="flex items-center gap-4">
<button class="mobile-menu-btn" aria-label="Menu">
<div class="hamburger">
<span></span>
<span></span>
<span></span>
</div>
</button>
<div class="logo">
<i data-feather="tool" class="logo-icon"></i>
Épulcheuse Pro
</div>
</div>
<div class="flex items-center gap-6">
<div class="nav-links">
<a href="#hero" class="nav-link">Accueil</a>
<a href="#products" class="nav-link">Produits</a>
<a href="#testimonials" class="nav-link">Témoignages</a>
</div>
<a href="https://wa.me/237693930778?text=Bonjour%2C%20je%20souhaite%20avoir%20plus%20d'informations%20sur%20vos%20%C3%A9pulcheuses"
class="contact-btn">
Nous Contacter
</a>
</div>
</div>
</div>
`;
}
}
customElements.define('custom-header', CustomHeader); |