From 144e62e130fbc6a5bc1d1656e64eb81f33c423fe Mon Sep 17 00:00:00 2001 From: Daniel <45217974+w3bdesign@users.noreply.github.com> Date: Tue, 23 Jul 2024 01:15:49 +0200 Subject: [PATCH] Update BounceInScroll.component.tsx --- .../Animations/BounceInScroll.component.tsx | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/components/Animations/BounceInScroll.component.tsx b/src/components/Animations/BounceInScroll.component.tsx index 033483af..ddde99af 100644 --- a/src/components/Animations/BounceInScroll.component.tsx +++ b/src/components/Animations/BounceInScroll.component.tsx @@ -1,34 +1,25 @@ "use client"; import { Variants, motion } from "framer-motion"; - import { IAnimateBounceProps } from "./types/Animations.types"; const bounceVariants: Variants = { offscreen: { - y: 30, opacity: 0, + scale: 0.98, }, onscreen: { - y: 0, opacity: 1, + scale: 1, transition: { type: "spring", - bounce: 0.5, - duration: 1.5, + damping: 20, + stiffness: 100, + duration: 0.5, }, }, }; -/** - * Bounce in content when content becomes visible in viewport - * @function BounceInScroll - * @param {ReactNode} children - Children content to render - * @param {string} cssClass - CSS classes to apply to component - * @param {"some" | "all" | number} viewAmount - Amount of component needed to be visible before animating - * @returns {JSX.Element} - Rendered component - */ - const BounceInScroll = ({ children, cssClass, @@ -38,11 +29,11 @@ const BounceInScroll = ({ initial="offscreen" whileInView="onscreen" viewport={{ once: true, amount: viewAmount || 0.2 }} - className={cssClass} + className={`${cssClass} overflow-hidden`} // Added overflow-hidden data-testid="bounceinscroll" > {children} ); -export default BounceInScroll; +export default BounceInScroll; \ No newline at end of file