Skip to content

Commit

Permalink
Update app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
l4ven authored Sep 20, 2023
1 parent 0916fc9 commit 283aeb8
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
const movePage = (name) => {
const el = document.getElementById(name);
if (!el) return;
el.scrollIntoView({ behavior: "smooth" });
const mp = document.getElementById(name);
if (!mp) return;
mp.scrollIntoView({ behavior: "smooth" });
};

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);

0 comments on commit 283aeb8

Please sign in to comment.