Menú de Navegación Neón Brillante
Intermedio
Un menú de navegación futurista con efectos de brillo neón vibrantes, bordes animados y estética cyberpunk
Vista Previa en Vivo
Implementación del Código
HTML
<nav class="neon-menu">
<div class="menu-container">
<div class="brand">
<div class="brand-icon">
<div class="neon-core"></div>
<div class="neon-ring"></div>
</div>
<span class="brand-text">NEON</span>
</div>
<ul class="menu-items">
<li class="menu-item">
<a href="#" class="menu-link" data-text="INICIO">
<span class="link-text">INICIO</span>
<div class="neon-glow"></div>
</a>
</li>
<li class="menu-item">
<a href="#" class="menu-link" data-text="ACERCA">
<span class="link-text">ACERCA</span>
<div class="neon-glow"></div>
</a>
</li>
<li class="menu-item">
<a href="#" class="menu-link" data-text="SERVICIOS">
<span class="link-text">SERVICIOS</span>
<div class="neon-glow"></div>
</a>
</li>
<li class="menu-item">
<a href="#" class="menu-link" data-text="PORTAFOLIO">
<span class="link-text">PORTAFOLIO</span>
<div class="neon-glow"></div>
</a>
</li>
<li class="menu-item">
<a href="#" class="menu-link" data-text="CONTACTO">
<span class="link-text">CONTACTO</span>
<div class="neon-glow"></div>
</a>
</li>
</ul>
<div class="menu-toggle">
<button class="toggle-btn" id="menuToggle">
<span class="toggle-line"></span>
<span class="toggle-line"></span>
<span class="toggle-line"></span>
</button>
</div>
</div>
<div class="neon-background">
<div class="grid-lines"></div>
<div class="floating-particles"></div>
</div>
</nav>
CSS
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Orbitron', monospace;
background: #0a0a0a;
color: #ffffff;
min-height: 100vh;
overflow-x: hidden;
position: relative;
}
body::before {
content: '';
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background:
radial-gradient(circle at 20% 20%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
radial-gradient(circle at 80% 80%, rgba(255, 0, 255, 0.1) 0%, transparent 50%),
radial-gradient(circle at 50% 50%, rgba(0, 255, 0, 0.05) 0%, transparent 50%);
pointer-events: none;
z-index: -1;
animation: backgroundPulse 8s ease-in-out infinite;
}
@keyframes backgroundPulse {
0%, 100% {
opacity: 0.3;
transform: scale(1);
}
50% {
opacity: 0.6;
transform: scale(1.05);
}
}
.neon-menu {
position: fixed;
top: 20px;
left: 50%;
transform: translateX(-50%);
z-index: 1000;
background: rgba(0, 0, 0, 0.8);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border: 2px solid #00ffff;
border-radius: 15px;
box-shadow:
0 0 20px #00ffff,
inset 0 0 20px rgba(0, 255, 255, 0.1),
0 0 40px rgba(0, 255, 255, 0.3);
transition: all 0.3s ease;
overflow: hidden;
}
.neon-menu:hover {
box-shadow:
0 0 30px #00ffff,
inset 0 0 30px rgba(0, 255, 255, 0.2),
0 0 60px rgba(0, 255, 255, 0.5);
border-color: #ff00ff;
}
.menu-container {
display: flex;
align-items: center;
padding: 15px 25px;
gap: 30px;
position: relative;
z-index: 2;
}
.brand {
display: flex;
align-items: center;
gap: 15px;
cursor: pointer;
transition: all 0.3s ease;
}
.brand-icon {
position: relative;
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
}
.neon-core {
width: 20px;
height: 20px;
background: #00ffff;
border-radius: 50%;
box-shadow:
0 0 10px #00ffff,
0 0 20px #00ffff,
0 0 30px #00ffff;
animation: coreGlow 2s ease-in-out infinite alternate;
}
.neon-ring {
position: absolute;
width: 35px;
height: 35px;
border: 2px solid #ff00ff;
border-radius: 50%;
animation: ringRotate 4s linear infinite;
box-shadow: 0 0 15px #ff00ff;
}
@keyframes coreGlow {
0% {
box-shadow:
0 0 10px #00ffff,
0 0 20px #00ffff,
0 0 30px #00ffff;
}
100% {
box-shadow:
0 0 15px #00ffff,
0 0 30px #00ffff,
0 0 45px #00ffff;
}
}
@keyframes ringRotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.brand-text {
font-size: 1.8rem;
font-weight: 900;
color: #00ffff;
text-shadow:
0 0 10px #00ffff,
0 0 20px #00ffff,
0 0 30px #00ffff;
animation: textFlicker 3s ease-in-out infinite;
transition: all 0.3s ease;
}
@keyframes textFlicker {
0%, 100% {
opacity: 1;
}
50% {
opacity: 0.8;
}
}
.brand:hover .brand-text {
color: #ff00ff;
text-shadow:
0 0 10px #ff00ff,
0 0 20px #ff00ff,
0 0 30px #ff00ff;
}
.menu-items {
display: flex;
list-style: none;
gap: 5px;
margin: 0;
padding: 0;
}
.menu-item {
position: relative;
}
.menu-link {
position: relative;
display: block;
color: #ffffff;
text-decoration: none;
font-weight: 700;
font-size: 0.9rem;
padding: 12px 20px;
border: 1px solid transparent;
border-radius: 8px;
transition: all 0.3s ease;
overflow: hidden;
text-transform: uppercase;
letter-spacing: 1px;
}
.neon-glow {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(45deg, #00ffff, #ff00ff, #00ff00);
opacity: 0;
border-radius: 8px;
transition: all 0.3s ease;
z-index: -1;
}
.link-text {
position: relative;
z-index: 2;
transition: all 0.3s ease;
}
.menu-link:hover {
color: #000000;
border-color: #00ffff;
box-shadow:
0 0 15px #00ffff,
inset 0 0 15px rgba(0, 255, 255, 0.2);
transform: translateY(-2px);
}
.menu-link:hover .neon-glow {
opacity: 1;
animation: glowPulse 1s ease-in-out infinite;
}
@keyframes glowPulse {
0%, 100% {
opacity: 0.8;
transform: scale(1);
}
50% {
opacity: 1;
transform: scale(1.05);
}
}
.menu-link:hover .link-text {
text-shadow:
0 0 5px #ffffff,
0 0 10px #ffffff;
}
.menu-toggle {
display: none;
}
.toggle-btn {
background: transparent;
border: 2px solid #00ffff;
padding: 10px;
cursor: pointer;
border-radius: 8px;
display: flex;
flex-direction: column;
gap: 3px;
transition: all 0.3s ease;
box-shadow: 0 0 10px #00ffff;
}
.toggle-line {
width: 20px;
height: 2px;
background: #00ffff;
border-radius: 1px;
transition: all 0.3s ease;
box-shadow: 0 0 5px #00ffff;
}
.toggle-btn:hover {
border-color: #ff00ff;
box-shadow: 0 0 15px #ff00ff;
}
.toggle-btn:hover .toggle-line {
background: #ff00ff;
box-shadow: 0 0 8px #ff00ff;
}
.toggle-btn.active .toggle-line:nth-child(1) {
transform: rotate(45deg) translate(5px, 5px);
}
.toggle-btn.active .toggle-line:nth-child(2) {
opacity: 0;
}
.toggle-btn.active .toggle-line:nth-child(3) {
transform: rotate(-45deg) translate(7px, -6px);
}
.neon-background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 1;
}
.grid-lines {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image:
linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
background-size: 20px 20px;
opacity: 0.3;
animation: gridMove 10s linear infinite;
}
@keyframes gridMove {
0% {
transform: translate(0, 0);
}
100% {
transform: translate(20px, 20px);
}
}
.floating-particles {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
.floating-particles::before,
.floating-particles::after {
content: '';
position: absolute;
width: 2px;
height: 2px;
background: #00ffff;
border-radius: 50%;
box-shadow: 0 0 5px #00ffff;
animation: particleFloat 6s linear infinite;
}
.floating-particles::before {
top: 20%;
left: 10%;
animation-delay: 0s;
}
.floating-particles::after {
top: 60%;
right: 15%;
animation-delay: 3s;
background: #ff00ff;
box-shadow: 0 0 5px #ff00ff;
}
@keyframes particleFloat {
0% {
transform: translateY(0) translateX(0);
opacity: 0;
}
10% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
transform: translateY(-20px) translateX(10px);
opacity: 0;
}
}
@media (max-width: 768px) {
.neon-menu {
top: 10px;
left: 10px;
right: 10px;
transform: none;
border-radius: 12px;
}
.menu-container {
padding: 12px 20px;
gap: 20px;
}
.menu-items {
display: none;
position: absolute;
top: 100%;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.9);
border: 2px solid #00ffff;
border-radius: 12px;
margin-top: 10px;
padding: 20px;
flex-direction: column;
gap: 10px;
box-shadow:
0 0 20px #00ffff,
inset 0 0 20px rgba(0, 255, 255, 0.1);
}
.menu-items.active {
display: flex;
}
.menu-toggle {
display: block;
margin-left: auto;
}
.menu-link {
padding: 15px 20px;
text-align: center;
border-radius: 8px;
}
.brand-text {
font-size: 1.5rem;
}
.neon-core {
width: 16px;
height: 16px;
}
.neon-ring {
width: 28px;
height: 28px;
}
}
@media (max-width: 480px) {
.menu-container {
padding: 10px 15px;
gap: 15px;
}
.brand-text {
font-size: 1.3rem;
}
.menu-link {
padding: 12px 16px;
font-size: 0.85rem;
}
.neon-core {
width: 14px;
height: 14px;
}
.neon-ring {
width: 24px;
height: 24px;
}
}
JavaScript
document.addEventListener('DOMContentLoaded', function() {
const menuToggle = document.getElementById('menuToggle');
const menuItems = document.querySelector('.menu-items');
const menuLinks = document.querySelectorAll('.menu-link');
const neonMenu = document.querySelector('.neon-menu');
// Configuración de efectos neón
const neonConfig = {
glitchDuration: 200,
scanlineSpeed: 2000,
particleCount: 15,
colorCycle: ['#00ffff', '#ff00ff', '#00ff00', '#ffff00']
};
// Toggle del menú móvil
if (menuToggle) {
menuToggle.addEventListener('click', function() {
this.classList.toggle('active');
menuItems.classList.toggle('active');
// Efecto de activación neón
if (menuItems.classList.contains('active')) {
createNeonBurst();
animateMenuItems('in');
} else {
animateMenuItems('out');
}
});
}
// Animación de elementos del menú
function animateMenuItems(direction) {
const items = menuItems.querySelectorAll('.menu-item');
items.forEach((item, index) => {
const delay = index * 100;
if (direction === 'in') {
setTimeout(() => {
item.style.opacity = '1';
item.style.transform = 'translateY(0) scale(1)';
createNeonGlow(item);
}, delay);
} else {
setTimeout(() => {
item.style.opacity = '0';
item.style.transform = 'translateY(-20px) scale(0.9)';
}, delay);
}
});
}
// Efectos de enlaces neón
menuLinks.forEach(link => {
link.addEventListener('click', function(e) {
e.preventDefault();
// Crear efecto de explosión neón
createNeonExplosion(this, e);
// Simular navegación
setTimeout(() => {
console.log('Navegando a:', this.querySelector('.link-text').textContent);
}, 300);
});
link.addEventListener('mouseenter', function() {
createScanline(this);
activateNeonEffect(this);
});
link.addEventListener('mouseleave', function() {
deactivateNeonEffect(this);
});
});
// Crear explosión neón
function createNeonExplosion(element, event) {
const rect = element.getBoundingClientRect();
const x = event.clientX - rect.left;
const y = event.clientY - rect.top;
for (let i = 0; i < 8; i++) {
const spark = document.createElement('div');
spark.style.position = 'absolute';
spark.style.left = x + 'px';
spark.style.top = y + 'px';
spark.style.width = '4px';
spark.style.height = '4px';
spark.style.background = neonConfig.colorCycle[i % neonConfig.colorCycle.length];
spark.style.borderRadius = '50%';
spark.style.pointerEvents = 'none';
spark.style.zIndex = '1000';
spark.style.boxShadow = `0 0 10px ${neonConfig.colorCycle[i % neonConfig.colorCycle.length]}`;
const angle = (Math.PI * 2 * i) / 8;
const distance = 30 + Math.random() * 20;
const endX = Math.cos(angle) * distance;
const endY = Math.sin(angle) * distance;
spark.style.transition = 'all 0.6s cubic-bezier(0.4, 0, 0.2, 1)';
element.appendChild(spark);
// Animar chispa
requestAnimationFrame(() => {
spark.style.transform = `translate(${endX}px, ${endY}px) scale(0)`;
spark.style.opacity = '0';
});
// Limpiar chispa
setTimeout(() => {
spark.remove();
}, 600);
}
}
// Crear línea de escaneo
function createScanline(element) {
const scanline = document.createElement('div');
scanline.style.position = 'absolute';
scanline.style.top = '0';
scanline.style.left = '-100%';
scanline.style.width = '100%';
scanline.style.height = '2px';
scanline.style.background = 'linear-gradient(90deg, transparent, #00ffff, transparent)';
scanline.style.pointerEvents = 'none';
scanline.style.zIndex = '10';
scanline.style.transition = 'left 0.5s ease';
scanline.style.boxShadow = '0 0 10px #00ffff';
element.appendChild(scanline);
// Animar línea de escaneo
setTimeout(() => {
scanline.style.left = '100%';
}, 50);
// Limpiar línea de escaneo
setTimeout(() => {
scanline.remove();
}, 550);
}
// Crear ráfaga neón
function createNeonBurst() {
const burst = document.createElement('div');
burst.style.position = 'absolute';
burst.style.top = '50%';
burst.style.left = '50%';
burst.style.width = '0';
burst.style.height = '0';
burst.style.background = 'radial-gradient(circle, #00ffff 0%, transparent 70%)';
burst.style.borderRadius = '50%';
burst.style.transform = 'translate(-50%, -50%)';
burst.style.pointerEvents = 'none';
burst.style.zIndex = '5';
burst.style.transition = 'all 0.8s cubic-bezier(0.4, 0, 0.2, 1)';
burst.style.boxShadow = '0 0 50px #00ffff';
neonMenu.appendChild(burst);
// Animar ráfaga
requestAnimationFrame(() => {
burst.style.width = '200px';
burst.style.height = '200px';
burst.style.opacity = '0';
});
// Limpiar ráfaga
setTimeout(() => {
burst.remove();
}, 800);
}
// Crear resplandor neón
function createNeonGlow(element) {
const glow = document.createElement('div');
glow.className = 'neon-glow-effect';
glow.style.position = 'absolute';
glow.style.top = '0';
glow.style.left = '0';
glow.style.width = '100%';
glow.style.height = '100%';
glow.style.background = 'linear-gradient(45deg, #00ffff, #ff00ff)';
glow.style.opacity = '0';
glow.style.borderRadius = '8px';
glow.style.filter = 'blur(5px)';
glow.style.pointerEvents = 'none';
glow.style.zIndex = '-1';
glow.style.transition = 'opacity 0.3s ease';
element.appendChild(glow);
// Animar resplandor
setTimeout(() => {
glow.style.opacity = '0.3';
}, 100);
// Limpiar resplandor
setTimeout(() => {
glow.style.opacity = '0';
setTimeout(() => glow.remove(), 300);
}, 2000);
}
// Activar efecto neón
function activateNeonEffect(element) {
const neonGlow = element.querySelector('.neon-glow');
if (neonGlow) {
neonGlow.style.animationDuration = '0.5s';
}
// Crear partículas neón
createNeonParticles(element);
}
// Desactivar efecto neón
function deactivateNeonEffect(element) {
const neonGlow = element.querySelector('.neon-glow');
const particles = element.querySelectorAll('.neon-particle');
if (neonGlow) {
neonGlow.style.animationDuration = '1s';
}
// Remover partículas
particles.forEach(particle => {
particle.style.opacity = '0';
setTimeout(() => particle.remove(), 200);
});
}
// Crear partículas neón
function createNeonParticles(element) {
const particleCount = 3;
for (let i = 0; i < particleCount; i++) {
setTimeout(() => {
const particle = document.createElement('div');
particle.className = 'neon-particle';
particle.style.position = 'absolute';
particle.style.width = '3px';
particle.style.height = '3px';
particle.style.background = neonConfig.colorCycle[i % neonConfig.colorCycle.length];
particle.style.borderRadius = '50%';
particle.style.pointerEvents = 'none';
particle.style.opacity = '0.8';
particle.style.zIndex = '5';
particle.style.boxShadow = `0 0 8px ${neonConfig.colorCycle[i % neonConfig.colorCycle.length]}`;
const startX = Math.random() * element.offsetWidth;
const startY = Math.random() * element.offsetHeight;
const endX = startX + (Math.random() - 0.5) * 40;
const endY = startY - 20 - Math.random() * 20;
particle.style.left = startX + 'px';
particle.style.top = startY + 'px';
particle.style.transition = 'all 1.5s cubic-bezier(0.4, 0, 0.2, 1)';
element.appendChild(particle);
// Animar partícula
requestAnimationFrame(() => {
particle.style.left = endX + 'px';
particle.style.top = endY + 'px';
particle.style.opacity = '0';
particle.style.transform = 'scale(1.5)';
});
// Limpiar partícula
setTimeout(() => {
particle.remove();
}, 1500);
}, i * 150);
}
}
// Efecto de glitch aleatorio
function createRandomGlitch() {
const elements = [neonMenu, ...menuLinks];
const randomElement = elements[Math.floor(Math.random() * elements.length)];
randomElement.style.filter = 'hue-rotate(180deg) saturate(2)';
randomElement.style.transform += ' skew(2deg, 0deg)';
setTimeout(() => {
randomElement.style.filter = 'none';
randomElement.style.transform = randomElement.style.transform.replace(' skew(2deg, 0deg)', '');
}, neonConfig.glitchDuration);
}
// Ciclo de colores automático
function startColorCycle() {
let colorIndex = 0;
setInterval(() => {
const currentColor = neonConfig.colorCycle[colorIndex];
const nextColor = neonConfig.colorCycle[(colorIndex + 1) % neonConfig.colorCycle.length];
// Actualizar color del borde del menú
neonMenu.style.borderColor = currentColor;
neonMenu.style.boxShadow = `
0 0 20px ${currentColor},
inset 0 0 20px ${currentColor}33,
0 0 40px ${currentColor}66
`;
colorIndex = (colorIndex + 1) % neonConfig.colorCycle.length;
}, 3000);
}
// Cerrar menú móvil al hacer clic fuera
document.addEventListener('click', function(e) {
if (!neonMenu.contains(e.target) && menuItems.classList.contains('active')) {
menuToggle.classList.remove('active');
menuItems.classList.remove('active');
animateMenuItems('out');
}
});
// Inicializar efectos
setTimeout(() => {
neonMenu.style.opacity = '1';
startColorCycle();
// Glitch aleatorio cada 10 segundos
setInterval(createRandomGlitch, 10000);
}, 100);
// Efecto de entrada inicial
neonMenu.style.opacity = '0';
neonMenu.style.transform = 'translateX(-50%) translateY(-20px)';
neonMenu.style.transition = 'all 0.8s cubic-bezier(0.4, 0, 0.2, 1)';
setTimeout(() => {
neonMenu.style.opacity = '1';
neonMenu.style.transform = 'translateX(-50%) translateY(0)';
createNeonBurst();
}, 200);
});