-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkontakt.js
30 lines (25 loc) · 890 Bytes
/
kontakt.js
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
document.getElementById('contactForm').addEventListener('submit', function(e) {
e.preventDefault();
// Animacija za dugme
const button = this.querySelector('button');
button.style.transform = 'scale(0.95)';
setTimeout(() => {
button.style.transform = 'scale(1)';
}, 200);
// Ovde možete dodati logiku za slanje forme
alert('Poruka je uspešno poslata!');
this.reset();
});
// Animacija za info-items pri scroll-u
const infoItems = document.querySelectorAll('.info-item');
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.style.transform = 'translateX(0)';
entry.target.style.opacity = '1';
}
});
}, { threshold: 0.5 });
infoItems.forEach(item => {
observer.observe(item);
});