Skip to content

Commit 2a117ef

Browse files
committed
Setup Vite dev environment and overhaul SupportUsButton UI
1 parent b9bd2c0 commit 2a117ef

4 files changed

Lines changed: 77 additions & 51 deletions

File tree

demo/main.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ import "../src/styles/style.css";
55

66
ReactDOM.createRoot(document.getElementById("root")!).render(
77
<React.StrictMode>
8-
<div className="min-h-screen bg-gray-950 text-white flex justify-center">
9-
<div className="w-full max-w-6xl px-6 py-10">
10-
<h1>SupportUsButton Demo</h1>
8+
<div className="min-h-screen bg-black">
9+
10+
{/* 2. Optional: A more subtle, modern header for the demo */}
11+
<header className="absolute top-0 left-0 z-50 p-6">
12+
<h1 className="text-sm font-mono tracking-widest text-white/30 uppercase">
13+
Project: SupportUsButton / Demo
14+
</h1>
15+
</header>
1116

1217
<SupportUsButton
1318
Theme="AOSSIE"
@@ -50,7 +55,6 @@ ReactDOM.createRoot(document.getElementById("root")!).render(
5055
],
5156
}}
5257
/>
53-
</div>
5458
</div>
5559
</React.StrictMode>
5660
);

index.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
47
<title>Support Button Demo</title>
58
</head>
69
<body>
710
<div id="root"></div>
811
<script type="module" src="/demo/main.tsx"></script>
912
</body>
10-
</html>
13+
</html>

src/components/SupportUsButton.tsx

Lines changed: 59 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,40 @@ function getLogoSrc(logo?: string | { src?: string }) {
1212
}
1313

