const LOGO_SVG = ` `; function runSalvaguarda() { const initIcons = () => { if ((window as any).lucide) { (window as any).lucide.createIcons(); } }; const renderLogos = () => { const mainLogo = document.getElementById('main-logo'); const heroLogo = document.getElementById('hero-logo'); if (mainLogo) mainLogo.innerHTML = LOGO_SVG; if (heroLogo) heroLogo.innerHTML = LOGO_SVG; }; function handleNavigation() { const hash = window.location.hash.replace('#', '') || 'home'; const sections = document.querySelectorAll('.view-content'); sections.forEach(s => s.classList.add('section-hidden')); const activeSection = document.getElementById(`view-${hash}`); if (activeSection) { activeSection.classList.remove('section-hidden'); } else { document.getElementById('view-home')?.classList.remove('section-hidden'); } // Reiniciar iconos de Lucide tras cambiar de sección setTimeout(initIcons, 10); } // Escuchar cambios de hash para navegación instantánea window.addEventListener('hashchange', handleNavigation); // Ejecución inicial renderLogos(); handleNavigation(); initIcons(); } // Iniciar al cargar el DOM if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', runSalvaguarda); } else { runSalvaguarda(); }