syncsphere23's picture
⚙️ Functionality and Interactivity
c0129ea verified
Raw History Blame Contribute Delete
1.29 kB
class CustomHeader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
.header {
background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
color: white;
padding: 1.5rem;
text-align: center;
}
h1 {
margin: 0;
font-size: 1.5rem;
font-weight: 700;
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
}
.icon {
width: 24px;
height: 24px;
}
</style>
<header class="header">
<h1>
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
<polyline points="14 2 14 8 20 8"></polyline>
<line x1="16" y1="13" x2="8" y2="13"></line>
<line x1="16" y1="17" x2="8" y2="17"></line>
<polyline points="10 9 9 9 8 9"></polyline>
</svg>
Math Magician Marvel
</h1>
</header>
`;
}
}
customElements.define('custom-header', CustomHeader);