Skip to content

Commit

Permalink
[perf] 비디오 스크롤 아주 조금 부드럽게 함
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdulgi committed Aug 1, 2024
1 parent 9a27128 commit e131dc4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/introSection/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ function IntroSection() {
};

useEffect(() => {
videoRef.current.currentTime = videoTimeline;
if (
videoRef.current &&
Math.abs(videoRef.current.currentTime - videoTimeline) > 0.1
) {
videoRef.current.currentTime = videoTimeline;
}
}, [videoTimeline]);

useEffect(() => {
Expand Down Expand Up @@ -74,10 +79,7 @@ function IntroSection() {

return (
<>
<div
ref={introRef}
className="h-[2160px] flex flex-col items-center"
>
<div ref={introRef} className="h-[2160px] flex flex-col items-center">
<div className="z-50 fixed w-full flex justify-center top-[500px] -translate-y-1/2 pointer-events-none">
<h1
className={`${style.openTitle} ease-in text-8xl font-bold text-black z-50`}
Expand Down

0 comments on commit e131dc4

Please sign in to comment.