Skip to content

Commit 0c1ccb1

Browse files
authoredJan 21, 2025
Merge pull request #39 from arolle11/arolle11/feat/landing-page-model2
Arolle11/feat/landing page model2
2 parents 07b9b4c + b3c3b11 commit 0c1ccb1

File tree

5 files changed

+112
-77
lines changed

5 files changed

+112
-77
lines changed
 

‎templates/landing-page/model2/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
"@rasenganjs/image": "^1.0.0",
1414
"class-variance-authority": "^0.7.0",
1515
"clsx": "^2.1.1",
16+
"framer-motion": "^12.0.0",
1617
"rasengan": "1.0.0-beta.46",
1718
"react": "^18.3.0",
1819
"react-dom": "^18.3.0",
20+
"react-intersection-observer": "^9.15.1",
1921
"tailwind-merge": "^2.5.2",
2022
"tailwindcss-animate": "^1.0.7"
2123
},

‎templates/landing-page/model2/src/app/root/components/Main.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ interface MainProps {
44

55
export default function Main({ children }: MainProps) {
66
return (
7-
<main className='w-screen min-h-screen mx-auto min-h-[800px]'>
7+
<main className='w-screen min-h-screen mx-auto'>
88
{children}
99
</main>
1010
);

‎templates/landing-page/model2/src/app/root/pages/blog.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,23 @@ const Blog: PageComponent = () => {
4343

4444
<div className="relative flex flex-1 justify-center lg:justify-end">
4545
<Image src={computer} alt="computer" className="rounded-xl w-full" />
46-
{/* <div className="absolute top-6 -right-4 bg-primary rotate-[15deg] h-10 w-10 rounded-[10px] flex items-center justify-center">
46+
{/* <div className="absolute max-lg:right-[350px] left-[270px] top-[150px] bg-primary rotate-[15deg] h-10 w-10 rounded-[10px] flex items-center justify-center">
4747
<Image src={sms} alt="sms" />
4848
</div>
49-
<div className="absolute left-[340px] gap-2 top-[410px] rounded-[10px] flex flex-col justify-between p-4 bg-white">
49+
<div className="absolute top-6 -right-4 gap-2 rounded-[10px] flex flex-col justify-between p-4 bg-white">
5050
<p className="text-[#A9A7B6] text-xs">Total Income</p>
5151
<div className="flex gap-8">
5252
<span className="text-base">$245.00</span>
5353
<Image src={bar} alt="Bar" className="h-full" />
5454
</div>
5555
</div>
56-
<div className="absolute max-lg:right-[350px] left-[270px] gap-14 top-[25px] rounded-[10px] flex justify-between items-center p-4 bg-white">
56+
<div className="absolute left-[340px] top-[410px] gap-14 rounded-[10px] flex justify-between items-center p-4 bg-white">
5757
<div className="flex justify-between items-center gap-2">
5858
<Image src={green_tick} alt="green_tick" className="h-full" />
5959
<span className="text-base">Money Transfer Succesfull</span>
6060
</div>
6161
</div>
62-
<div className="absolute max-lg:right-[350px] left-[270px] gap-14 top-[150px] rounded-[10px] flex justify-between items-center p-4 bg-white">
62+
<div className="absolute max-lg:right-[350px] left-[270px] gap-14 rounded-[10px] flex justify-between items-center p-4 bg-white">
6363
<Image src={amanda} alt="amanda" className="h-full" />
6464
<div className="flex flex-col gap-2">
6565
<p className="text-[#191A15] text-base">Amanda Young</p>

‎templates/landing-page/model2/src/app/root/pages/faq.tsx

+41-8
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,23 @@ import { PageComponent } from "rasengan";
33
import teams from "@/assets/images/teams.png";
44
import cloud from "@/assets/images/cloud.png";
55
import analytics from "@/assets/images/analytics.png";
6+
import { motion } from "framer-motion";
67

78
const Faq: PageComponent = () => {
9+
const sectionVariants = {
10+
hidden: { opacity: 0, translateY: 20 },
11+
visible: { opacity: 1, translateY: 0 },
12+
};
13+
14+
//conteneur parent pour les animations
15+
const containerVariants = {
16+
hidden: {},
17+
visible: {
18+
transition: {
19+
staggerChildren: 0.3, //délai d'animation de chaque enfant
20+
},
21+
},
22+
};
823
return (
924
<section id="faq" className="bg-custom-gradient-2">
1025
<div className="flex flex-col items-center text-center gap-6 px-4 pt-8 lg:flex-row lg:justify-between lg:items-start lg:text-left lg:px-[130px] lg:pt-[130px]">
@@ -23,8 +38,18 @@ const Faq: PageComponent = () => {
2338
</div>
2439

2540
<div className="pt-12 px-4 lg:px-[130px]">
26-
<div className="grid grid-cols-1 gap-10 md:grid-cols-2 lg:grid-cols-3">
27-
<div className="flex flex-col items-center text-center">
41+
<motion.div
42+
className="grid grid-cols-1 gap-10 md:grid-cols-2 lg:grid-cols-3"
43+
variants={containerVariants}
44+
initial="hidden"
45+
whileInView="visible"
46+
viewport={{ once: true, amount: 0.3 }}
47+
>
48+
<motion.div
49+
className="flex flex-col items-center text-center"
50+
variants={sectionVariants}
51+
transition={{ duration: 0.7, ease: "easeInOut" }}
52+
>
2853
<img
2954
src={teams}
3055
alt="Collaboration Teams"
@@ -36,9 +61,13 @@ const Faq: PageComponent = () => {
3661
<p className="text-[#A6A6A6] text-sm md:text-base mt-2">
3762
Handle projects together with your team virtually.
3863
</p>
39-
</div>
64+
</motion.div>
4065

41-
<div className="flex flex-col items-center text-center">
66+
<motion.div
67+
className="flex flex-col items-center text-center"
68+
variants={sectionVariants}
69+
transition={{ duration: 0.7, ease: "easeInOut" }}
70+
>
4271
<img
4372
src={cloud}
4473
alt="Cloud Storage"
@@ -50,9 +79,13 @@ const Faq: PageComponent = () => {
5079
<p className="text-[#A6A6A6] text-sm md:text-base mt-2">
5180
No need to worry about storage as we provide up to 2 TB.
5281
</p>
53-
</div>
82+
</motion.div>
5483

55-
<div className="flex flex-col items-center text-center">
84+
<motion.div
85+
className="flex flex-col items-center text-center"
86+
variants={sectionVariants}
87+
transition={{ duration: 0.7, ease: "easeInOut" }}
88+
>
5689
<img
5790
src={analytics}
5891
alt="Daily Analytics"
@@ -64,8 +97,8 @@ const Faq: PageComponent = () => {
6497
<p className="text-[#A6A6A6] text-sm md:text-base mt-2">
6598
Get useful information daily to make your work easier.
6699
</p>
67-
</div>
68-
</div>
100+
</motion.div>
101+
</motion.div>
69102
</div>
70103
</section>
71104
);

‎templates/landing-page/model2/src/app/root/pages/home.page.tsx

+64-64
Original file line numberDiff line numberDiff line change
@@ -15,49 +15,29 @@ import descript from "@/assets/descript.svg";
1515
import ellipse from "@/assets/ellipse.svg";
1616
import database from "@/assets/database.svg";
1717
import message from "@/assets/message.svg";
18+
import { motion } from "framer-motion";
19+
import ButtonWithLogo from "@/components/atoms/ButtonWithLogo";
1820
import vector from "@/assets/vector.svg";
1921
import bar from "@/assets/bar.svg";
20-
import ButtonWithLogo from "@/components/atoms/ButtonWithLogo";
2122
import Typography from "@/components/atoms/Typography";
22-
import { useEffect, useState } from 'react';
2323

2424
const Home: PageComponent = () => {
25-
26-
const [inView, setInView] = useState({
27-
section1: false,
28-
section2: false,
29-
section3: false,
30-
section4: false,
31-
section5: false,
32-
section6: false,
33-
});
34-
35-
const handleScroll = () => {
36-
const sections = ['section1', 'section2', 'section3', 'section4', 'section5', 'section6'];
37-
sections.forEach((section) => {
38-
const element = document.getElementById(section);
39-
if (element) {
40-
const rect = element.getBoundingClientRect();
41-
setInView((prev) => ({
42-
...prev,
43-
[section]: rect.top <= window.innerHeight * 0.8 && rect.bottom >= 0,
44-
}));
45-
}
46-
});
25+
const sectionVariants = {
26+
hidden: { opacity: 0, translateY: 20 },
27+
visible: { opacity: 1, translateY: 0 },
4728
};
4829

49-
useEffect(() => {
50-
window.addEventListener('scroll', handleScroll);
51-
handleScroll();
52-
return () => window.removeEventListener('scroll', handleScroll);
53-
}, []);
54-
5530
return (
5631
<section className="w-full h-full flex flex-col">
57-
<div id="section1"
58-
className={`max-lg:flex-col flex flex-grow px-8 lg:px-[130px] pt-4 lg:pt-14 bg-custom-gradient gap-4 transition-all duration-700 ease-in-out ${
59-
inView.section1 ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-10'
60-
}`}>
32+
<motion.div
33+
id="section1"
34+
className="max-lg:flex-col flex flex-grow px-8 lg:px-[130px] pt-4 lg:pt-14 bg-custom-gradient gap-4"
35+
variants={sectionVariants}
36+
initial="hidden"
37+
whileInView="visible"
38+
viewport={{ once: true, amount: 0.3 }}
39+
transition={{ duration: 0.7, ease: "easeInOut" }}
40+
>
6141
<div className="flex flex-1 flex-col">
6242
<Typography
6343
className="max-xl:text-5xl text-7xl pb-6"
@@ -67,7 +47,7 @@ const Home: PageComponent = () => {
6747
<img src={curve} alt="curve" className="py-8" />
6848
<p className="text-lg py-8">
6949
Let's make your work more organize and easily using the Taskio
70-
Dashboard with many of the latest featuresin managing work every
50+
Dashboard with many of the latest features in managing work every
7151
day.
7252
</p>
7353
<div className="flex gap-6 mt-8">
@@ -97,8 +77,8 @@ const Home: PageComponent = () => {
9777
<div className="absolute bg-[#FFAA94] top-[510px] right-[50px] rotate-[15deg] h-10 w-10 rounded-[10px] flex items-center justify-center">
9878
<Image src={message} alt="message" />
9979
</div>
100-
{/* <div className="absolute bg-[#4535AF] max-lg:right-[350px] right-[430px] top-[160px] rotate-[-15deg] h-10 w-10 rounded-[10px] flex items-center justify-center"><Image src={vector} alt="vector"/></div>
101-
<div className="absolute max-lg:right-[350px] left-[270px] gap-14 top-[25px] rounded-[10px] flex justify-between items-center p-4 bg-white">
80+
{/* <div className="absolute bg-[#4535AF] max-lg:right-[350px] right-[430px] top-[160px] rotate-[-15deg] h-10 w-10 rounded-[10px] flex items-center justify-center"><Image src={vector} alt="vector"/></div> */}
81+
{/* <div className="absolute max-lg:right-[350px] left-[270px] gap-14 top-[25px] rounded-[10px] flex justify-between items-center p-4 bg-white">
10282
<div className="flex flex-col gap-2">
10383
<p className="text-[#A9A7B6] text-xs">Enter amount</p>
10484
<span className="text-base">$450..00</span>
@@ -130,18 +110,22 @@ const Home: PageComponent = () => {
130110
<span className="absolute bg-white rounded-full w-[150px] h-[150px] top-[100px] -left-10 p-2 opacity-20"></span>
131111
</div> */}
132112
</div>
133-
</div>
113+
</motion.div>
134114

135-
<div id="section2"
136-
className={`flex flex-col flex bg-custom-gradient items-center pt-14 px-8 lg:px-[130px] pb-14 lg:py-28 transition-all duration-700 ease-in-out ${
137-
inView.section2 ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-10'
138-
}`}>
115+
<motion.div
116+
id="section2"
117+
className="flex flex-col bg-custom-gradient items-center pt-14 px-8 lg:px-[130px] pb-14 lg:py-28"
118+
variants={sectionVariants}
119+
initial="hidden"
120+
whileInView="visible"
121+
viewport={{ once: true, amount: 0.3 }}
122+
transition={{ duration: 0.7, ease: "easeInOut" }}
123+
>
139124
<Typography
140125
className="text-4xl text-center"
141126
weight="bold"
142127
text="More than 25,000 teams use Collabs"
143128
/>
144-
145129
<div className="flex flex-wrap justify-center items-center gap-12 mt-14 text-[#A6A6A6] text-xl md:text-2xl lg:text-3xl">
146130
<p className="flex items-center gap-2">
147131
<Image src={unspash} alt="unsplash" />
@@ -166,35 +150,51 @@ const Home: PageComponent = () => {
166150
<span>Grammarly</span>
167151
</p>
168152
</div>
169-
</div>
153+
</motion.div>
170154

171-
<div id="section3"
172-
className={`flex-grow transition-all duration-700 ease-in-out ${
173-
inView.section3 ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-10'
174-
}`}>
155+
<motion.div
156+
id="section3"
157+
variants={sectionVariants}
158+
initial="hidden"
159+
whileInView="visible"
160+
viewport={{ once: true, amount: 0.3 }}
161+
transition={{ duration: 0.7, ease: "easeInOut" }}
162+
>
175163
<Products />
176-
</div>
164+
</motion.div>
177165

178-
<div id="section4"
179-
className={`flex-grow transition-all duration-700 ease-in-out ${
180-
inView.section4 ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-10'
181-
}`}>
166+
<motion.div
167+
id="section4"
168+
variants={sectionVariants}
169+
initial="hidden"
170+
whileInView="visible"
171+
viewport={{ once: true, amount: 0.3 }}
172+
transition={{ duration: 0.7, ease: "easeInOut" }}
173+
>
182174
<Faq />
183-
</div>
175+
</motion.div>
184176

185-
<div id="section5"
186-
className={`flex-grow transition-all duration-700 ease-in-out ${
187-
inView.section5 ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-10'
188-
}`}>
177+
<motion.div
178+
id="section5"
179+
variants={sectionVariants}
180+
initial="hidden"
181+
whileInView="visible"
182+
viewport={{ once: true, amount: 0.3 }}
183+
transition={{ duration: 0.7, ease: "easeInOut" }}
184+
>
189185
<Blog />
190-
</div>
186+
</motion.div>
191187

192-
<div id="section6"
193-
className={`flex-grow transition-all duration-700 ease-in-out ${
194-
inView.section6 ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-10'
195-
}`}>
188+
<motion.div
189+
id="section6"
190+
variants={sectionVariants}
191+
initial="hidden"
192+
whileInView="visible"
193+
viewport={{ once: true, amount: 0.3 }}
194+
transition={{ duration: 0.7, ease: "easeInOut" }}
195+
>
196196
<AboutUs />
197-
</div>
197+
</motion.div>
198198
</section>
199199
);
200200
};

0 commit comments

Comments
 (0)
Please sign in to comment.