Flatlogic Bot da6d9c1c3d V1.0
2025-10-04 22:04:47 +00:00

24 lines
762 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');
contactForm.addEventListener('submit', function(event) {
if (!contactForm.checkValidity()) {
event.preventDefault();
event.stopPropagation();
}
contactForm.classList.add('was-validated');
}, false);
});