Files
pflores.linkedcorp.net/frontend/lumina-cv-theme/assets/js/theme.js
T
codeuploader 5846c515f3 feat: sitio CV completo v1.0.0
- 4 temas WordPress: persona-cv (activo), lumina, apex-cv, cvolio
- Plugin pflores-cv-fields con CMB2 (100% gratuito) — admin editable
- Generador PDF dinámico con Chromium headless (?cv_pdf=1)
- Datos del CV de Patricia Flores cargados en CMB2
- URL dinámica con soporte proxy SSL (NPM/X-Forwarded-Proto)
- WP Mail SMTP instalado (pendiente config SMTP)
- Documentación completa: PROMPT_IA.md, DEPLOY_WEB.md, PRODUCCION.md, VERSIONADO.md
2026-06-05 11:21:30 -05:00

61 lines
1.8 KiB
JavaScript

document.addEventListener("DOMContentLoaded", () => {
const toggle = document.querySelector(".lm-nav-toggle");
const nav = document.querySelector(".lm-nav");
if (toggle && nav) {
toggle.addEventListener("click", () => {
const expanded = toggle.getAttribute("aria-expanded") === "true";
toggle.setAttribute("aria-expanded", String(!expanded));
nav.classList.toggle("is-open", !expanded);
});
document.addEventListener("click", (e) => {
if (!nav.contains(e.target) && !toggle.contains(e.target)) {
nav.classList.remove("is-open");
toggle.setAttribute("aria-expanded", "false");
}
});
}
document.querySelectorAll("[data-lumina-print]").forEach((btn) => {
btn.addEventListener("click", () => window.print());
});
const header = document.querySelector(".lm-header");
if (header) {
let lastY = window.scrollY;
window.addEventListener("scroll", () => {
const currentY = window.scrollY;
if (currentY > 80) {
header.style.boxShadow = "0 2px 16px rgba(0,0,0,.12)";
} else {
header.style.boxShadow = "";
}
lastY = currentY;
}, { passive: true });
}
const sections = document.querySelectorAll("[id]");
const navLinks = document.querySelectorAll(".lm-nav__list a[href^='#']");
if (navLinks.length && sections.length) {
const observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
navLinks.forEach((link) => {
link.classList.toggle(
"is-active",
link.getAttribute("href") === `#${entry.target.id}`
);
});
}
});
},
{ rootMargin: "-20% 0px -70% 0px" }
);
sections.forEach((section) => observer.observe(section));
}
});