diff --git a/src/components/informe/informe.astro b/src/components/informe/informe.astro index 44bd344..24cc5f3 100644 --- a/src/components/informe/informe.astro +++ b/src/components/informe/informe.astro @@ -35,7 +35,7 @@ import { Icon } from "astro-icon/components"; left: 0; width: 100vw; height: 100vh; - background: rgba(0, 0, 0, 0.9); + background: rgba(0, 0, 0, 0.99); color: white; font-size: 2rem; z-index: 9999; @@ -80,7 +80,28 @@ import { Icon } from "astro-icon/components"; initReveal(); } //else deck.destroy(); }); + deck.on("slidechanged", () => { + const slideId = deck.getCurrentSlide().id; + if (slideId) window.location.hash = "/" + slideId; + highlightLinks(); + }); + // deck.addEventListener("ready", function (event) { // deck.slide(2, 7); //go to slide horizontal / vertical // }); + + function highlightLinks() { + const allLinks = document.querySelectorAll(".links-subnavbar"); + const active = allLinks[deck.getIndices().h]; + + allLinks.forEach((el) => { + el?.parentElement?.classList.remove("bg-primary-500"); + el?.parentElement?.classList.remove("text-white"); + }); + + if (active) { + active?.parentElement?.classList.add("bg-primary-500"); + active?.parentElement?.classList.add("text-white"); + } + } diff --git a/src/components/informe/item-slider/caratula.astro b/src/components/informe/item-slider/caratula.astro index c8950c9..ddf442b 100644 --- a/src/components/informe/item-slider/caratula.astro +++ b/src/components/informe/item-slider/caratula.astro @@ -9,7 +9,7 @@ import silent from "../../../assets/silent.png";