Skip to content

Commit

Permalink
fix stop-scrolling functionally
Browse files Browse the repository at this point in the history
  • Loading branch information
Hetari committed Jul 20, 2024
1 parent a2b9a65 commit 3bcf381
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<!-- Basic Meta Tags -->
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0," />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<meta name="description"
content="Ebraheem Alhetari - A freelance who is experienced in full-Stack Developer helping startups all around the world gain their unfair advantage">
<meta name="keywords"
Expand Down
10 changes: 10 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
};
onMounted(async () => {
document.body.classList.add('stop-scrolling');
window.scrollTo(0, 0);
setTimeout(() => {
requestAnimationFrame(raf);
}, 2000);
Expand All @@ -78,3 +81,10 @@
}
});
</script>

<style>
.stop-scrolling #app {
max-height: 100dvh !important;
overflow: hidden;
}
</style>
7 changes: 4 additions & 3 deletions src/animations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gsap.registerPlugin(MotionPathHelper);

const animateSplitText = (
id: string,
textId: string = '',
textId: string,
duration: number = 0.8,
stagger: number = 0.005,
delay: number = 0,
Expand Down Expand Up @@ -217,9 +217,10 @@ const animateLoadingPath = (path: Ref<SVGPathElement>, targetPath: string) => {
gsap.set('#loading-screen', { display: 'none' });
},
onStart: () => {
window.scrollTo(0, 0);
setTimeout(() => {
animateHeroNav();
document.body.classList.remove('stop-scrolling');
window.scrollTo(0, 0);
}, 250);
},
},
Expand Down Expand Up @@ -288,7 +289,7 @@ const animateHeroNav = () => {
ease: 'power4.inOut',
});

animateSplitText('#whoAmI .letters');
animateSplitText('#whoAmI .letters', '#whoAmI .letters');

gsap.to(['#location', '#art'], {
opacity: 1,
Expand Down

0 comments on commit 3bcf381

Please sign in to comment.