Update variables name
This commit is contained in:
parent
1d0d83b24e
commit
513a975459
|
|
@ -8,17 +8,17 @@ const intercept = document.createElement("div");
|
|||
intercept.setAttribute("data-observer-intercept", "");
|
||||
header.before(intercept);
|
||||
|
||||
const observer2 = new IntersectionObserver(([entry]) => {
|
||||
const observer = new IntersectionObserver(([entry]) => {
|
||||
header.classList.toggle("scroll", !entry.isIntersecting);
|
||||
});
|
||||
|
||||
observer2.observe(intercept);
|
||||
observer.observe(intercept);
|
||||
|
||||
// Update navigation according to page scroll
|
||||
const options = {
|
||||
rootMargin: '0px 0px -60% 0px'
|
||||
};
|
||||
const observer = new IntersectionObserver(entries => {
|
||||
const sectionObserver = new IntersectionObserver(entries => {
|
||||
entries.forEach(entry => {
|
||||
const id = entry.target.getAttribute("id");
|
||||
if (entry.isIntersecting) {
|
||||
|
|
@ -34,7 +34,7 @@ const observer = new IntersectionObserver(entries => {
|
|||
},options);
|
||||
|
||||
document.querySelectorAll('section').forEach(function(section, i) {
|
||||
observer.observe(section);
|
||||
sectionObserver.observe(section);
|
||||
});
|
||||
|
||||
// Random accent font & color
|
||||
|
|
|
|||
Loading…
Reference in a new issue