Skip to content

Commit 7017fa0

Browse files
committed
Added Fixes to useGsapTimeline.js to make animations smooth and follow the scroll
Signed-off-by: SplinterSword <sparshj2003@gmail.com>
1 parent 7a3c35b commit 7017fa0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/sections/Kanvas/FeaturesSection/useGsapTimeline.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ const useGsapTimeline = ({ trigger, featureContainerName,yPercent }) => {
2929
start: "top top+=96px",
3030
end: "bottom top",
3131
// markers: true,
32-
scrub: true,
32+
// Changed the value of scrub from true to 2 to make the animation smoother
33+
scrub: 2,
3334
pin: true,
34-
toggleActions: "play pause resume reset"
35+
// Changed the toggle actions to play complete reverse reset so that it correctly follows the scroll position
36+
toggleActions: "play complete reverse reset"
3537
},
3638
});
3739

0 commit comments

Comments
 (0)