diff --git a/public/assets/js/navigation.js b/public/assets/js/navigation.js index d58fe13..ecbbe09 100644 --- a/public/assets/js/navigation.js +++ b/public/assets/js/navigation.js @@ -3,11 +3,6 @@ */ const parallaxElems = document.querySelectorAll('.parallax'); -/** - * @type {NodeListOf} - */ -const navlinks = document.querySelectorAll('a.nav-link'); - /** * @type {NodeListOf} */ @@ -31,29 +26,6 @@ window.addEventListener('scroll', () => parallaxElem.style.top = `${(windowScroll - parentScroll) / 4}px`; }); - - // Highlight menu item when scrolled to section. - let current = ''; - sections.forEach(section => - { - const rect = section.getBoundingClientRect(); - const sectionTop = rect.top + window.scrollY; - - if (window.scrollY >= sectionTop - 70) - { - current = section.getAttribute('id'); - } - }); - - navlinks.forEach(link => - { - link.classList.remove('active'); - - if (link.getAttribute('href') === `#${current}`) - { - link.classList.add('active'); - } - }); }); sections.forEach(section =>