Skip to content

update layout with framer-motion #361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions src/components/HomePage/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,24 @@ import { motion } from "framer-motion";
const HeaderContent = () => {
return (
<div className="chh__header-content">
<h1 className="gradient__text"
>Level Up Skills with CodeHarborHub</h1>
<motion.h1
initial={{ opacity: 0, x: -10 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true }}
transition={{
duration: 1,
type: "spring",
stiffness: 100,
delay: 0.1,
}}
className="gradient__text"
>
Level Up Skills with CodeHarborHub
</motion.h1>
{/* <h1 className="gradient__text"
>Level Up Skills with CodeHarborHub</h1> */}
<motion.p
initial={{ opacity: 0, x: -150 }}
initial={{ opacity: 0, x: -10 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true }}
transition={{
Expand All @@ -34,14 +48,14 @@ const HeaderContent = () => {

<div className="chh__header-content__input">
<motion.button
initial={{ opacity: 0, x: -150 }}
initial={{ opacity: 0, x: -10 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true }}
transition={{
duration: 1,
type: "spring",
stiffness: 100,
delay: 0.5,
delay: 0.3,
}}
type="button"
>
Expand All @@ -50,14 +64,14 @@ const HeaderContent = () => {
</Link>
</motion.button>
<motion.button
initial={{ opacity: 0, x: 150 }}
initial={{ opacity: 0, x: 10 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true }}
transition={{
duration: 1,
type: "spring",
stiffness: 100,
delay: 0.5,
delay: 0.2,
}}
type="button"
>
Expand Down Expand Up @@ -97,14 +111,14 @@ const HeaderImage = () => {

return (
<motion.div
initial={{ scale: 0, x: 150 }}
initial={{ scale: 0, x: 10 }}
whileInView={{ scale: 0.8, x: 0 }}
viewport={{ once: true }}
transition={{
duration: 1,
type: "spring",
stiffness: 100,
delay: 0.5,
delay: 0.3,
}}
className="chh__header-image"
>
Expand Down
24 changes: 12 additions & 12 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ function TweetsSection(): React.JSX.Element {
<div className={clsx(styles.section, styles.sectionAlt)}>
<div className="tweets-container">
<motion.div
initial={{ opacity: 0, x: -150 }}
initial={{ opacity: 0, x: -10 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true }}
transition={{
duration: 1,
type: "spring",
stiffness: 100,
delay: 0.5,
delay: 0.3,
}}
className={styles.home__divider}
>
Expand All @@ -44,14 +44,14 @@ function TweetsSection(): React.JSX.Element {
<div className={clsx("row", styles.tweetsSection)}>
{tweetColumns.map((tweetItems, i) => (
<motion.div
initial={{ opacity: 0, y: -150 }}
initial={{ opacity: 0, y: -10 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{
duration: 1,
type: "spring",
stiffness: 100,
delay: 0.5,
delay: 0.3,
}}
className="col col--4"
key={i}
Expand Down Expand Up @@ -82,58 +82,58 @@ export default function Home(): React.JSX.Element {
<hr className={styles.home__hr} />

<motion.div
initial={{ opacity: 0, x: -150 }}
initial={{ opacity: 0, x: -10 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true }}
transition={{
duration: 1,
type: "spring",
stiffness: 100,
delay: 0.5,
delay: 0.3,
}}
className={styles.home__divider}
>
<Heading as="h2">Courses Available</Heading>
</motion.div>

<motion.div
initial={{ opacity: 0, y: -150 }}
initial={{ opacity: 0, y: -10 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{
duration: 1,
type: "spring",
stiffness: 100,
delay: 0.5,
delay: 0.3,
}}
>
<Courses courses={coursesData} />
</motion.div>

<motion.div
initial={{ opacity: 0, x: -150 }}
initial={{ opacity: 0, x: -10 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true }}
transition={{
duration: 1,
type: "spring",
stiffness: 100,
delay: 0.5,
delay: 0.3,
}}
className={styles.home__divider}
>
<Heading as="h2">Features of {siteConfig.title}</Heading>
</motion.div>

<motion.div
initial={{ opacity: 0, y: -150 }}
initial={{ opacity: 0, y: -10 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{
duration: 1,
type: "spring",
stiffness: 100,
delay: 0.5,
delay: 0.3,
}}
>
<Features features={featuresData} />
Expand Down
Loading