Add menu highlighting logic via HX-Trigger, update templates for dynamic menu state management, and extend mixins to support menu highlighting.
This commit is contained in:
@@ -116,6 +116,13 @@
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
document.body.addEventListener("menuHighlight", (event) => {
|
||||
const active = event.detail.value;
|
||||
document.querySelectorAll(".menu-item").forEach(el => {
|
||||
el.classList.toggle("menu-active", el.dataset.menu === active);
|
||||
});
|
||||
});
|
||||
|
||||
{% comment %}// Shrinking navbar on scroll
|
||||
const navbar = document.getElementById("mainNavbar");
|
||||
let lastScroll = 0; window.addEventListener("scroll", () => {
|
||||
|
||||
Reference in New Issue
Block a user