-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
41 lines (36 loc) · 1.35 KB
/
script.js
File metadata and controls
41 lines (36 loc) · 1.35 KB
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
32
33
34
35
36
37
38
39
40
41
// Observer for elements with classes 'cursor_supercharge', 'cursor_community', and 'cursor_ai'
document.addEventListener("DOMContentLoaded", function() {
const observerOptions = {
threshold: 0.1 // Adjust this value if needed
};
const observer = new IntersectionObserver(entries => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('in-view');
}
});
}, observerOptions);
const elementsToObserve = document.querySelectorAll('.cursor_supercharge, .cursor_community, .cursor_ai');
elementsToObserve.forEach(element => {
observer.observe(element);
});
});
// Observer for elements with the class 'layout292_item'
document.addEventListener("DOMContentLoaded", function() {
const observerOptions = {
threshold: 0.1 // Adjust this value if needed
};
const observer = new IntersectionObserver(entries => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.remove('in-view');
} else {
entry.target.classList.add('in-view');
}
});
}, observerOptions);
const elementsToObserve = document.querySelectorAll('.layout292_item');
elementsToObserve.forEach(element => {
observer.observe(element);
});
});