Skip to content

Commit 9b5a4e7

Browse files
committed
scroll animations in About page
1 parent 5ed8aec commit 9b5a4e7

File tree

1 file changed

+65
-9
lines changed

1 file changed

+65
-9
lines changed

src/components/Aboutpage/index.tsx

Lines changed: 65 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from "react";
22
import clsx from "clsx";
33
import Heading from "@theme/Heading";
44
import styles from "./styles.module.css";
5-
5+
import { motion } from "framer-motion";
66
const aboutImg = "/img/svg/about_me.svg";
77

88
export default function AboutUsSection() {
@@ -11,21 +11,77 @@ export default function AboutUsSection() {
1111
<div className="container">
1212
<div className="row">
1313
<div className="col col--6">
14+
<motion.div
15+
initial={{ opacity: 0, x: -150 }}
16+
whileInView={{ opacity: 1, x: 0 }}
17+
viewport={{ once: true }}
18+
transition={{
19+
duration: 1,
20+
type: "spring",
21+
stiffness: 100,
22+
delay: 0.5,
23+
}}
24+
>
1425
<Heading as={"h1"}>About Us</Heading>
15-
<p className={styles.aboutUsDescription}>
26+
</motion.div>
27+
<motion.p
28+
initial={{ opacity: 0, y: -150 }}
29+
whileInView={{ opacity: 1, y: 0 }}
30+
viewport={{ once: true }}
31+
transition={{
32+
duration: 1,
33+
type: "spring",
34+
stiffness: 100,
35+
delay: 0.5,
36+
}}
37+
className={styles.aboutUsDescription}
38+
>
1639
Welcome to Code Harbor Hub, your go-to destination for quality tech education. At Code Harbor Hub, we are passionate about empowering individuals with the knowledge and skills needed to thrive in the ever-evolving world of technology.
17-
</p>
18-
<p className={styles.aboutUsDescription}>
40+
</motion.p>
41+
<motion.p
42+
initial={{ opacity: 0, y: -150 }}
43+
whileInView={{ opacity: 1, y: 0 }}
44+
viewport={{ once: true }}
45+
transition={{
46+
duration: 1,
47+
type: "spring",
48+
stiffness: 100,
49+
delay: 0.5,
50+
}}
51+
className={styles.aboutUsDescription}
52+
>
1953
Our mission is to provide accessible and comprehensive educational resources to learners of all levels, from beginners to advanced professionals. Whether you're looking to kickstart your career in web development, master a new programming language, or stay updated on the latest tech trends, we've got you covered.
20-
</p>
21-
<p className={styles.aboutUsDescription}>
54+
</motion.p>
55+
<motion.p
56+
initial={{ opacity: 0, y: -150 }}
57+
whileInView={{ opacity: 1, y: 0 }}
58+
viewport={{ once: true }}
59+
transition={{
60+
duration: 1,
61+
type: "spring",
62+
stiffness: 100,
63+
delay: 0.5,
64+
}}
65+
className={styles.aboutUsDescription}
66+
>
2267
With a team of experienced instructors and industry experts, we offer a diverse range of courses and learning paths tailored to meet your specific goals and interests. Join our community today and embark on your journey towards success in the tech industry!
23-
</p>
68+
</motion.p>
2469
</div>
25-
<div className={clsx("col", "col--6", styles.aboutUsImage)}>
70+
<motion.div
71+
initial={{ scale: 0, y: -150 }}
72+
whileInView={{ scale: 0.8, y: 0 }}
73+
viewport={{ once: true }}
74+
transition={{
75+
duration: 1,
76+
type: "spring",
77+
stiffness: 100,
78+
delay: 0.5,
79+
}}
80+
className={clsx("col", "col--6", styles.aboutUsImage)}
81+
>
2682
{/* Placeholder for an about us image */}
2783
<img src={aboutImg} alt="About Us" />
28-
</div>
84+
</motion.div>
2985
</div>
3086
</div>
3187
</section>

0 commit comments

Comments
 (0)