CAGB058's picture
persiste el error
716c855 verified
Raw History Blame Contribute Delete
2.08 kB
class CustomHeader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
width: 100%;
background-color: white;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.header-container {
max-width: 1200px;
margin: 0 auto;
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
display: flex;
align-items: center;
gap: 0.75rem;
font-weight: 600;
color: #1F2937;
text-decoration: none;
}
.logo-icon {
color: #3B82F6;
}
@media (max-width: 640px) {
.header-container {
padding: 1rem;
}
}
</style>
<header class="header-container">
<a href="/" class="logo">
<i data-feather="code" class="logo-icon"></i>
<span>XML Explorer</span>
</a>
<div class="flex items-center gap-4">
<theme-toggle></theme-toggle>
<a href="#" class="text-gray-600 hover:text-primary transition duration-200">
<i data-feather="help-circle"></i>
</a>
<a href="/api.html" class="text-gray-600 hover:text-primary transition duration-200">
<i data-feather="cpu"></i>
</a>
</div>
</header>
`;
}
}
customElements.define('custom-header', CustomHeader);