first
This commit is contained in:
11
main.js
Normal file
11
main.js
Normal file
@@ -0,0 +1,11 @@
|
||||
// Fade in elements as they scroll into view
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
for (const entry of entries) {
|
||||
if (entry.isIntersecting) {
|
||||
entry.target.classList.add('visible');
|
||||
observer.unobserve(entry.target);
|
||||
}
|
||||
}
|
||||
}, { threshold: 0.1 });
|
||||
|
||||
document.querySelectorAll('section').forEach((el) => observer.observe(el));
|
||||
Reference in New Issue
Block a user