Skip to content

Commit 8fbae08

Browse files
authored
Merge pull request #857 from w3bdesign/develop
Version 1.27
2 parents f739f11 + a6d072d commit 8fbae08

File tree

3 files changed

+208
-179
lines changed

3 files changed

+208
-179
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// CircleCI doesn't like import { motion } from "framer-motion" here, so we use require
2+
const { motion } = require('framer-motion');
3+
4+
/**
5+
* Fade up content animation
6+
* @function FadeUp
7+
* @param {ReactNode} children - Children content to render
8+
* @param {string} cssClass - CSS classes to apply to component
9+
* @param {number} delay - Time to wait before starting animation
10+
* @returns {JSX.Element} - Rendered component
11+
*/
12+
13+
const FadeUp = ({ children, cssClass, delay }) => {
14+
const fadeUpVariants = {
15+
initial: { opacity: 0, y: 20 },
16+
animate: {
17+
y: 0,
18+
opacity: 1,
19+
transition: { delay, type: 'spring', duration: 0.5, stiffness: 110 },
20+
},
21+
};
22+
return (
23+
<motion.div
24+
className={cssClass}
25+
variants={fadeUpVariants}
26+
initial="initial"
27+
animate="animate"
28+
data-testid="fadeup"
29+
>
30+
{children}
31+
</motion.div>
32+
);
33+
};
34+
35+
export default FadeUp;

0 commit comments

Comments
 (0)