Spaces:
Running
Running
File size: 1,535 Bytes
3c730d3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | document.addEventListener('DOMContentLoaded', function() {
// Initialize Feather Icons
feather.replace();
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const targetId = this.getAttribute('href');
if (targetId === '#') return;
const targetElement = document.querySelector(targetId);
if (targetElement) {
targetElement.scrollIntoView({
behavior: 'smooth'
});
}
});
});
// Mobile menu toggle functionality will be handled by navbar component
});
// Function to handle sign up forms
function handleSignUp(formId, successMessage) {
const form = document.getElementById(formId);
if (form) {
form.addEventListener('submit', function(e) {
e.preventDefault();
// Here you would typically send the form data to your server
alert(successMessage || 'Thank you for signing up! We will be in touch soon.');
form.reset();
});
}
}
// Initialize form handlers when DOM is loaded
document.addEventListener('DOMContentLoaded', function() {
handleSignUp('business-signup', 'Thank you for your interest! Our team will contact you shortly.');
handleSignUp('affiliate-signup', 'Welcome to our affiliate network! Check your email for next steps.');
}); |