codecraft-nexus / script.js
jsaplication's picture
ficou muito simples quero algo na pegada top mesmo parrecido com o site oficial do nodejs, algo bem bonito, e limpo]
af0b858 verified
raw
history blame contribute delete
607 Bytes
// 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'
});
});
});
// Form submission handling
const contactForm = document.querySelector('form');
if (contactForm) {
contactForm.addEventListener('submit', (e) => {
e.preventDefault();
alert('Mensagem enviada com sucesso! Entraremos em contato em breve.');
contactForm.reset();
});
}