Skip to content

Commit

Permalink
Fixed more scrolling issues in about-me
Browse files Browse the repository at this point in the history
  • Loading branch information
DugarRishab committed Mar 18, 2022
1 parent df807d5 commit a628694
Showing 1 changed file with 34 additions and 33 deletions.
67 changes: 34 additions & 33 deletions style.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,44 +263,45 @@ const scrollingEffectOnHome = () => {
const projectsToken = document.querySelector(".projects-bg");

window.addEventListener("scroll", (e) => {
console.log("scrolling");

if (body.classList.contains("home")) {
console.log("scrolling");

e.preventDefault();
console.log(window.scrollY);

if (window.scrollY > 50) {
menuItems.forEach(item => {
item.classList.remove("active");
});
aboutBtn.classList.add("active");

aboutToken.style.animation = `blob-expand-animation ${loadingTime}ms 1`;

setTimeout(() => {

body.classList.remove(...body.classList);
body.classList.add("about-me");
window.scrollTo(0, 0);

}, loadingTime * 2 / 3);
setTimeout(() => {

homePage.classList.remove('active');
projectsPage.classList.remove('active');
aboutToken.style.animation = "";
e.preventDefault();
console.log(window.scrollY);

if (window.scrollY > 50) {
menuItems.forEach(item => {
item.classList.remove("active");
});
aboutBtn.classList.add("active");

}, loadingTime * 4 / 5);
setTimeout(() => {

aboutPage.classList.add('active');

aboutToken.style.animation = `blob-expand-animation ${loadingTime}ms 1`;

}, loadingTime * 5 / 5);
}
setTimeout(() => {

body.classList.remove(...body.classList);
body.classList.add("about-me");
window.scrollTo(0, 0);

}, loadingTime * 2 / 3);
setTimeout(() => {

homePage.classList.remove('active');
projectsPage.classList.remove('active');
aboutToken.style.animation = "";

}, loadingTime * 4 / 5);
setTimeout(() => {

aboutPage.classList.add('active');


}, loadingTime * 5 / 5);
}
}

},{
passive: false
});
}

}

0 comments on commit a628694

Please sign in to comment.