-
Notifications
You must be signed in to change notification settings - Fork 0
/
javascript.js
34 lines (28 loc) · 1.11 KB
/
javascript.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
window.onscroll = function () {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 95 || document.documentElement.scrollTop > 95) {
document.getElementById("n-1").style.background = "#151515e4";
document.getElementById("n-1").style.transition = "0.4s";
} else {
document.getElementById("n-1").style.background = "transparent";
}
}
function reveal() {
var reveals = document.querySelectorAll(".reveal");
for (var i = 0; i < reveals.length; i++) {
var windowHeight = window.innerHeight;
var elementTop = reveals[i].getBoundingClientRect().top;
var elementVisible = 150;
if (elementTop < windowHeight - elementVisible) {
reveals[i].classList.add("active");
} else {
reveals[i].classList.remove("active");
}
}
}
window.addEventListener("scroll", reveal);
const phoneInputField = document.querySelector("#phone");
const phoneInput = window.intlTelInput(phoneInputField, {
utilsScript:
"https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/js/utils.js",
});