1414
function SupportUsButton({
15+
Theme = "dark",
16+
pattern = "none",
1517
hero,
1618
organizationInformation,
1719
sponsors,
1820
ctaSection,
21+
classNames = {},
22+
buttonVariant = "AOSSIE",
1923
}: supportUsButtonProps) {
2024
const logo = getLogoSrc(organizationInformation.logo);
2125

22-
return (
23-
<div className="relative min-h-screen bg-black text-white overflow-hidden">
26+
// Dynamic Theme Logic
27+
const isDark = Theme === "dark" || Theme === "AOSSIE";
28+
const bgClass = isDark ? "bg-black text-white" : "bg-gray-50 text-gray-900";
29+
const cardClass = isDark
30+
? "bg-white/5 border-white/10 backdrop-blur-2xl"
31+
: "bg-white border-gray-200 shadow-xl";
32+
const subTextClass = isDark ? "text-gray-400" : "text-gray-600";
2433

25-
{/* 🔥 Background Glow */}
26-
<div className="absolute inset-0 bg-[radial-gradient(circle_at_top,_rgba(255,215,0,0.15),_transparent_60%)]"></div>
34+
return (
35+
<div className={`relative min-h-screen overflow-hidden transition-colors duration-500 ${bgClass} ${classNames.container || ""}`}>
36+
37+
{/* Background Glow (Adjusts based on Theme) */}
38+
<div className={`absolute inset-0 ${isDark
39+
? "bg-[radial-gradient(circle_at_top,_rgba(255,215,0,0.15),_transparent_60%)]"
40+
: "bg-[radial-gradient(circle_at_top,_rgba(255,215,0,0.05),_transparent_60%)]"}`}
41+
/>
42+
43+
{/* Pattern Overlay (Supporting the pattern prop) */}
44+
{pattern !== "none" && (
45+
<div className="absolute inset-0 opacity-10 pointer-events-none"
46+
style={{ backgroundImage: `url('/patterns/${pattern}.svg')` }}
47+
/>
48+
)}
2749

2850
<div className="relative z-10 max-w-7xl mx-auto px-6 py-20">
2951

@@ -32,12 +54,12 @@ function SupportUsButton({
3254
initial={{ opacity: 0, y: 40 }}
3355
animate={{ opacity: 1, y: 0 }}
3456
transition={{ duration: 0.8 }}
35-
className="text-center mb-24"
57+
className={`text-center mb-24 ${classNames.Hero || ""}`}
3658
>
3759
<motion.div
3860
animate={{ scale: [1, 1.1, 1] }}
3961
transition={{ repeat: Infinity, duration: 2 }}
40-
className="w-16 h-16 mx-auto mb-6 rounded-full bg-gradient-to-r from-yellow-400 to-yellow-600 flex items-center justify-center shadow-lg"
62+
className="w-16 h-16 mx-auto mb-6 rounded-full bg-gradient-to-r from-yellow-400 to-yellow-600 flex items-center justify-center shadow-lg text-2xl"
4163
>
4264
❤️
4365
</motion.div>
@@ -46,7 +68,7 @@ function SupportUsButton({
4668
{hero.title}
4769
</h1>
4870

49-
<p className="text-gray-400 text-lg max-w-xl mx-auto">
71+
<p className={`${subTextClass} text-lg max-w-xl mx-auto`}>
5072
{hero.description}
5173
</p>
5274
</motion.div>
@@ -56,49 +78,51 @@ function SupportUsButton({
5678
initial={{ opacity: 0, y: 60 }}
5779
animate={{ opacity: 1, y: 0 }}
5880
transition={{ delay: 0.2 }}
59-
className="relative bg-white/5 backdrop-blur-2xl border border-white/10 rounded-3xl p-10 mb-24 shadow-[0_0_80px_rgba(255,215,0,0.15)]"
81+
className={`relative border rounded-3xl p-10 mb-24 shadow-[0_0_80px_rgba(255,215,0,0.1)] ${cardClass} ${classNames.organizationInformation || ""}`}
6082
>
6183
{hero.sponsorLabel && (
62-
<p className="text-yellow-400 text-xs uppercase tracking-widest mb-4">
84+
<p className="text-yellow-500 font-bold text-xs uppercase tracking-widest mb-4">
6385
{hero.sponsorLabel}
6486
</p>
6587
)}
6688

6789
<div className="flex items-center gap-6 flex-wrap">
68-
{/* Logo */}
6990
{logo ? (
7091
<img
7192
src={logo}
7293
alt={organizationInformation.name}
73-
className="w-20 h-20 rounded-xl object-cover bg-white"
94+
className="w-20 h-20 rounded-xl object-cover bg-white shadow-sm"
7495
/>
7596
) : (
76-
<div className="w-20 h-20 rounded-xl bg-gray-700 flex items-center justify-center">
77-
<span className="text-xs">No Logo</span>
97+
<div className={`w-20 h-20 rounded-xl flex items-center justify-center border-2 border-dashed ${
98+
isDark
99+
? "bg-white/5 border-white/10 text-gray-500"
100+
: "bg-gray-100 border-gray-300 text-gray-400"
101+
}`}>
102+
<span className="text-[10px] uppercase font-bold tracking-tighter">No Logo</span>
78103
</div>
79104
)}
80105

81-
{/* Org Info */}
106+
82107
<div>
83108
<h2 className="text-3xl font-bold">
84109
{organizationInformation.name}
85110
</h2>
86-
<p className="text-gray-400">
111+
<p className={subTextClass}>
87112
{organizationInformation.description}
88113
</p>
89114
</div>
90115
</div>
91116

92-
{/* PROJECT */}
93117
{organizationInformation.projectInformation && (
94-
<div className="mt-8 p-6 bg-black/40 rounded-xl border border-white/10">
95-
<p className="text-yellow-400 text-sm mb-1">
118+
<div className={`mt-8 p-6 rounded-xl border ${isDark ? "bg-black/40 border-white/10" : "bg-gray-50 border-gray-100"}`}>
119+
<p className="text-yellow-500 text-sm font-semibold mb-1">
96120
About Project
97121
</p>
98122
<h3 className="font-semibold">
99123
{organizationInformation.projectInformation.name}
100124
</h3>
101-
<p className="text-gray-400 italic">
125+
<p className={`${subTextClass} italic`}>
102126
"{organizationInformation.projectInformation.description}"
103127
</p>
104128
</div>
@@ -107,7 +131,7 @@ function SupportUsButton({
107131

108132
{/* ================= SPONSORS ================= */}
109133
{sponsors && sponsors.length > 0 && (
110-
<div className="mb-24">
134+
<div className={`mb-24 ${classNames.sponsors || ""}`}>
111135
<h2 className="text-4xl font-bold text-center mb-12">
112136
Our Sponsors
113137
</h2>
@@ -120,30 +144,25 @@ function SupportUsButton({
120144
target="_blank"
121145
rel="noopener noreferrer"
122146
whileHover={{ scale: 1.05 }}
123-
className="group relative bg-white/5 border border-white/10 rounded-2xl p-6 overflow-hidden"
147+
className={`group relative border rounded-2xl p-6 overflow-hidden transition-all ${cardClass}`}
124148
>
125-
{/* Glow */}
126-
<div className="absolute inset-0 opacity-0 group-hover:opacity-100 transition bg-gradient-to-r from-yellow-400/20 to-transparent blur-xl"></div>
149+
<div className="absolute inset-0 opacity-0 group-hover:opacity-100 transition bg-gradient-to-r from-yellow-400/10 to-transparent blur-xl"></div>
127150

128151
<div className="relative z-10 text-center">
129152
{s.logo ? (
130153
<img
131154
src={s.logo}
132155
alt={s.name}
133-
className="h-24 mx-auto object-contain mb-4"
156+
className="h-20 mx-auto object-contain mb-4 filter drop-shadow-sm"
134157
/>
135158
) : (
136-
<div className="h-24 flex items-center justify-center bg-gray-700 rounded">
137-
<span>No Logo</span>
159+
<div className={`h-20 flex items-center justify-center rounded mb-4 ${isDark ? "bg-gray-800" : "bg-gray-100"}`}>
160+
<span className="text-sm opacity-50">No Logo</span>
138161
</div>
139162
)}
140-
141163
<h3 className="font-semibold">{s.name}</h3>
142-
143164
{s.sponsorshipTier && (
144-
<p className="text-gray-400 text-sm">
145-
{s.sponsorshipTier}
146-
</p>
165+
<p className={`${subTextClass} text-sm`}>{s.sponsorshipTier}</p>
147166
)}
148167
</div>
149168
</motion.a>
@@ -157,13 +176,13 @@ function SupportUsButton({
157176
initial={{ opacity: 0, y: 60 }}
158177
animate={{ opacity: 1, y: 0 }}
159178
transition={{ delay: 0.3 }}
160-
className="text-center"
179+
className={`text-center ${classNames.ctaSection || ""}`}
161180
>
162181
<h2 className="text-4xl font-bold mb-4">
163182
{ctaSection.title}
164183
</h2>
165184

166-
<p className="text-gray-400 mb-8">
185+
<p className={`${subTextClass} mb-8`}>
167186
{ctaSection.description}
168187
</p>
169188

@@ -174,9 +193,13 @@ function SupportUsButton({
174193
href={link.url}
175194
target={link.newTab ? "_blank" : "_self"}
176195
rel="noopener noreferrer"
177-
whileHover={{ scale: 1.1 }}
196+
whileHover={{ scale: 1.05 }}
197+
whileTap={{ scale: 0.95 }}
178198
>
179-
<button className="px-6 py-3 rounded-xl bg-gradient-to-r from-yellow-400 to-yellow-600 text-black font-bold shadow-lg hover:shadow-yellow-500/30 transition">
199+
<button className={`px-8 py-4 rounded-xl font-bold shadow-lg transition-all
200+
${buttonVariant === "AOSSIE"
201+
? "bg-gradient-to-r from-yellow-400 to-yellow-600 text-black hover:shadow-yellow-500/40"
202+
: "bg-blue-600 text-white hover:bg-blue-700"}`}>
180203
{link.name}
181204
</button>
182205
</motion.a>
@@ -189,4 +212,4 @@ function SupportUsButton({
189212
);
190213
}
191214

192-
export default SupportUsButton;
215+
export default SupportUsButton;

src/styles/style.css

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
4-
1+
@import "tailwindcss";
52
/* Your custom theme */
63
:root {
74
--color-primary: #FFD700;
@@ -25,11 +22,10 @@
2522
}
2623

2724
/* Sponsor Patterns */
28-
.sponsor-pattern-AOSSIE {
29-
background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%2391c44a' fill-opacity='0.6'%3E%3Ccircle cx='15' cy='20' r='10'/%3E%3Crect x='5' y='40' width='20' height='20' rx='5'/%3E%3C/g%3E%3C/svg%3E");
25+
@utility sponsor-pattern-AOSSIE {
26+
background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org fill='%23fbbf24' fill-opacity='0.05' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3C/g%3E%3C/svg%3E");
3027
}
3128

32-
/* Grid Pattern */
33-
.sponsor-pattern-grid {
34-
background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%2391c44a' stroke-opacity='0.4' stroke-width='1'%3E%3Cpath d='M0 0H100M0 20H100M0 40H100M0 60H100M0 80H100M0 100H100'/%3E%3Cpath d='M0 0V100M20 0V100M40 0V100M60 0V100M80 0V100M100 0V100'/%3E%3C/g%3E%3C/svg%3E");
29+
@utility sponsor-pattern-grid {
30+
background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org d='M0 40L40 0H20L0 20M40 40V20L20 40' fill='%23fbbf24' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
3531
}

0 commit comments

Comments
 (0)