cinelux / components /header.js
Ercik67's picture
Create a landing page for a cinema, luxury movie
6fd5edd verified
class HeaderCinema extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
header {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 1000;
padding: 1.5rem 0;
transition: all 0.3s ease;
background: transparent;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 2rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
display: flex;
align-items: center;
text-decoration: none;
}
.logo-icon {
color: #F59E0B;
margin-right: 0.75rem;
}
.logo-text {
font-size: 1.75rem;
font-weight: 800;
background: linear-gradient(to right, #F59E0B, #FBBF24);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
nav ul {
display: flex;
list-style: none;
}
nav li {
margin-left: 2rem;
}
nav a {
color: #F9FAFB;
text-decoration: none;
font-weight: 600;
font-size: 1.1rem;
transition: color 0.3s ease;
position: relative;
}
nav a:hover {
color: #F59E0B;
}
nav a::after {
content: '';
position: absolute;
bottom: -5px;
left: 0;
width: 0;
height: 2px;
background: #F59E0B;
transition: width 0.3s ease;
}
nav a:hover::after {
width: 100%;
}
.auth-buttons {
display: flex;
gap: 1rem;
}
.btn {
padding: 0.75rem 1.5rem;
border-radius: 0.5rem;
font-weight: 600;
transition: all 0.3s ease;
cursor: pointer;
border: none;
font-size: 1rem;
}
.btn-login {
background: transparent;
color: #F9FAFB;
border: 2px solid #F59E0B;
}
.btn-login:hover {
background: #F59E0B;
color: #111827;
}
.btn-signup {
background: #F59E0B;
color: #111827;
}
.btn-signup:hover {
background: #D97706;
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
.mobile-menu-btn {
display: none;
background: none;
border: none;
color: #F9FAFB;
font-size: 1.5rem;
cursor: pointer;
}
@media (max-width: 768px) {
.nav-links {
display: none;
}
.auth-buttons {
display: none;
}
.mobile-menu-btn {
display: block;
}
}
</style>
<header>
<div class="container">
<a href="/" class="logo">
<i data-feather="film" class="logo-icon w-8 h-8"></i>
<span class="logo-text">CineLux</span>
</a>
<nav class="nav-links">
<ul>
<li><a href="/">Home</a></li>
<li><a href="#movies">Movies</a></li>
<li><a href="#membership">Membership</a></li>
<li><a href="#">Events</a></li>
<li><a href="#">About</a></li>
</ul>
</nav>
<div class="auth-buttons">
<button class="btn btn-login">Login</button>
<button class="btn btn-signup">Sign Up</button>
</div>
<button class="mobile-menu-btn">
<i data-feather="menu"></i>
</button>
</div>
</header>
`;
// Initialize feather icons
import('https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js').then(() => {
setTimeout(() => {
feather.replace();
}, 100);
});
}
}
customElements.define('header-cinema', HeaderCinema);