Skip to content

Commit

Permalink
chore: refactor parallax in Image
Browse files Browse the repository at this point in the history
  • Loading branch information
niktverd committed Sep 20, 2023
1 parent ea984b5 commit 53bbad5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Media/Image/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ const Image = (props: ImageAllProps) => {

if (parallax) {
const parallaxLevel = 2;
springSetScrollY({springScrollY: height && scrollY > height ? height : scrollY});
parallaxInterpolate = springScrollY.interpolate(
springSetScrollY.start({springScrollY: height && scrollY > height ? height : scrollY});
parallaxInterpolate = springScrollY.to(
(value) => `translateY(-${Number(value) / parallaxLevel}px)`,
);
}
Expand Down

0 comments on commit 53bbad5

Please sign in to comment.