-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
26 lines (24 loc) · 747 Bytes
/
Copy pathscript.js
File metadata and controls
26 lines (24 loc) · 747 Bytes
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
const observer = new IntersectionObserver((entries) => {
entries.forEach((entry, i) => {
if (entry.isIntersecting) {
setTimeout(() => {
entry.target.classList.add('visible');
}, 80 * i);
observer.unobserve(entry.target);
}
});
}, { threshold: 0.12 });
document.querySelectorAll('.fade-up').forEach(el => observer.observe(el));
function handleSubmit(e) {
e.preventDefault();
const btn = e.target.querySelector('.form-submit');
btn.textContent = 'Terkirim! ✓';
btn.style.background = '#8A9E7F';
btn.disabled = true;
setTimeout(() => {
btn.textContent = 'Kirim Pesan →';
btn.style.background = '';
btn.disabled = false;
e.target.reset();
}, 3000);
}