invitecraft-studio / script.js
andazevedo's picture
Crie um design para um aplicativo de criação de convites para eventos.
5420716 verified
// Simple animations for interactive elements
document.addEventListener('DOMContentLoaded', function() {
// Add hover effect to buttons
const buttons = document.querySelectorAll('a[href], button');
buttons.forEach(button => {
button.addEventListener('mouseenter', () => {
button.classList.add('transform', 'scale-105', 'transition', 'duration-300');
});
button.addEventListener('mouseleave', () => {
button.classList.remove('transform', 'scale-105');
});
});
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function(e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
window.scrollTo({
top: target.offsetTop - 80,
behavior: 'smooth'
});
}
});
});
});