diff options
| author | 2023-11-03 21:13:33 +0800 | |
|---|---|---|
| committer | 2023-11-03 21:13:33 +0800 | |
| commit | 9f0d43fe099a95ab1516ae951dcb60a89e76a5a5 (patch) | |
| tree | 51614fe47bff8bb11028a07d4a35c34c9ff6594a /docs/components/pages/home-shared/FadeIn.tsx | |
| parent | 8f135707d069c900e055dae71e69909d6b9a41bb (diff) | |
| download | HydroRoll-9f0d43fe099a95ab1516ae951dcb60a89e76a5a5.tar.gz HydroRoll-9f0d43fe099a95ab1516ae951dcb60a89e76a5a5.zip | |
chore: delete useless codes
Diffstat (limited to 'docs/components/pages/home-shared/FadeIn.tsx')
| -rw-r--r-- | docs/components/pages/home-shared/FadeIn.tsx | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/docs/components/pages/home-shared/FadeIn.tsx b/docs/components/pages/home-shared/FadeIn.tsx deleted file mode 100644 index 826a078..0000000 --- a/docs/components/pages/home-shared/FadeIn.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { motion, useInView } from "framer-motion"; -import { useRef } from "react"; - -export function FadeIn({ - children, - className, - noVertical, - delay, - viewTriggerOffset, -}: { - children: React.ReactNode; - className?: string; - noVertical?: boolean; - delay?: number; - viewTriggerOffset?: boolean; -}) { - const ref = useRef(null); - const inView = useInView(ref, { - once: true, - margin: viewTriggerOffset ? "-128px" : "0px", - }); - - const fadeUpVariants = { - initial: { - opacity: 0, - y: noVertical ? 0 : 24, - }, - animate: { - opacity: 1, - y: 0, - }, - }; - - return ( - <motion.div - ref={ref} - animate={inView ? "animate" : "initial"} - variants={fadeUpVariants} - className={className} - initial={false} - transition={{ - duration: 1, - delay: delay || 0, - ease: [0.21, 0.47, 0.32, 0.98], - }} - > - {children} - </motion.div> - ); -} |
