Neomyst's picture
divine animated magic psychedelic hallucination visual optical illusion website
7a6aec8 verified
class PsychedelicNavbar extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
position: fixed;
top: 0;
width: 100%;
z-index: 1000;
}
nav {
background: rgba(0, 0, 0, 0.8);
backdrop-filter: blur(20px);
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
padding: 1rem 2rem;
}
.nav-content {
max-width: 7xl;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-family: 'Orbitron', monospace;
font-weight: 900;
font-size: 1.5rem;
background: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.nav-links {
display: flex;
gap: 2rem;
align-items: center;
}
.nav-link {
color: white;
text-decoration: none;
font-weight: 500;
position: relative;
transition: all 0.3s ease;
}
.nav-link:hover {
color: #ff00ff;
}
.nav-link::after {
content: '';
position: absolute;
bottom: -5px;
left: 0;
width: 0;
height: 2px;
background: linear-gradient(45deg, #ff00ff, #00ffff);
transition: width 0.3s ease;
}
.nav-link:hover::after {
width: 100%;
}
.mobile-menu-btn {
display: none;
background: none;
border: none;
color: white;
cursor: pointer;
}
@media (max-width: 768px) {
nav {
padding: 1rem;
}
.mobile-menu-btn {
display: block;
}
.nav-links {
display: none;
position: absolute;
top: 100%;
left: 0;
width: 100%;
background: rgba(0, 0, 0, 0.9);
flex-direction: column;
padding: 1rem;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.nav-links.active {
display: flex;
}
}
</style>
<nav>
<div class="nav-content">
<a href="index.html" class="logo">PSYCHEDELIC ✨</a>
<button class="mobile-menu-btn">
<i data-feather="menu"></i>
</button>
<div class="nav-links">
<a href="index.html" class="nav-link">Home</a>
<a href="gallery.html" class="nav-link">Gallery</a>
<a href="create.html" class="nav-link">Create</a>
<a href="about.html" class="nav-link">About</a>
</div>
</div>
</nav>
`;
// Add mobile menu functionality
const menuBtn = this.shadowRoot.querySelector('.mobile-menu-btn');
const navLinks = this.shadowRoot.querySelector('.nav-links');
menuBtn.addEventListener('click', () => {
navLinks.classList.toggle('active');
});
}
}
customElements.define('psychedelic-navbar', PsychedelicNavbar);