Skip to content

Commit

Permalink
Improved reference animations
Browse files Browse the repository at this point in the history
  • Loading branch information
Melchizedek6809 committed May 21, 2024
1 parent c8d6a3c commit 1fd8139
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/Reference.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ const Reference: React.FC<ReferenceProps> = (props) => {
const size = useWindowSize();
if(size.width && (size.width <= 900)){
variantsImage = variantEye;
}
}

const imageTransition = (size.width && (size.width <= 900))
? ({ duration: 0.6, ease:'circInOut', type: "spring", bounce: 0.5 })
: ({ duration: 0.3, ease:'easeOut', type: "spring", bounce: 0.5 });

return (
<div className={odd ? `${css.wrap} ${css.odd}` : `${css.wrap} ${css.even}`}>
Expand All @@ -57,7 +61,7 @@ const Reference: React.FC<ReferenceProps> = (props) => {
initial="hidden"
whileInView="visible"
viewport={{ once: true }}
transition={{ duration: 0.6, ease:'circInOut', type: "spring", bounce: 0.5 }}
transition={imageTransition}
variants={variantsImage}
src={image.src}
width={image.width}
Expand Down

0 comments on commit 1fd8139

Please sign in to comment.