-
Notifications
You must be signed in to change notification settings - Fork 0
/
javascript.js
85 lines (82 loc) · 2.44 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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");
}
}
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function sleep1(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function load() {
sleep(100).then(() => {
element = document.getElementById("loaded")
element.className = "container reveal active"
})
}
function load1() {
sleep(4000).then(() => {
element = document.getElementById("loaded1")
element.classList = "arrows active"
})
}
function load3() {
var el = document.querySelector("#toggle")
el.checked = false;
load2()
}
function load2() {
var el = document.querySelector("#toggle")
if (el.checked == true){
var elem = document.querySelectorAll("section")
elem.forEach(element => {
element.style.display = "none"
});
$(".footerPhone").css("display", "none")
}
else{
var elem = document.querySelectorAll("section")
elem.forEach((element, index) => {
element.style.display = "flex"
});
$(".footerPhone").css("display", "flex")
}
}
function reply_click(clicked_id){
var toRevokeSelector = document.querySelector(".checked")
toRevokeSelector.classList.remove("checked")
var toRevoke = document.querySelector(".choiceText.mid.active")
toRevoke.classList.remove("active")
toRevoke.classList.remove("mid")
var toAddText = document.getElementById("t"+clicked_id)
toAddText.classList.add("mid")
sleep(50).then(() => {
toAddText.classList.add("active")
})
var toAddSelector = $("#"+clicked_id).parent().find(".underlineElement")
$(toAddSelector).toggleClass("checked")
}
$(document).ready(function(){
function displayLogo(){
sleep(5650).then(() => {
$(".base").addClass("active")
$(".toAppear").addClass("active")
})
}
function applyChecked(){
$(".underlineElement:first").toggleClass("checked")
}
applyChecked()
displayLogo()
})
// window.addEventListener("click", load2)
window.addEventListener("scroll", reveal);