Download components/header.js from devmahd/pulcheuse-pro-kitchen-magic-machines: direct link, hf CLI and curl.
- Browser
- Download file 6.32 kB
-
https://huggingface.co/spaces/devmahd/pulcheuse-pro-kitchen-magic-machines/resolve/main/components/header.js
- Command line
-
hf download hf://spaces/devmahd/pulcheuse-pro-kitchen-magic-machines/components/header.js
-
curl -L -o header.js https://huggingface.co/spaces/devmahd/pulcheuse-pro-kitchen-magic-machines/resolve/main/components/header.js
6.32 kB
| 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); |