Skip to content

Commit 1d55379

Browse files
committed
Cleaner Donation Section
1 parent 1d9c917 commit 1d55379

File tree

2 files changed

+54
-50
lines changed

2 files changed

+54
-50
lines changed
460 KB
Loading

src/components/Donation.tsx

Lines changed: 54 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,80 @@
11
import React, { useState } from 'react';
2-
import { donationData } from '@/constants/Donation';
32
import { Link } from 'react-router-dom';
4-
import { volunteerImages } from '@/constants/Volunteer';
53
import { motion } from 'framer-motion';
4+
import { donationData } from '@/constants/Donation';
5+
import { volunteerImages } from '@/constants/Volunteer';
66
import {
77
fadeIn,
88
slideInLeft,
99
slideInRight,
1010
slideInBottom,
1111
bounce,
1212
staggerContainer,
13-
floatingCircle,
1413
buttonAnimation,
1514
} from '@/styles/Animations';
1615

1716
const Donation: React.FC = () => {
18-
const handleClick = () => {
19-
window.location.href = donationData.url;
20-
};
17+
const [email, setEmail] = useState('');
2118

22-
const [Email, setEmail] = useState('');
19+
const handleDonateClick = () => {
20+
window.open(donationData.url, '_blank');
21+
};
2322

2423
return (
2524
<section className="relative overflow-hidden bg-white text-black py-16 px-4">
26-
{/* Animated background circles */}
27-
<motion.div
28-
className="absolute top-1/8 right-1/6 w-96 h-96 bg-[#8df090] rounded-full -mt-32 -mr-32 z-1"
29-
variants={floatingCircle}
30-
initial="hidden"
31-
animate="visible"
32-
/>
33-
<motion.div
34-
className="absolute top-1/2 right-1/6 w-96 h-96 bg-[#ebee67] rounded-full -mt-32 -mr-64 z-0"
35-
variants={floatingCircle}
36-
initial="hidden"
37-
animate="visible"
38-
transition={{ delay: 0.3 }}
39-
/>
40-
41-
<div className="relative z-10">
25+
{/* Flex container to align text and image side by side */}
26+
<div className="max-w-[90%] mx-auto flex flex-col lg:flex-row items-center justify-center lg:gap-12">
27+
{/* Left Side - Text Content */}
4228
<motion.div
43-
className="container mx-auto text-left"
44-
variants={staggerContainer}
29+
className="lg:w-1/2 text-center lg:text-left"
30+
variants={slideInLeft}
4531
initial="hidden"
4632
whileInView="visible"
47-
viewport={{ once: true, amount: 0.2 }}
33+
viewport={{ once: true, amount: 0.5 }}
4834
>
49-
<motion.p
50-
className="font-Caveat text-2xl uppercase"
51-
variants={slideInLeft}
52-
>
53-
{donationData.subHeading}
54-
</motion.p>
55-
<motion.h1 className="text-4xl font-bold mt-2" variants={slideInLeft}>
56-
{donationData.heading}
57-
</motion.h1>
58-
<motion.p className="text-lg mt-4" variants={slideInLeft}>
59-
{donationData.paragraph}
60-
</motion.p>
35+
<p className="italic text-gray-600 text-lg md:text-xl">
36+
Donate to Sugar Labs to make a{' '}
37+
<span className="font-bold">Positive</span> Impact
38+
</p>
39+
<h1 className="text-4xl md:text-5xl font-bold mt-2 leading-tight">
40+
Support and Empower <br /> Learners Everywhere
41+
</h1>
42+
<p className="text-gray-600 text-lg mt-4">
43+
Support Sugar Labs and make a difference in children's education.
44+
Sugar Labs has brought educational software and authentic problem
45+
solving to millions in the US and across the globe.
46+
</p>
47+
48+
{/* Donate Now Button */}
6149
<motion.button
62-
onClick={handleClick}
63-
className="mt-6 px-6 py-3 bg-[#fbd04d] text-black text-2xl font-bold rounded-full shadow-lg hover:bg-yellow-500 transition duration-300 outline-4 uppercase"
50+
onClick={handleDonateClick}
51+
className="mt-6 px-6 py-3 bg-[#fbd04d] text-black text-2xl font-bold rounded-full shadow-md hover:bg-yellow-500 transition duration-300 uppercase"
6452
variants={bounce}
6553
whileHover="hover"
6654
whileTap="tap"
6755
>
68-
{donationData.buttonText}
56+
Donate Now
6957
</motion.button>
7058
</motion.div>
7159

60+
{/* Right Side - Image with Spacing */}
61+
<motion.img
62+
src="assets/Images/DonateToSugarLabs.png"
63+
alt="Children with laptops and Donate to Sugarlabs"
64+
className="w-[400px] lg:w-[500px] transition-none hover:transform-none object-contain"
65+
variants={slideInRight}
66+
initial="hidden"
67+
whileInView="visible"
68+
viewport={{ once: true, amount: 0.5 }}
69+
whileHover={{ scale: 1.01 }}
70+
/>
71+
</div>
72+
73+
{/* Newsletter and Volunteer Section Moved Down */}
74+
<div className="relative z-10 w-full mt-12 text-center">
7275
<Link to="/volunteer">
7376
<motion.div
74-
className="mt-12 flex justify-center items-center"
77+
className="flex justify-center items-center"
7578
variants={slideInBottom}
7679
initial="hidden"
7780
whileInView="visible"
@@ -82,14 +85,12 @@ const Donation: React.FC = () => {
8285
className="absolute -top-8 -right-8"
8386
animate={{
8487
x: [0, 10, 0],
85-
transition: {
86-
repeat: Infinity,
87-
duration: 1.5,
88-
},
88+
transition: { repeat: Infinity, duration: 1.5 },
8989
}}
9090
>
9191
<i className="fas fa-arrow-right text-2xl" />
9292
</motion.div>
93+
9394
<motion.div
9495
className="bg-white border border-gray-300 rounded-full px-4 py-2 flex items-center shadow-lg"
9596
whileHover={{ scale: 1.05 }}
@@ -127,17 +128,19 @@ const Donation: React.FC = () => {
127128
</motion.div>
128129
</Link>
129130

131+
{/* Newsletter Subscription Section Moved Down */}
130132
<motion.div
131-
className="mt-16 text-center"
133+
className="mt-16"
132134
variants={staggerContainer}
133135
initial="hidden"
134136
whileInView="visible"
135137
viewport={{ once: true, amount: 0.2 }}
136138
>
137139
<motion.p className="text-lg" variants={fadeIn}>
138-
Join Us to Empower Young Learners all Across the Globe. The simplest
139-
way to get involved is to join our newsletter.
140+
Join us to empower young learners across the globe. The simplest way
141+
to get involved is to join our newsletter.
140142
</motion.p>
143+
141144
<motion.div
142145
className="mt-4 flex justify-center items-center"
143146
variants={slideInRight}
@@ -146,13 +149,14 @@ const Donation: React.FC = () => {
146149
action="https://buttondown.com/api/emails/embed-subscribe/sugarlabs"
147150
method="post"
148151
onSubmit={() => setTimeout(() => setEmail(''), 500)}
152+
className="flex"
149153
>
150154
<input
151155
className="px-4 py-2 border border-gray-300 rounded-l-full focus:outline-none"
152156
placeholder="Enter your email"
153157
type="email"
154158
name="email"
155-
value={Email}
159+
value={email}
156160
onChange={(e) => setEmail(e.target.value)}
157161
required
158162
/>

0 commit comments

Comments
 (0)