Skip to content

Commit 7a353d1

Browse files
authored
refactor(home): update button, cards, and online counter UI (#248)
Improve primary button styles Fix card overflow and add subtle highlights Redesign online users counter and reduce font size
1 parent f1730f3 commit 7a353d1

6 files changed

Lines changed: 252 additions & 182 deletions

File tree

frontend/app/globals.css

Lines changed: 9 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -210,71 +210,6 @@
210210
}
211211
}
212212

213-
@keyframes wave-slide-up {
214-
0% {
215-
clip-path: polygon(
216-
0% 100%,
217-
10% 100%,
218-
20% 100%,
219-
30% 100%,
220-
40% 100%,
221-
50% 100%,
222-
60% 100%,
223-
70% 100%,
224-
80% 100%,
225-
90% 100%,
226-
100% 100%,
227-
100% 100%,
228-
0% 100%
229-
);
230-
}
231-
50% {
232-
clip-path: polygon(
233-
0% 60%,
234-
10% 50%,
235-
20% 45%,
236-
30% 48%,
237-
40% 55%,
238-
50% 50%,
239-
60% 45%,
240-
70% 48%,
241-
80% 52%,
242-
90% 50%,
243-
100% 55%,
244-
100% 100%,
245-
0% 100%
246-
);
247-
}
248-
100% {
249-
clip-path: polygon(
250-
0% 0%,
251-
10% 0%,
252-
20% 0%,
253-
30% 0%,
254-
40% 0%,
255-
50% 0%,
256-
60% 0%,
257-
70% 0%,
258-
80% 0%,
259-
90% 0%,
260-
100% 0%,
261-
100% 100%,
262-
0% 100%
263-
);
264-
}
265-
}
266-
267-
@keyframes text-fade-in {
268-
0% {
269-
opacity: 0;
270-
transform: translateY(4px);
271-
}
272-
100% {
273-
opacity: 1;
274-
transform: translateY(0);
275-
}
276-
}
277-
278213
@keyframes card-breathe {
279214
0% {
280215
transform: translate(0, 0) scale(1) rotate(var(--card-rotate, 0deg));
@@ -297,36 +232,24 @@
297232
animation: slide-up-gradient 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
298233
}
299234

300-
.animate-wave-slide-up {
301-
animation: wave-slide-up 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
302-
}
303-
304-
.animate-text-fade-in {
305-
animation: text-fade-in 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
306-
}
307-
308235
.animate-card-breathe {
309236
animation: card-breathe 6s ease-in-out infinite;
310237
will-change: transform;
311238
}
312239

313-
.left-4 .animate-card-breathe,
314-
.md\:left-6 .animate-card-breathe,
315-
.lg\:left-8 .animate-card-breathe,
316-
.xl\:left-12 .animate-card-breathe {
317-
--card-x: -30px;
318-
--card-y: -25px;
240+
.lg\:left-16.animate-card-breathe {
241+
transform: rotate(-10deg);
242+
--card-x: -20px;
243+
--card-y: -15px;
319244
--card-rotate: -10deg;
320245
--card-rotate-offset: -3deg;
321246
animation-delay: 0s;
322247
}
323248

324-
.right-4 .animate-card-breathe,
325-
.md\:right-6 .animate-card-breathe,
326-
.lg\:right-8 .animate-card-breathe,
327-
.xl\:right-12 .animate-card-breathe {
328-
--card-x: 30px;
329-
--card-y: 25px;
249+
.lg\:right-20.animate-card-breathe {
250+
transform: rotate(8deg);
251+
--card-x: 20px;
252+
--card-y: 15px;
330253
--card-rotate: 8deg;
331254
--card-rotate-offset: 3deg;
332255
animation-delay: 0.8s;
@@ -376,7 +299,7 @@
376299
.shop-scope {
377300
/* keep shop rounding slightly tighter than platform */
378301
--radius: calc(var(--radius-base) - 2px);
379-
302+
380303
/* Shop header/button accent in LIGHT: no platform blue */
381304
--accent-primary: var(--foreground);
382305
--accent-hover: color-mix(in oklab, var(--foreground) 92%, white);

frontend/components/home/CodeCard.tsx

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,26 @@ interface CodeCardProps {
99
export function CodeCard({ fileName, snippet, className }: CodeCardProps) {
1010
return (
1111
<div
12-
className={`pointer-events-none absolute hidden md:block ${className}`}
12+
className={`pointer-events-none absolute hidden lg:block ${className} animate-card-breathe`}
1313
aria-hidden="true"
1414
>
15-
<div className="rounded-2xl border border-border bg-card/60 backdrop-blur-xl shadow-xl dark:shadow-black/50 px-5 py-4 min-w-[230px] animate-card-breathe">
16-
<div className="flex items-center justify-between mb-3 text-[10px] text-muted-foreground">
17-
<div className="flex items-center gap-1.5">
18-
<span className="h-2 w-2 rounded-full bg-red-400/90" />
19-
<span className="h-2 w-2 rounded-full bg-yellow-400/90" />
20-
<span className="h-2 w-2 rounded-full bg-green-400/90" />
15+
<div className="absolute top-1/3 -left-4 -right-4 -bottom-6 bg-[var(--accent-primary)]/8 rounded-3xl blur-2xl" />
16+
17+
<div className="absolute top-1/2 -left-2 -right-2 -bottom-4 bg-[var(--accent-primary)]/12 rounded-2xl blur-xl" />
18+
19+
<div className="absolute top-2/3 -left-1 -right-1 -bottom-2 bg-[var(--accent-primary)]/15 rounded-2xl blur-md" />
20+
21+
<div className="relative rounded-2xl border border-[var(--accent-primary)]/20 bg-card/90 backdrop-blur-xl shadow-2xl dark:shadow-[var(--accent-primary)]/10 px-3.5 py-3 min-w-[180px] max-w-[200px] overflow-hidden">
22+
<div className="flex items-center justify-between mb-2 text-[9px] text-muted-foreground/80">
23+
<div className="flex items-center gap-1">
24+
<span className="h-1.5 w-1.5 rounded-full bg-red-400/80 shadow-sm" />
25+
<span className="h-1.5 w-1.5 rounded-full bg-yellow-400/80 shadow-sm" />
26+
<span className="h-1.5 w-1.5 rounded-full bg-green-400/80 shadow-sm" />
2127
</div>
22-
<span className="font-medium">{fileName}</span>
28+
<span className="font-medium text-[8.5px]">{fileName}</span>
2329
</div>
24-
<code className="text-[11px] whitespace-pre leading-relaxed font-mono text-foreground/90">
30+
31+
<code className="text-[10px] whitespace-pre leading-relaxed font-mono text-foreground/85 block relative z-10">
2532
{snippet}
2633
</code>
2734
</div>

frontend/components/home/HeroCodeCards.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export function HeroCodeCards() {
55
<>
66
<CodeCard
77
fileName="arrays.ts"
8-
className="left-4 md:left-10 lg:left-8 xl:left-12 -top-2 md:-top-12 lg:-top-8 xl:-top-12 rotate-[-10deg]"
8+
className="lg:left-16 lg:top-0"
99
snippet={
1010
<>
1111
<span className="text-[var(--accent-primary)]">type</span> Arr1 = [
@@ -31,7 +31,7 @@ export function HeroCodeCards() {
3131

3232
<CodeCard
3333
fileName="utils.js"
34-
className="right-4 md:right-4 lg:right-8 xl:right-12 -bottom-2 md:-bottom-6 lg:-bottom-8 xl:-bottom-12 rotate-[8deg]"
34+
className="lg:right-20 lg:bottom-16"
3535
snippet={
3636
<>
3737
<span className="text-[var(--accent-primary)]">function</span> sum(

frontend/components/home/HeroSection.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ sm:min-h-[calc(100vh-280px)] md:min-h-[85vh] lg:min-h-[100vh]
2626
<div className="relative max-w-5xl mx-auto w-full px-6 py-8 sm:py-12 md:py-28 lg:py-[7.5rem] xl:py-32 flex flex-col items-center text-center">
2727
<HeroCodeCards />
2828

29-
<p className="text-[11px] sm:text-xs md:text-sm tracking-[0.35em] uppercase text-foreground font-bold">
29+
<p className="text-[11px] sm:text-xs lg:text-sm tracking-[0.35em] uppercase text-foreground/90 font-bold">
3030
{t('subtitle')}
3131
</p>
3232

33-
<div className="mt-6 sm:mt-8 md:mt-14 lg:mt-16 relative inline-block">
34-
<h1 className="text-5xl sm:text-6xl md:text-7xl lg:text-8xl xl:text-9xl font-black tracking-tight relative inline-block">
33+
<div className="mt-6 sm:mt-8 lg:mt-14 relative inline-block">
34+
<h1 className="min-[375px]:text-[3.5rem] text-5xl sm:text-7xl md:text-[5rem] lg:text-8xl xl:text-[100px] font-black tracking-tight relative inline-block px-4">
3535
<span className="relative inline-block bg-gradient-to-r from-[var(--accent-primary)]/70 via-[color-mix(in_srgb,var(--accent-primary)_70%,white)]/70 to-[var(--accent-hover)]/70 bg-clip-text text-transparent">
3636
DevLovers
3737
</span>
@@ -45,7 +45,7 @@ sm:min-h-[calc(100vh-280px)] md:min-h-[85vh] lg:min-h-[100vh]
4545
</h1>
4646
</div>
4747

48-
<p className="mt-4 sm:mt-6 md:mt-10 lg:mt-12 max-w-2xl text-sm sm:text-base md:text-lg text-muted-foreground font-light">
48+
<p className="mt-4 sm:mt-6 md:mt-10 lg:mt-12 md:max-w-xl lg:max-w-2xl text-sm sm:text-sm lg:text-base text-muted-foreground font-light">
4949
{t('description')}
5050
</p>
5151

0 commit comments

Comments
 (0)