Skip to content

Commit cf8ffcc

Browse files
committed
about page animate
1 parent ad5658c commit cf8ffcc

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

client/src/pages/About.jsx

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
11
import React from 'react';
2+
import { motion } from 'framer-motion';
23

34
import PageHero from '../layout/PageHero';
45
import { ABOUT_IMG_URL } from '../utils/constants';
56

67

78
const About = () => {
9+
10+
const underlineAnimate = {
11+
hidden: {
12+
opacity: 0,
13+
pathLength: 0,
14+
},
15+
visible: {
16+
opacity: 1,
17+
pathLength: 1,
18+
transition: {
19+
delay: 1,
20+
duration: .8,
21+
},
22+
},
23+
};
24+
825
return (
926
<main>
1027
<PageHero title="about" />
@@ -15,7 +32,11 @@ const About = () => {
1532
<img src={ABOUT_IMG_URL} alt="" />
1633
</div>
1734
<div>
18-
<h2 className='text-4xl lg:text-6xl font-bold capitalize tracking-wider'>
35+
<motion.h2 className='text-4xl lg:text-6xl font-bold capitalize tracking-wider'
36+
initial={{ opacity: 0, y: 60 }}
37+
animate={{ opacity: 1, y: 0 }}
38+
transition={{ duration: .5 }}
39+
>
1940
Our Story
2041
<svg
2142
className="svg-underline stroke-[#ffb81c] relative z-10 w-1/2"
@@ -26,12 +47,19 @@ const About = () => {
2647
fill="none"
2748
xmlns="http://www.w3.org/2000/svg"
2849
>
29-
<path
50+
<motion.path
3051
d="M3 9C118.957 4.47226 364.497 -1.86658 419 9"
52+
variants={underlineAnimate}
53+
initial="hidden"
54+
animate="visible"
3155
/>
3256
</svg>
33-
</h2>
34-
<p className='leading-10 text-gray-600 py-8 text-lg'>
57+
</motion.h2>
58+
<motion.p className='leading-10 text-gray-600 py-8 text-lg'
59+
initial={{ opacity: 0, y: 60 }}
60+
animate={{ opacity: 1, y: 0 }}
61+
transition={{ delay: .5, duration: .8 }}
62+
>
3563
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Fugiat
3664
accusantium sapiente tempora sed dolore esse deserunt eaque
3765
excepturi, delectus error accusamus vel eligendi, omnis beatae.
@@ -42,7 +70,7 @@ const About = () => {
4270
ex, eaque perspiciatis nisi, eum totam velit saepe sed quos
4371
similique amet. Ex, voluptate accusamus nesciunt totam vitae esse
4472
iste.
45-
</p>
73+
</motion.p>
4674
</div>
4775
</div>
4876
</div>

0 commit comments

Comments
 (0)