Spaces:
Running
Running
File size: 2,918 Bytes
52ec77f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | class CustomHeader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
}
.header {
background: linear-gradient(90deg, #0f0f23 0%, #1a1a2e 100%);
border-bottom: 1px solid rgba(218, 165, 32, 0.3);
padding: 1rem 0;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 1rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
display: flex;
align-items: center;
color: #DAA520;
text-decoration: none;
}
.logo-icon {
margin-right: 12px;
color: #5B9BD5;
}
.logo-text {
font-family: 'Orbitron', sans-serif;
font-size: 1.8rem;
font-weight: 700;
letter-spacing: 2px;
background: linear-gradient(90deg, #DAA520, #5B9BD5);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.nav-links {
display: flex;
list-style: none;
}
.nav-link {
margin-left: 2rem;
color: #aaa;
text-decoration: none;
font-family: 'Orbitron', sans-serif;
font-size: 1rem;
transition: color 0.3s;
display: flex;
align-items: center;
}
.nav-link:hover {
color: #DAA520;
}
.nav-link i {
margin-right: 8px;
}
@media (max-width: 768px) {
.container {
flex-direction: column;
}
.nav-links {
margin-top: 1rem;
}
.nav-link {
margin: 0 1rem;
}
}
</style>
<header class="header">
<div class="container">
<a href="/" class="logo">
<i data-feather="cpu" class="logo-icon"></i>
<span class="logo-text">TrekPDF</span>
</a>
<ul class="nav-links">
<li><a href="#" class="nav-link"><i data-feather="home"></i> Home</a></li>
<li><a href="#" class="nav-link"><i data-feather="settings"></i> Settings</a></li>
<li><a href="#" class="nav-link"><i data-feather="help-circle"></i> Help</a></li>
</ul>
</div>
</header>
`;
// Initialize Feather Icons after a short delay to ensure DOM is ready
setTimeout(() => {
if (typeof feather !== 'undefined') {
feather.replace();
}
}, 100);
}
}
customElements.define('custom-header', CustomHeader); |