Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 38 additions & 8 deletions web/src/app/(root)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

useEffect(() => {
setHomePageHover(null);
}, []);

Check warning on line 45 in web/src/app/(root)/page.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'setHomePageHover'. Either include it or remove the dependency array

const shouldRunIntro = useMemo(() => {
return !introAlreadyPlayed;
Expand Down Expand Up @@ -82,6 +82,8 @@
}, [loading]);

const mainLayerRef = useRef<HTMLDivElement>(null);
const secondLayerRef = useRef<HTMLDivElement>(null);
const thirdLayerRef = useRef<HTMLDivElement>(null);
const pinWrapRef = useRef<HTMLDivElement>(null);
const scrollProgressRef = useRef(0);

Expand All @@ -92,42 +94,70 @@

const ctx = gsap.context(() => {
gsap.set(mainLayerRef.current, { clipPath: 'inset(0% 0% 0% 0%)' });
gsap.set(secondLayerRef.current, { clipPath: 'inset(0% 0% 0% 0%)' });
gsap.set(thirdLayerRef.current, { clipPath: 'inset(0% 0% 0% 0%)' });

gsap.to(mainLayerRef.current, {
clipPath: 'inset(0% 0% 100% 0%)',
ease: 'none',
const tl = gsap.timeline({
scrollTrigger: {
trigger: pinWrapRef.current,
start: 'top top',
end: '+=100%',
end: '+=300%',
scrub: true,
pin: true,
onUpdate: (self) => {
scrollProgressRef.current = self.progress;
},
},
});

tl.to(mainLayerRef.current, {
clipPath: 'inset(0% 0% 100% 0%)',
ease: 'none',
});

tl.to(secondLayerRef.current, {
clipPath: 'inset(0% 0% 100% 0%)',
ease: 'none',
});

tl.to(thirdLayerRef.current, {
clipPath: 'inset(0% 0% 100% 0%)',
ease: 'none',
});
});

return () => {
ctx.revert();
smoother.kill();
};
}, [loading]);

return (
<>
<IntroLoader visible={loading} />

<div id="smooth-wrapper">
<div id="smooth-content" className="min-h-screen">
<div ref={pinWrapRef} className="relative">
<div className="bg-background absolute inset-0 z-0 h-screen w-screen">
<div className="bg-background absolute inset-0 z-10 h-screen w-screen">
hello
</div>

<div
ref={thirdLayerRef}
className="bg-background absolute inset-0 z-20 h-screen w-screen overflow-hidden"
>
hello
</div>

<div
ref={secondLayerRef}
className="bg-background absolute inset-0 z-30 h-screen w-screen overflow-hidden"
>
<HeroSection />
</div>
<div
ref={mainLayerRef}
className="bg-background absolute inset-0 z-10 h-screen w-screen overflow-hidden"
className="bg-background absolute inset-0 z-40 h-screen w-screen overflow-hidden"
>
<main className="relative overflow-hidden">
<div
Expand Down Expand Up @@ -298,7 +328,7 @@
</main>
</div>
</div>
<div className="h-[101vh]" />
<div className="h-screen" />
</div>
</div>
</>
Expand Down
Loading