Spaces:
Running

streamflix / components /header.js
kevenb00s's picture
fix everything
cf32a5e verified
Raw History Blame Contribute Delete
5.53 kB
class HeaderVideo extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
}
.header {
background-color: rgba(17, 24, 39, 0.95);
backdrop-filter: blur(10px);
border-bottom: 1px solid #374151;
position: sticky;
top: 0;
z-index: 100;
}
.nav-container {
max-width: 1400px;
margin: 0 auto;
padding: 0 1rem;
}
.nav-flex {
display: flex;
justify-content: space-between;
align-items: center;
height: 70px;
}
.logo {
display: flex;
align-items: center;
font-weight: 700;
font-size: 1.5rem;
color: #f9fafb;
text-decoration: none;
}
.logo-icon {
margin-right: 0.5rem;
color: #3b82f6;
}
.nav-links {
display: flex;
list-style: none;
}
.nav-item {
margin: 0 0.5rem;
}
.nav-link {
color: #d1d5db;
text-decoration: none;
font-weight: 500;
padding: 0.5rem 1rem;
border-radius: 0.5rem;
transition: all 0.3s ease;
}
.nav-link:hover, .nav-link.active {
color: #f9fafb;
background-color: #374151;
}
.search-container {
display: flex;
align-items: center;
}
.search-input {
padding: 0.5rem 1rem;
border-radius: 2rem 0 0 2rem;
border: 1px solid #374151;
background-color: #1f2937;
color: #f9fafb;
width: 300px;
transition: all 0.3s ease;
}
.search-input:focus {
outline: none;
border-color: #3b82f6;
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
width: 350px;
}
.search-btn {
background-color: #3b82f6;
color: white;
border: none;
padding: 0.5rem 1rem;
border-radius: 0 2rem 2rem 0;
cursor: pointer;
transition: background-color 0.3s ease;
}
.search-btn:hover {
background-color: #2563eb;
}
.user-actions {
display: flex;
align-items: center;
}
.action-btn {
background: none;
border: none;
color: #d1d5db;
margin-left: 1rem;
cursor: pointer;
transition: color 0.3s ease;
}
.action-btn:hover {
color: #f9fafb;
}
.user-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
margin-left: 1rem;
background-color: #3b82f6;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
color: white;
}
@media (max-width: 768px) {
.nav-links {
display: none;
}
.search-input {
width: 150px;
}
.search-input:focus {
width: 180px;
}
}
</style>
<header class="header">
<div class="nav-container">
<div class="nav-flex">
<a href="/" class="logo">
<i data-feather="play-circle" class="logo-icon"></i>
<span>StreamFlix</span>
</a>
<ul class="nav-links">
<li class="nav-item">
<a href="index.html" class="nav-link active">Home</a>
</li>
<li class="nav-item">
<a href="universe.html" class="nav-link">The Universe</a>
</li>
<li class="nav-item">
<a href="game.html" class="nav-link">The Game</a>
</li>
<li class="nav-item">
<a href="tools.html" class="nav-link">Creator Tools</a>
</li>
<li class="nav-item">
<a href="marketplace.html" class="nav-link">Marketplace</a>
</li>
</ul>
<div class="search-container">
<div class="search-container">
<input type="text" id="search-input" class="search-input" placeholder="Search...">
<button class="search-btn">
<i data-feather="search"></i>
</button>
</div>
</div>
<div class="user-actions">
<button class="action-btn">
<i data-feather="upload"></i>
</button>
<button class="action-btn">
<i data-feather="bell"></i>
</button>
<div class="user-avatar">U</div>
</div>
</div>
</div>
</header>
`;
// Initialize Feather icons after rendering
setTimeout(() => {
if (typeof feather !== 'undefined') {
feather.replace();
}
}, 0);
}
}
customElements.define('header-video', HeaderVideo);
`;
// Initialize Feather icons after rendering
setTimeout(() => {
feather.replace();
}, 0);
}
}
customElements.define('header-video', HeaderVideo);