-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
44 lines (34 loc) · 861 Bytes
/
index.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const faders = document.querySelectorAll(".fade-in");
const sliders = document.querySelectorAll(".slide-in");
const appearOptions = {
threshold: 0,
rootMargin: "0px 0px -200px 0px",
};
const appearOnScroll = new IntersectionObserver(function (
entries,
appearOnScroll
) {
entries.forEach((entry) => {
if (!entry.isIntersecting) {
return;
} else {
entry.target.classList.add("appear");
appearOnScroll.unobserve(entry.target);
}
});
},
appearOptions);
faders.forEach((fader) => {
appearOnScroll.observe(fader);
});
sliders.forEach((slider) => {
appearOnScroll.observe(slider);
});
function submitForm() {
const form = document.getElementsByName("contact-form")[0];
const popUp = document.querySelector(".pop-up-window");
form.submit();
form.reset();
popUp.classList.add("show");
return false;
}