-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
31 lines (27 loc) · 991 Bytes
/
script.js
File metadata and controls
31 lines (27 loc) · 991 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
27
28
29
30
31
document.addEventListener('DOMContentLoaded', () => {
const addTaskBtn = document.getElementById('addTaskBtn');
const signUpBtn = document.getElementById('signUpBtn');
if (addTaskBtn) {
addTaskBtn.addEventListener('click', () => {
document.getElementById('taskList').scrollIntoView({ behavior: 'smooth' });
});
}
if (signUpBtn) {
signUpBtn.addEventListener('click', () => {
document.getElementById('pricing').scrollIntoView({ behavior: 'smooth' });
});
}
const animatedSections = document.querySelectorAll('section, main, footer');
const observer = new IntersectionObserver(entries => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('visible');
observer.unobserve(entry.target);
}
});
}, { threshold: 0.1 });
animatedSections.forEach(section => {
section.classList.add('animate-on-scroll');
observer.observe(section);
});
});