initial commit

This commit is contained in:
2026-07-21 09:47:16 +07:00
commit 3973d98bc4
289 changed files with 41430 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
function initScrollSpy() {
const observer = new IntersectionObserver(function (entries) {
entries.forEach(function (e) {
if (e.isIntersecting) {
document.querySelectorAll('.nav-link').forEach(function (l) { l.classList.remove('active'); });
var el = document.querySelector('.nav-link[href="#' + e.target.id + '"]');
if (el) el.classList.add('active');
}
});
}, { rootMargin: '-80px 0px -50% 0px' });
document.querySelectorAll('section[id]').forEach(function (s) { observer.observe(s); });
}