enzostvs HF Staff commited on
Commit
6f13480
·
1 Parent(s): c644c2c

discord modal update

Browse files
components/discord-promo-modal/index.tsx CHANGED
@@ -11,6 +11,41 @@ import Logo from "@/assets/logo.svg";
11
  const DISCORD_PROMO_KEY = "discord-promo-dismissed";
12
  const DISCORD_URL = "https://discord.gg/KpanwM3vXa";
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  export const DiscordPromoModal = () => {
15
  const [open, setOpen] = useState(false);
16
  const [dismissed, setDismissed] = useLocalStorage<boolean>(
@@ -40,7 +75,7 @@ export const DiscordPromoModal = () => {
40
  setDismissed(true);
41
 
42
  const expiryDate = new Date();
43
- expiryDate.setFullYear(expiryDate.getFullYear() + 1);
44
  document.cookie = `${DISCORD_PROMO_KEY}=true; expires=${expiryDate.toUTCString()}; path=/; SameSite=Lax`;
45
  };
46
 
@@ -52,104 +87,137 @@ export const DiscordPromoModal = () => {
52
  return (
53
  <Dialog open={open} onOpenChange={handleClose}>
54
  <DialogContent
55
- className="sm:max-w-md lg:!p-0 !rounded-3xl !bg-gradient-to-br !from-neutral-900 !via-neutral-800 !to-neutral-900 !border !border-neutral-700/50 overflow-hidden"
56
- showCloseButton={false}
57
  >
58
  <DialogTitle className="hidden" />
59
- <main className="flex flex-col items-center text-center relative p-8">
60
- <div className="absolute inset-0 overflow-hidden pointer-events-none">
61
- <div className="absolute top-0 left-0 w-32 h-32 bg-indigo-500/10 rounded-full blur-3xl animate-pulse" />
62
- <div className="absolute bottom-0 right-0 w-40 h-40 bg-purple-500/10 rounded-full blur-3xl animate-pulse delay-1000" />
 
 
 
 
 
 
63
  </div>
64
 
65
- <div className="relative z-10 w-full">
66
- <div className="inline-flex items-center justify-center mb-6 gap-3">
67
  <div className="relative">
68
- <div className="absolute inset-0 bg-white/10 rounded-xl blur-lg opacity-50 animate-pulse" />
69
- <div className="relative bg-gradient-to-br from-white/10 to-white/5 backdrop-blur-sm rounded-xl p-3 shadow-2xl border border-white/20">
70
- <Image
71
- src={Logo}
72
- alt="DeepSite"
73
- width={32}
74
- height={32}
75
- className="w-8 h-8"
76
- />
77
  </div>
78
- </div>
79
-
80
- <div className="text-white/40 text-2xl font-bold animate-pulse">
81
- +
82
- </div>
83
 
84
- <div className="relative">
85
- <div
86
- className="absolute inset-0 bg-indigo-500/80 rounded-xl blur-lg opacity-50 animate-pulse"
87
- style={{ animationDelay: "0.5s" }}
88
- />
89
- <div className="relative bg-indigo-500 backdrop-blur-sm rounded-xl p-3 shadow-2xl border border-indigo-500/30">
90
- <DiscordIcon className="size-8 text-whie" />
 
 
 
91
  </div>
92
  </div>
93
  </div>
 
94
 
95
- <h2 className="text-3xl font-bold text-white mb-3">
96
- Join Our Community! 🎉
97
- </h2>
98
-
99
- <p className="text-neutral-300 text-base mb-6 max-w-xs mx-auto leading-relaxed">
100
- Connect with other DeepSite users, get help, share your projects,
101
- and stay updated with the latest features!
102
- </p>
 
103
 
104
- <div className="flex flex-col gap-2 mb-8 text-left">
105
  {[
106
- { emoji: "💬", text: "Chat with the community" },
107
- { emoji: "🔔", text: "Get notified when new features drop" },
108
- { emoji: "🎨", text: "Share your creations" },
109
- { emoji: "🤝", text: "Get help from the team" },
110
  ].map((benefit, index) => (
111
  <div
112
  key={index}
113
- className="flex items-center gap-3 text-neutral-200 text-sm bg-white/5 rounded-lg px-4 py-2 backdrop-blur-sm border border-white/10"
114
  style={{
115
- animation: `slideIn 0.3s ease-out ${index * 0.1}s both`,
116
  }}
117
  >
118
- <span className="text-base">{benefit.emoji}</span>
119
- <span>{benefit.text}</span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  </div>
121
  ))}
122
  </div>
123
 
 
124
  <div className="flex flex-col gap-3 w-full">
125
  <Button
126
  onClick={handleJoinDiscord}
127
- className="w-full !h-12 !text-base font-semibold !bg-indigo-500 hover:!bg-indigo-600 !text-white !border-0 transform hover:scale-[1.02] transition-all duration-300"
128
  >
129
- <DiscordIcon className="size-4 mr-2" />
130
  Join Discord Community
131
  </Button>
132
- <button
133
- onClick={handleClose}
134
- className="text-neutral-400 hover:text-neutral-300 text-sm font-medium transition-colors"
135
- >
136
- Maybe later
137
- </button>
138
  </div>
139
- </div>
140
- </main>
141
 
142
  <style jsx>{`
143
- @keyframes slideIn {
144
  from {
145
  opacity: 0;
146
- transform: translateX(-10px);
147
  }
148
  to {
149
  opacity: 1;
150
- transform: translateX(0);
151
  }
152
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  `}</style>
154
  </DialogContent>
155
  </Dialog>
 
11
  const DISCORD_PROMO_KEY = "discord-promo-dismissed";
12
  const DISCORD_URL = "https://discord.gg/KpanwM3vXa";
13
 
14
+ const Sparkle = ({
15
+ size = "w-3 h-3",
16
+ delay = "0s",
17
+ top = "20%",
18
+ left = "20%",
19
+ }: {
20
+ size?: string;
21
+ delay?: string;
22
+ top?: string;
23
+ left?: string;
24
+ }) => (
25
+ <div
26
+ className={`absolute ${size}`}
27
+ style={{ top, left, animationDelay: delay }}
28
+ >
29
+ <svg
30
+ viewBox="0 0 24 24"
31
+ fill="none"
32
+ xmlns="http://www.w3.org/2000/svg"
33
+ className="w-full h-full animate-sparkle"
34
+ >
35
+ <path
36
+ d="M12 0L13.5 8.5L22 10L13.5 11.5L12 20L10.5 11.5L2 10L10.5 8.5L12 0Z"
37
+ fill="url(#sparkle-gradient)"
38
+ />
39
+ <defs>
40
+ <linearGradient id="sparkle-gradient" x1="2" y1="10" x2="22" y2="10">
41
+ <stop offset="0%" stopColor="#818cf8" />
42
+ <stop offset="100%" stopColor="#a5b4fc" />
43
+ </linearGradient>
44
+ </defs>
45
+ </svg>
46
+ </div>
47
+ );
48
+
49
  export const DiscordPromoModal = () => {
50
  const [open, setOpen] = useState(false);
51
  const [dismissed, setDismissed] = useLocalStorage<boolean>(
 
75
  setDismissed(true);
76
 
77
  const expiryDate = new Date();
78
+ expiryDate.setDate(expiryDate.getDate() + 5);
79
  document.cookie = `${DISCORD_PROMO_KEY}=true; expires=${expiryDate.toUTCString()}; path=/; SameSite=Lax`;
80
  };
81
 
 
87
  return (
88
  <Dialog open={open} onOpenChange={handleClose}>
89
  <DialogContent
90
+ className="sm:max-w-[480px] lg:!p-0 !rounded-3xl !bg-gradient-to-b !from-indigo-950/40 !via-neutral-900 !to-neutral-900 !border !border-neutral-800 overflow-hidden"
91
+ showCloseButton={true}
92
  >
93
  <DialogTitle className="hidden" />
94
+
95
+ <div className="relative">
96
+ <div className="absolute inset-0 bg-gradient-to-br from-indigo-500/10 via-indigo-500/5 to-transparent pointer-events-none" />
97
+
98
+ <div className="absolute inset-x-0 top-0 h-48 overflow-hidden pointer-events-none">
99
+ <Sparkle size="w-2 h-2" delay="0s" top="15%" left="15%" />
100
+ <Sparkle size="w-3 h-3" delay="0.5s" top="25%" left="75%" />
101
+ <Sparkle size="w-2 h-2" delay="1s" top="35%" left="20%" />
102
+ <Sparkle size="w-4 h-4" delay="1.5s" top="10%" left="80%" />
103
+ <Sparkle size="w-2 h-2" delay="2s" top="30%" left="85%" />
104
  </div>
105
 
106
+ <div className="relative pt-12 pb-8">
107
+ <div className="relative z-10 flex justify-center">
108
  <div className="relative">
109
+ <div className="absolute inset-0 bg-gradient-to-br from-indigo-400 via-indigo-500 to-indigo-600 rounded-full blur-md opacity-50" />
110
+ <div className="relative w-32 h-32 rounded-full bg-gradient-to-br from-neutral-900 via-neutral-800 to-neutral-900 p-1 shadow-2xl">
111
+ <div className="w-full h-full rounded-full bg-neutral-900 flex items-center justify-center overflow-hidden">
112
+ <div className="relative w-20 h-20 bg-gradient-to-br from-indigo-500 to-indigo-600 rounded-full flex items-center justify-center">
113
+ <DiscordIcon className="w-12 h-12 text-white" />
114
+ </div>
115
+ </div>
 
 
116
  </div>
 
 
 
 
 
117
 
118
+ <div className="absolute -bottom-2 -right-2 bg-gradient-to-br from-indigo-500 to-indigo-600 rounded-full p-0.5 shadow-xl border-2 border-neutral-900">
119
+ <div className="w-10 h-10 bg-neutral-900 rounded-full flex items-center justify-center">
120
+ <Image
121
+ src={Logo}
122
+ alt="DeepSite"
123
+ width={20}
124
+ height={20}
125
+ className="w-5 h-5"
126
+ />
127
+ </div>
128
  </div>
129
  </div>
130
  </div>
131
+ </div>
132
 
133
+ <main className="px-8 pb-8 pt-4">
134
+ <div className="text-center mb-6">
135
+ <h2 className="text-2xl font-bold text-white mb-2">
136
+ Ready to level up your DeepSite experience?
137
+ </h2>
138
+ <p className="text-neutral-400 text-sm">
139
+ Join the community and unlock exclusive perks
140
+ </p>
141
+ </div>
142
 
143
+ <div className="flex flex-col gap-3 mb-6">
144
  {[
145
+ "Get exclusive preview to new features",
146
+ "Share your projects and get feedback",
147
+ "Priority support from the team",
148
+ "Enjoy real-time updates",
149
  ].map((benefit, index) => (
150
  <div
151
  key={index}
152
+ className="flex items-start gap-3 text-neutral-200"
153
  style={{
154
+ animation: `fadeIn 0.4s ease-out ${index * 0.1}s both`,
155
  }}
156
  >
157
+ <div className="flex-shrink-0 w-5 h-5 rounded-full bg-gradient-to-br from-indigo-500 to-indigo-600 flex items-center justify-center mt-0.5">
158
+ <svg
159
+ className="w-3 h-3 text-white"
160
+ fill="none"
161
+ viewBox="0 0 24 24"
162
+ stroke="currentColor"
163
+ >
164
+ <path
165
+ strokeLinecap="round"
166
+ strokeLinejoin="round"
167
+ strokeWidth={3}
168
+ d="M5 13l4 4L19 7"
169
+ />
170
+ </svg>
171
+ </div>
172
+ <span className="text-sm leading-6">{benefit}</span>
173
  </div>
174
  ))}
175
  </div>
176
 
177
+ {/* CTA Button */}
178
  <div className="flex flex-col gap-3 w-full">
179
  <Button
180
  onClick={handleJoinDiscord}
181
+ className="w-full !h-12 !text-base font-semibold !bg-gradient-to-r !from-indigo-500 !to-indigo-600 hover:!from-indigo-600 hover:!to-indigo-700 !text-white !border-0 transform hover:scale-[1.02] transition-all duration-200 shadow-lg shadow-indigo-500/25"
182
  >
183
+ <DiscordIcon className="w-5 h-5 mr-2" />
184
  Join Discord Community
185
  </Button>
186
+
187
+ <p className="text-center text-xs text-neutral-500">
188
+ Free to join. Connect instantly.
189
+ </p>
 
 
190
  </div>
191
+ </main>
192
+ </div>
193
 
194
  <style jsx>{`
195
+ @keyframes fadeIn {
196
  from {
197
  opacity: 0;
198
+ transform: translateY(5px);
199
  }
200
  to {
201
  opacity: 1;
202
+ transform: translateY(0);
203
  }
204
  }
205
+
206
+ @keyframes sparkle {
207
+ 0%,
208
+ 100% {
209
+ opacity: 0;
210
+ transform: scale(0) rotate(0deg);
211
+ }
212
+ 50% {
213
+ opacity: 1;
214
+ transform: scale(1) rotate(180deg);
215
+ }
216
+ }
217
+
218
+ :global(.animate-sparkle) {
219
+ animation: sparkle 2s ease-in-out infinite;
220
+ }
221
  `}</style>
222
  </DialogContent>
223
  </Dialog>