-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
97 lines (83 loc) · 2.89 KB
/
script.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
86
87
88
89
90
91
92
93
94
95
96
97
function onScroll(event) {
let offset = window.scrollY;
if (offset + 60 > window.innerHeight) {
document.getElementsByTagName("nav")[0].style.backgroundColor = "#ffffff";
$("body").get(0).style.setProperty("--link-color", "black");
$("body").get(0).style.setProperty("--underline", "black");
}
else {
if (offset + 60 > window.innerHeight / 2 && location.pathname != "/" && location.pathname != "/index.html") {
document.getElementsByTagName("nav")[0].style.backgroundColor = "#ffffff";
$("body").get(0).style.setProperty("--link-color", "black");
$("body").get(0).style.setProperty("--underline", "black");
}
else {
document.getElementsByTagName("nav")[0].style.backgroundColor = "#00000000"
$("body").get(0).style.setProperty("--link-color", "white");
$("body").get(0).style.setProperty("--underline", "white");
}
}
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 = 200;
if (elementTop < windowHeight - elementVisible) {
reveals[i].classList.add("active");
} else {
reveals[i].classList.remove("active");
}
}
}
function checkSponsors() {
var imgs = document.querySelectorAll('.img-container')
var delay = 250;
if (document.querySelectorAll('.img-container')[0].classList.contains('active')) {
setTimeout(function () {
imgs[1].classList.remove('hidden')
setTimeout(function () {
imgs[2].classList.remove('hidden')
setTimeout(function () {
imgs[3].classList.remove('hidden')
setTimeout(function () {
imgs[4].classList.remove('hidden')
setTimeout(function () {
imgs[5].classList.remove('hidden')
}, delay);
}, delay);
}, delay);
}, delay);
}, delay);
}
else {
imgs[1].classList.add('hidden')
imgs[2].classList.add('hidden')
imgs[3].classList.add('hidden')
imgs[4].classList.add('hidden')
imgs[5].classList.add('hidden')
}
}
function wait(ms) {
return new Promise(res => setTimeout(res, ms));
}
document.addEventListener('DOMContentLoaded', function () {
document.addEventListener('scroll', onScroll);
onScroll();
logoResize();
// var h50Pages = document.querySelectorAll('.h-50-page');
// h50Pages.forEach(function (page) {
// page.addEventListener('click', function (e) {
// window.scrollTo({
// top: 0,
// behavior: 'smooth'
// });
// e.preventDefault();
// $('#introCarousel').css('height', '50vh');
// $('.carousel-item').css('height', '50vh');
// $('.carousel-inner').css('height', '50vh');
// var link = this.href
// setTimeout(function() {
// window.location.href = link;
// }, 1250); });
// });
});