-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappProva.js
More file actions
40 lines (34 loc) · 1.28 KB
/
appProva.js
File metadata and controls
40 lines (34 loc) · 1.28 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
// da forbice a prima sezione
const moma = document.querySelector("#moma-left");
const tate = document.querySelector("#tate-right");
const scissor = document.querySelector("#big-scissor");
const line = document.querySelector("#dott-line");
const logo = document.querySelector("#intro-logo");
const secId0 = document.querySelector("#s-introduction");
const sectionIntro = document.querySelector("#section1");
const sectionIntroOptions = {
root: null,
threshold: 0.25,
rootMargin: "-100px"
};
const sectionIntroObserver = new IntersectionObserver(function(
entries,
sectionIntroObserver) {
entries.forEach(entry => {
if(entry.isIntersecting) {
moma.classList.toggle("moma-animated");
tate.classList.toggle("tate-animated");
scissor.classList.toggle("tiny-scissor");
line.classList.toggle("dott-line-animated");
secId0.classList.toggle("show");
} else {
moma.classList.remove("moma-animated");
tate.classList.remove("tate-animated");
scissor.classList.remove("tiny-scissor");
line.classList.remove("dott-line-animated");
secId0.classList.remove("show");
}
});
},
sectionIntroOptions);
sectionIntroObserver.observe(sectionIntro);