Spaces:
Running
Running
File size: 2,022 Bytes
35f4881 |
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 |
class CustomHeader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
}
.header {
background-color: #1f2937;
padding: 1rem 0;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 1rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-size: 1.5rem;
font-weight: bold;
color: #0ea5e9;
text-decoration: none;
display: flex;
align-items: center;
}
.logo i {
margin-right: 0.5rem;
}
.contact-info {
display: flex;
align-items: center;
gap: 1rem;
}
.phone {
display: flex;
align-items: center;
font-weight: bold;
color: #f9fafb;
text-decoration: none;
}
.phone i {
margin-right: 0.5rem;
color: #0ea5e9;
}
@media (max-width: 768px) {
.contact-info {
display: none;
}
}
</style>
<header class="header">
<div class="container">
<a href="/" class="logo">
<i data-feather="tool"></i>
PlumbCraft Pro
</a>
<div class="contact-info">
<a href="tel:+1234567890" class="phone">
<i data-feather="phone"></i>
(123) 456-7890
</a>
</div>
</div>
</header>
`;
// Initialize Feather icons
import('https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js').then(() => {
feather.replace();
});
}
}
customElements.define('custom-header', CustomHeader); |