Skip to content

Commit

Permalink
🚧 Function pof not here
Browse files Browse the repository at this point in the history
  • Loading branch information
Funasitien authored Oct 23, 2024
1 parent e924c28 commit 2f489a7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/pages/dj.astro
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ import Layout from "../layouts/main.astro";
}
});

function getCurrentSection() {
const sections = document.querySelectorAll('.snap-start');
for (const section of sections) {
const rect = section.getBoundingClientRect();
if (rect.top >= 0 && rect.bottom <= window.innerHeight) {
return section;
}
}
return null;
}

function scrollToNextSection() {
const currentSection = getCurrentSection();
if (currentSection) {
Expand Down

0 comments on commit 2f489a7

Please sign in to comment.