Skip to content

Commit 355b255

Browse files
authored
Merge pull request #361 from CodeHarborHub/dev-3
update layout with framer-motion
2 parents 6e6f0bf + 81df599 commit 355b255

File tree

2 files changed

+35
-21
lines changed

2 files changed

+35
-21
lines changed

src/components/HomePage/Header.tsx

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,24 @@ import { motion } from "framer-motion";
1313
const HeaderContent = () => {
1414
return (
1515
<div className="chh__header-content">
16-
<h1 className="gradient__text"
17-
>Level Up Skills with CodeHarborHub</h1>
16+
<motion.h1
17+
initial={{ opacity: 0, x: -10 }}
18+
whileInView={{ opacity: 1, x: 0 }}
19+
viewport={{ once: true }}
20+
transition={{
21+
duration: 1,
22+
type: "spring",
23+
stiffness: 100,
24+
delay: 0.1,
25+
}}
26+
className="gradient__text"
27+
>
28+
Level Up Skills with CodeHarborHub
29+
</motion.h1>
30+
{/* <h1 className="gradient__text"
31+
>Level Up Skills with CodeHarborHub</h1> */}
1832
<motion.p
19-
initial={{ opacity: 0, x: -150 }}
33+
initial={{ opacity: 0, x: -10 }}
2034
whileInView={{ opacity: 1, x: 0 }}
2135
viewport={{ once: true }}
2236
transition={{
@@ -34,14 +48,14 @@ const HeaderContent = () => {
3448

3549
<div className="chh__header-content__input">
3650
<motion.button
37-
initial={{ opacity: 0, x: -150 }}
51+
initial={{ opacity: 0, x: -10 }}
3852
whileInView={{ opacity: 1, x: 0 }}
3953
viewport={{ once: true }}
4054
transition={{
4155
duration: 1,
4256
type: "spring",
4357
stiffness: 100,
44-
delay: 0.5,
58+
delay: 0.3,
4559
}}
4660
type="button"
4761
>
@@ -50,14 +64,14 @@ const HeaderContent = () => {
5064
</Link>
5165
</motion.button>
5266
<motion.button
53-
initial={{ opacity: 0, x: 150 }}
67+
initial={{ opacity: 0, x: 10 }}
5468
whileInView={{ opacity: 1, x: 0 }}
5569
viewport={{ once: true }}
5670
transition={{
5771
duration: 1,
5872
type: "spring",
5973
stiffness: 100,
60-
delay: 0.5,
74+
delay: 0.2,
6175
}}
6276
type="button"
6377
>
@@ -97,14 +111,14 @@ const HeaderImage = () => {
97111

98112
return (
99113
<motion.div
100-
initial={{ scale: 0, x: 150 }}
114+
initial={{ scale: 0, x: 10 }}
101115
whileInView={{ scale: 0.8, x: 0 }}
102116
viewport={{ once: true }}
103117
transition={{
104118
duration: 1,
105119
type: "spring",
106120
stiffness: 100,
107-
delay: 0.5,
121+
delay: 0.3,
108122
}}
109123
className="chh__header-image"
110124
>

src/pages/index.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ function TweetsSection(): React.JSX.Element {
2323
<div className={clsx(styles.section, styles.sectionAlt)}>
2424
<div className="tweets-container">
2525
<motion.div
26-
initial={{ opacity: 0, x: -150 }}
26+
initial={{ opacity: 0, x: -10 }}
2727
whileInView={{ opacity: 1, x: 0 }}
2828
viewport={{ once: true }}
2929
transition={{
3030
duration: 1,
3131
type: "spring",
3232
stiffness: 100,
33-
delay: 0.5,
33+
delay: 0.3,
3434
}}
3535
className={styles.home__divider}
3636
>
@@ -44,14 +44,14 @@ function TweetsSection(): React.JSX.Element {
4444
<div className={clsx("row", styles.tweetsSection)}>
4545
{tweetColumns.map((tweetItems, i) => (
4646
<motion.div
47-
initial={{ opacity: 0, y: -150 }}
47+
initial={{ opacity: 0, y: -10 }}
4848
whileInView={{ opacity: 1, y: 0 }}
4949
viewport={{ once: true }}
5050
transition={{
5151
duration: 1,
5252
type: "spring",
5353
stiffness: 100,
54-
delay: 0.5,
54+
delay: 0.3,
5555
}}
5656
className="col col--4"
5757
key={i}
@@ -82,58 +82,58 @@ export default function Home(): React.JSX.Element {
8282
<hr className={styles.home__hr} />
8383

8484
<motion.div
85-
initial={{ opacity: 0, x: -150 }}
85+
initial={{ opacity: 0, x: -10 }}
8686
whileInView={{ opacity: 1, x: 0 }}
8787
viewport={{ once: true }}
8888
transition={{
8989
duration: 1,
9090
type: "spring",
9191
stiffness: 100,
92-
delay: 0.5,
92+
delay: 0.3,
9393
}}
9494
className={styles.home__divider}
9595
>
9696
<Heading as="h2">Courses Available</Heading>
9797
</motion.div>
9898

9999
<motion.div
100-
initial={{ opacity: 0, y: -150 }}
100+
initial={{ opacity: 0, y: -10 }}
101101
whileInView={{ opacity: 1, y: 0 }}
102102
viewport={{ once: true }}
103103
transition={{
104104
duration: 1,
105105
type: "spring",
106106
stiffness: 100,
107-
delay: 0.5,
107+
delay: 0.3,
108108
}}
109109
>
110110
<Courses courses={coursesData} />
111111
</motion.div>
112112

113113
<motion.div
114-
initial={{ opacity: 0, x: -150 }}
114+
initial={{ opacity: 0, x: -10 }}
115115
whileInView={{ opacity: 1, x: 0 }}
116116
viewport={{ once: true }}
117117
transition={{
118118
duration: 1,
119119
type: "spring",
120120
stiffness: 100,
121-
delay: 0.5,
121+
delay: 0.3,
122122
}}
123123
className={styles.home__divider}
124124
>
125125
<Heading as="h2">Features of {siteConfig.title}</Heading>
126126
</motion.div>
127127

128128
<motion.div
129-
initial={{ opacity: 0, y: -150 }}
129+
initial={{ opacity: 0, y: -10 }}
130130
whileInView={{ opacity: 1, y: 0 }}
131131
viewport={{ once: true }}
132132
transition={{
133133
duration: 1,
134134
type: "spring",
135135
stiffness: 100,
136-
delay: 0.5,
136+
delay: 0.3,
137137
}}
138138
>
139139
<Features features={featuresData} />

0 commit comments

Comments
 (0)