-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
25 lines (23 loc) · 822 Bytes
/
script.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
let animate = (entries, observer) => {
entries.forEach(entry => {
console.log(entry.target);
if (entry.isIntersecting) {
console.log("Starting Animation!");
let elem = entry.target;
elem.classList.add('start')
}
})
};
let options = {
root: null,
threshold: 0.75,
}
let observer = new IntersectionObserver(animate, options)
observer.observe(document.getElementById('python'));
observer.observe(document.getElementById('dash'));
observer.observe(document.getElementById('html'));
observer.observe(document.getElementById('css'));
observer.observe(document.getElementById('javascript'));
observer.observe(document.getElementById('react'));
observer.observe(document.getElementById('nodejs'));
observer.observe(document.getElementById('mongodb'));