Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 32 additions & 6 deletions landing.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ document.addEventListener("DOMContentLoaded", function () {
});
}

function scrollToHowItWorks() {
document.getElementById("how-it-works").scrollIntoView({
behavior: "smooth",
});
}

// Add scroll effect to navigation
window.addEventListener("scroll", function () {
const nav = document.querySelector(".landing-nav");
Expand Down Expand Up @@ -69,6 +75,20 @@ document.addEventListener("DOMContentLoaded", function () {
}
});
});

// Add event listeners for anchor links to prevent default and smooth scroll
document.querySelectorAll('a[href="#features"]').forEach((el) => {
el.addEventListener("click", (e) => {
e.preventDefault();
scrollToFeatures();
});
});
document.querySelectorAll('a[href="#how-it-works"]').forEach((el) => {
el.addEventListener("click", (e) => {
e.preventDefault();
scrollToHowItWorks();
});
});
});
// Animated counters for stats
function animateCounter(el) {
Expand Down Expand Up @@ -123,9 +143,15 @@ function validateEmail(email) {
return re.test(email);
}

// Add to global scope for inline onclick handlers
window.scrollToFeatures = function () {
document.getElementById("features").scrollIntoView({
behavior: "smooth",
});
};
// Add to global scope for inline onclick handlers
window.scrollToFeatures = function () {
document.getElementById("features").scrollIntoView({
behavior: "smooth",
});
};

window.scrollToHowItWorks = function () {
document.getElementById("how-it-works").scrollIntoView({
behavior: "smooth",
});
};