Skip to content

Commit 0d05762

Browse files
ui: update trending technologies layout
1 parent fa9659d commit 0d05762

1 file changed

Lines changed: 30 additions & 28 deletions

File tree

‎frontend/src/app/trends/page.tsx‎

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { TrendingUp, TrendingDown, Minus, BarChart3, Filter, Loader2, Star, Shar
66
import { type Tool, fetchTools, fetchCategories } from "@/data/trends";
77
import DashboardShell from "@/components/DashboardShell";
88
import FilterBar from "@/components/FilterBar";
9+
import WatchlistButton from "@/components/WatchlistButton";
910
import { useGSAP } from "@gsap/react";
1011
import gsap from "gsap";
1112
import {
@@ -49,7 +50,7 @@ function CircularProgressArc({ value, size = 64, strokeWidth = 5.5 }: { value: n
4950
cx={size / 2}
5051
cy={size / 2}
5152
r={radius}
52-
stroke="rgba(20, 23, 38, 0.10)"
53+
style={{ stroke: "var(--c-border)" }}
5354
strokeWidth={strokeWidth}
5455
fill="transparent"
5556
/>
@@ -68,7 +69,7 @@ function CircularProgressArc({ value, size = 64, strokeWidth = 5.5 }: { value: n
6869
/>
6970
</svg>
7071
<div className="absolute flex flex-col items-center">
71-
<span className="text-sm font-mono font-black text-[#141726]">{value}</span>
72+
<span className="text-sm font-mono font-black text-[var(--c-ink)]">{value}</span>
7273
</div>
7374
</div>
7475
);
@@ -100,7 +101,7 @@ function MiniSparkline({ data, width = 90, height = 30 }: { data: number[]; widt
100101
// no fabricated curve. Fills in as the scraper accumulates daily snapshots.
101102
if (clean.length < 2 || distinct < 2) {
102103
return (
103-
<div className="flex items-center gap-1.5 text-[9px] font-mono uppercase tracking-widest text-[#5A6072]/40">
104+
<div className="flex items-center gap-1.5 text-[9px] font-mono uppercase tracking-widest text-[var(--c-ink-2)]/40">
104105
<span className="inline-block w-6 h-px bg-[#5A6072]/25" />
105106
{clean.length === 0 ? "new" : "stable"}
106107
</div>
@@ -135,7 +136,7 @@ function MiniSparkline({ data, width = 90, height = 30 }: { data: number[]; widt
135136
opacity="0.85"
136137
/>
137138
</svg>
138-
<span className="text-[9px] font-mono text-[#5A6072]/40 uppercase tracking-widest">7d history</span>
139+
<span className="text-[9px] font-mono text-[var(--c-ink-2)]/40 uppercase tracking-widest">7d history</span>
139140
</div>
140141
);
141142
}
@@ -216,7 +217,7 @@ export default function TrendsPage() {
216217
<div className="space-y-8 relative z-10 pb-12">
217218

218219
{/* Opacity blurred header section */}
219-
<header className="p-6 md:p-8 rounded-2xl border border-indigo-500/10 bg-[#FFFFFF]/80 backdrop-blur-md space-y-3 relative overflow-hidden">
220+
<header className="p-6 md:p-8 rounded-2xl border border-indigo-500/10 bg-[var(--c-surface)]/80 backdrop-blur-md space-y-3 relative overflow-hidden">
220221
<div className="absolute inset-0 bg-gradient-to-r from-indigo-500/5 to-transparent pointer-events-none" />
221222

222223
<div className="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4">
@@ -230,7 +231,7 @@ export default function TrendsPage() {
230231
</span>
231232
<h1 className="text-3xl md:text-4xl font-extrabold tracking-tight font-display flex items-center gap-3">
232233
<TrendingUp className="w-8 h-8 text-indigo-600" />
233-
<span className="gradient-text">Trends Intelligence</span>
234+
<span className="text-text-primary">Trends Intelligence</span>
234235
</h1>
235236
</div>
236237

@@ -241,12 +242,12 @@ export default function TrendsPage() {
241242
alert("Trends URL copied to clipboard!");
242243
}
243244
}}
244-
className="flex items-center gap-2 px-3 py-1.5 rounded-lg border border-indigo-500/15 bg-[#F1F3FA] hover:bg-[#F1F3FA]/80 text-xs font-mono hover:text-[#141726] transition-all active:scale-95"
245+
className="flex items-center gap-2 px-3 py-1.5 rounded-lg border border-indigo-500/15 bg-[var(--c-surface-2)] hover:bg-[var(--c-surface-2)]/80 text-xs font-mono hover:text-[var(--c-ink)] transition-all active:scale-95"
245246
>
246247
<Share2 className="w-3.5 h-3.5" /> SHARE_URL
247248
</button>
248249
</div>
249-
<p className="text-sm text-[#5A6072] max-w-xl font-light">
250+
<p className="text-sm text-[var(--c-ink-2)] max-w-xl font-light">
250251
Every tracked technology, scored 0–100 by live momentum from GitHub stars and developer conversation. Sort by what&apos;s rising, most-starred, or most-discussed.
251252
</p>
252253
</header>
@@ -261,7 +262,7 @@ export default function TrendsPage() {
261262
showIcon={false}
262263
className="glass p-1 rounded-xl flex items-center gap-1.5 overflow-x-auto w-fit max-w-full shadow-md"
263264
prefixNode={
264-
<div className="flex items-center gap-1.5 pl-3 pr-1 text-[#5A6072] shrink-0 select-none">
265+
<div className="flex items-center gap-1.5 pl-3 pr-1 text-[var(--c-ink-2)] shrink-0 select-none">
265266
<Filter className="w-4 h-4 text-indigo-600" />
266267
<span className="text-xs font-mono font-bold uppercase tracking-wider">DOMAIN:</span>
267268
</div>
@@ -271,7 +272,7 @@ export default function TrendsPage() {
271272
<div className="flex flex-wrap items-center gap-4">
272273
{/* Sort control */}
273274
<div className="glass p-1 rounded-xl flex items-center gap-1 w-fit shadow-md">
274-
<div className="flex items-center gap-1.5 pl-3 pr-1 text-[#5A6072] shrink-0 select-none">
275+
<div className="flex items-center gap-1.5 pl-3 pr-1 text-[var(--c-ink-2)] shrink-0 select-none">
275276
<ArrowUpDown className="w-4 h-4 text-indigo-600" />
276277
<span className="text-xs font-mono font-bold uppercase tracking-wider">SORT:</span>
277278
</div>
@@ -282,24 +283,24 @@ export default function TrendsPage() {
282283
className={`px-3 py-1.5 rounded-lg text-xs font-mono transition-all cursor-pointer select-none ${
283284
sortBy === s.key
284285
? "bg-indigo-500/15 text-indigo-700 font-bold"
285-
: "text-[#5A6072] hover:text-[#141726]"
286+
: "text-[var(--c-ink-2)] hover:text-[var(--c-ink)]"
286287
}`}
287288
>
288289
{s.label}
289290
</button>
290291
))}
291292
</div>
292293

293-
<div className="text-xs font-mono text-[#5A6072]/60">
294-
SHOWING <span className="text-[#141726] font-bold">{displayedTools.length}</span> TECHNOLOGIES
294+
<div className="text-xs font-mono text-[var(--c-ink-2)]/60">
295+
SHOWING <span className="text-[var(--c-ink)] font-bold">{displayedTools.length}</span> TECHNOLOGIES
295296
</div>
296297
</div>
297298
</div>
298299

299300
{isLoading ? (
300-
<div className="h-96 rounded-2xl border border-indigo-500/5 bg-[#F1F3FA]/50 flex flex-col items-center justify-center gap-3 animate-pulse">
301+
<div className="h-96 rounded-2xl border border-indigo-500/5 bg-[var(--c-surface-2)]/50 flex flex-col items-center justify-center gap-3 animate-pulse">
301302
<Loader2 className="w-8 h-8 text-indigo-600 animate-spin" />
302-
<span className="text-xs font-mono text-[#5A6072]/70">Retrieving index details...</span>
303+
<span className="text-xs font-mono text-[var(--c-ink-2)]/70">Retrieving index details...</span>
303304
</div>
304305
) : (
305306
<div className="space-y-8">
@@ -359,7 +360,7 @@ export default function TrendsPage() {
359360
<div className="tech-panel rounded-2xl overflow-hidden">
360361

361362
{/* Header row */}
362-
<div className="hidden md:grid grid-cols-12 gap-4 px-6 py-4 bg-[#F7F8FC] border-b border-[rgba(20,23,38,0.10)] font-mono text-[10px] text-[#5A6072] tracking-widest uppercase">
363+
<div className="hidden md:grid grid-cols-12 gap-4 px-6 py-4 bg-[var(--c-surface-2)] border-b border-[var(--c-border)] font-mono text-[10px] text-[var(--c-ink-2)] tracking-widest uppercase">
363364
<div className="col-span-4">TECHNOLOGY DETAILS</div>
364365
<div className="col-span-2 text-center">TREND SCORE</div>
365366
<div className="col-span-2">GROWTH STAGE</div>
@@ -369,7 +370,7 @@ export default function TrendsPage() {
369370

370371
{/* Data Rows */}
371372
{displayedTools.length === 0 ? (
372-
<div className="p-12 text-center text-[#5A6072] font-mono text-sm">
373+
<div className="p-12 text-center text-[var(--c-ink-2)] font-mono text-sm">
373374
No technologies monitored under this filter.
374375
</div>
375376
) : (
@@ -382,60 +383,61 @@ export default function TrendsPage() {
382383
? { Icon: TrendingUp, label: `+${g.toFixed(1)}%`, cls: "text-emerald-600 bg-emerald-500/5 border-emerald-500/10" }
383384
: g < 0
384385
? { Icon: TrendingDown, label: `${g.toFixed(1)}%`, cls: "text-rose-600 bg-rose-500/5 border-rose-500/10" }
385-
: { Icon: Minus, label: "stable", cls: "text-[#5A6072]/70 bg-[#5A6072]/[0.06] border-[#5A6072]/20" };
386+
: { Icon: Minus, label: "stable", cls: "text-[var(--c-ink-2)]/70 bg-[#5A6072]/[0.06] border-[#5A6072]/20" };
386387

387388
return (
388389
<div
389390
key={tool.slug}
390-
className="trend-list-row grid grid-cols-1 md:grid-cols-12 gap-4 items-center px-6 py-5 bg-[#F1F3FA]/10 hover:bg-[#F1F3FA]/50 transition-all duration-200"
391+
className="trend-list-row grid grid-cols-1 md:grid-cols-12 gap-4 items-center px-6 py-5 bg-[var(--c-surface-2)]/10 hover:bg-[var(--c-surface-2)]/50 transition-all duration-200"
391392
>
392393
{/* 1. Name & Info */}
393394
<div className="col-span-4 flex items-center gap-3">
394-
<span className="text-3xl p-2 bg-[#F7F8FC] border border-[rgba(20,23,38,0.10)] rounded-lg select-none">
395+
<span className="text-3xl p-2 bg-[var(--c-surface-2)] border border-[var(--c-border)] rounded-lg select-none">
395396
{tool.icon}
396397
</span>
397398
<div>
398399
<div className="flex items-center gap-2">
399-
<h3 className="font-bold text-sm text-[#141726] hover:text-indigo-600 transition-colors">
400+
<h3 className="font-bold text-sm text-[var(--c-ink)] hover:text-indigo-600 transition-colors">
400401
<Link href={`/tools/${tool.slug}`}>{tool.name}</Link>
401402
</h3>
402403
<span className={`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[8px] font-mono font-bold border ${trend.cls}`}>
403404
<trend.Icon className="w-2.5 h-2.5" />
404405
{trend.label}
405406
</span>
406407
</div>
407-
<span className="text-[10px] font-mono text-[#5A6072]">{tool.category}</span>
408+
<span className="text-[10px] font-mono text-[var(--c-ink-2)]">{tool.category}</span>
408409
</div>
410+
<WatchlistButton toolSlug={tool.slug} className="ml-auto shrink-0" />
409411
</div>
410412

411413
{/* 2. Circular progress gauge */}
412414
<div className="col-span-2 flex items-center justify-start md:justify-center">
413-
<span className="md:hidden text-xs font-mono text-[#5A6072]/60 mr-4">TREND SCORE:</span>
415+
<span className="md:hidden text-xs font-mono text-[var(--c-ink-2)]/60 mr-4">TREND SCORE:</span>
414416
<CircularProgressArc value={tool.score} />
415417
</div>
416418

417419
{/* 3. Growth stage */}
418420
<div className="col-span-2">
419-
<span className="md:hidden text-xs font-mono text-[#5A6072]/60 mr-2">STAGE:</span>
420-
<span className="px-2.5 py-1 rounded bg-[#F7F8FC] border border-[rgba(20,23,38,0.10)] text-xs font-mono uppercase tracking-wider text-indigo-600">
421+
<span className="md:hidden text-xs font-mono text-[var(--c-ink-2)]/60 mr-2">STAGE:</span>
422+
<span className="px-2.5 py-1 rounded bg-[var(--c-surface-2)] border border-[var(--c-border)] text-xs font-mono uppercase tracking-wider text-indigo-600">
421423
{tool.stage}
422424
</span>
423425
</div>
424426

425427
{/* 4. Mini Sparkline */}
426428
<div className="col-span-2 flex justify-start md:justify-center">
427-
<span className="md:hidden text-xs font-mono text-[#5A6072]/60 mr-4">HISTORICAL:</span>
429+
<span className="md:hidden text-xs font-mono text-[var(--c-ink-2)]/60 mr-4">HISTORICAL:</span>
428430
<MiniSparkline data={tool.last_7_scores} />
429431
</div>
430432

431433
{/* 5. Telemetry details */}
432434
<div className="col-span-2 text-left md:text-right space-y-1">
433-
<div className="flex items-center md:justify-end gap-1 text-[11px] font-mono text-[#5A6072]">
435+
<div className="flex items-center md:justify-end gap-1 text-[11px] font-mono text-[var(--c-ink-2)]">
434436
<Star className="w-3.5 h-3.5 text-amber-500 fill-amber-500" />
435437
<span>{tool.stars >= 1000 ? `${(tool.stars / 1000).toFixed(1)}k` : tool.stars} stars</span>
436438
</div>
437439

438-
<div className="flex items-center md:justify-end gap-1 text-[10px] font-mono text-[#5A6072]/50">
440+
<div className="flex items-center md:justify-end gap-1 text-[10px] font-mono text-[var(--c-ink-2)]/50">
439441
<MessageSquare className="w-3 h-3" />
440442
<span>{tool.hn_count + tool.reddit_count + tool.devto_count + tool.news_count} mentions</span>
441443
</div>

0 commit comments

Comments
 (0)