pedagophys's picture
{
d9112d0 verified
Raw History Blame Contribute Delete
1.64 kB
class CustomHeader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
header {
background-color: #065f46;
color: white;
padding: 1rem 2rem;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.container {
display: flex;
justify-content: space-between;
align-items: center;
max-width: 1200px;
margin: 0 auto;
}
.logo {
display: flex;
align-items: center;
font-weight: 700;
font-size: 1.25rem;
}
.logo i {
margin-right: 0.75rem;
}
nav a {
color: white;
text-decoration: none;
margin-left: 1.5rem;
font-weight: 500;
transition: opacity 0.3s;
}
nav a:hover {
opacity: 0.8;
}
@media (max-width: 768px) {
.container {
flex-direction: column;
}
nav {
margin-top: 1rem;
}
nav a {
margin: 0 0.75rem;
}
}
</style>
<header>
<div class="container">
<div class="logo">
<i data-feather="bar-chart-2"></i>
<span>Soil pH Pro</span>
</div>
<nav>
<a href="#qcm">Partie 1</a>
<a href="#exercice">Partie 2</a>
<a href="#recommandation">Partie 3</a>
</nav>
</div>
</header>
`;
}
}
customElements.define('custom-header', CustomHeader);