Flatlogic Bot df1297b91e Draft
2025-10-13 22:35:33 +00:00

26 lines
801 B
JavaScript

document.addEventListener('DOMContentLoaded', function () {
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
// Contact form validation
const contactForm = document.getElementById('contactForm');
if (contactForm) {
contactForm.addEventListener('submit', function (e) {
if (!contactForm.checkValidity()) {
e.preventDefault();
e.stopPropagation();
}
contactForm.classList.add('was-validated');
});
}
});