-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
44 lines (37 loc) · 1.06 KB
/
Copy pathindex.html
File metadata and controls
44 lines (37 loc) · 1.06 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
41
42
43
44
---
layout: compress
---
<!DOCTYPE html>
<html>
{% include head.html %}
<body>
{% include navbar.html %}
{% include showcase.html %}
{% include about.html %}
<!-- {% include cfp.html %} -->
{% include schedule.html %}
{% include people.html %}
{% include participant.html %}
<!--Footer begins here-->
{% include footer.html %}
</body>
<script>
var navItems = document.getElementsByClassName('navbar-item');
var heroes = document.getElementsByClassName('hero');
const viewOffset = 200;
window.addEventListener("scroll", function (event) {
var scroll = this.scrollY;
var position = window.pageYOffset;
for (var i = 0; i < navItems.length; i++) {
navItems[i].classList.remove('is-active');
}
for (var i = 0; i < heroes.length; i++) {
var sectionTop = heroes[i].offsetTop-viewOffset;
var sectionBottom = heroes[i].offsetTop + heroes[i].offsetHeight-viewOffset;
if (scroll >= sectionTop && scroll < sectionBottom) {
navItems[i+1].classList.add('is-active');
}
}
});
</script>
</html>