diff --git a/public/assets/css/style.css b/public/assets/css/style.css index 47424a5..d67d35d 100644 --- a/public/assets/css/style.css +++ b/public/assets/css/style.css @@ -67,7 +67,6 @@ footer > div > p { .scroll_container { overflow-y: auto; scroll-snap-type: y mandatory; - scroll-padding-top: 100px; } .scroll_section { @@ -76,7 +75,6 @@ footer > div > p { display: flex; flex-direction: column; align-items: center; - scroll-margin-top: 100px; } .scroll_section > h1 { diff --git a/public/assets/js/index.js b/public/assets/js/index.js index 97cb712..b7c79da 100644 --- a/public/assets/js/index.js +++ b/public/assets/js/index.js @@ -10,9 +10,6 @@ document.addEventListener('DOMContentLoaded', () => { function setupNavigationHighlight() { const sections = document.querySelectorAll('.scroll_section'); const navOptions = document.querySelectorAll('.nav_option'); - const header = document.querySelector('header'); - const headerHeight = header ? header.offsetHeight : 0; - const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { @@ -24,17 +21,13 @@ function setupNavigationHighlight() { } }); }, { - threshold: 0.7, - rootMargin: `-${headerHeight}px 0px -40% 0px` + threshold: 0.5 }); sections.forEach(section => observer.observe(section)); } function setupNavigationClicks() { - const header = document.querySelector('header'); - const headerHeight = header ? header.offsetHeight : 0; - document.querySelectorAll('.nav_option').forEach(link => { link.addEventListener('click', (event) => { event.preventDefault(); @@ -42,9 +35,7 @@ function setupNavigationClicks() { const targetId = link.getAttribute('href'); const targetSection = document.querySelector(targetId); if (targetSection) { - const targetPosition = targetSection.getBoundingClientRect().top + window.pageYOffset - headerHeight; - window.scrollTo({ - top: targetPosition, + targetSection.scrollIntoView({ behavior: 'smooth' }); }