Commit
Β·
b73b7f6
1
Parent(s):
2a215c2
improve colors and layout
Browse files- components/CategoryCard.tsx +28 -20
- lib/categories.tsx +6 -6
- lib/utils.ts +10 -10
components/CategoryCard.tsx
CHANGED
@@ -12,40 +12,48 @@ const CategoryCard: React.FC<CategoryCardProps> = ({
|
|
12 |
description,
|
13 |
status,
|
14 |
graphic: Graphic,
|
15 |
-
slug
|
16 |
}) => {
|
17 |
const { bg, text, gradient, iconBg } = getColorConfig(colorName);
|
18 |
const isComingSoon = status === 'Coming Soon';
|
19 |
|
20 |
-
|
21 |
-
|
22 |
{(status === 'New' || status === 'Coming Soon') && (
|
23 |
-
<div className={`absolute top-
|
24 |
{status}
|
25 |
</div>
|
26 |
)}
|
27 |
-
<div className="
|
28 |
-
<div className=
|
29 |
-
<
|
|
|
|
|
|
|
30 |
</div>
|
31 |
-
<h2 className="text-xl font-bold">{title}</h2>
|
32 |
</div>
|
33 |
-
<div className="
|
34 |
<Graphic />
|
35 |
</div>
|
36 |
-
<p className="text-sm font-medium
|
|
|
|
|
|
|
|
|
|
|
37 |
{isComingSoon ? (
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
44 |
) : (
|
45 |
-
<Link href={`/
|
46 |
-
<
|
47 |
-
View Tools
|
48 |
-
</a>
|
49 |
</Link>
|
50 |
)}
|
51 |
</div>
|
|
|
12 |
description,
|
13 |
status,
|
14 |
graphic: Graphic,
|
15 |
+
slug,
|
16 |
}) => {
|
17 |
const { bg, text, gradient, iconBg } = getColorConfig(colorName);
|
18 |
const isComingSoon = status === 'Coming Soon';
|
19 |
|
20 |
+
const CardContent = () => (
|
21 |
+
<>
|
22 |
{(status === 'New' || status === 'Coming Soon') && (
|
23 |
+
<div className={`absolute top-4 right-4 ${bg} ${text} text-xs font-bold py-1 px-2 rounded-full`}>
|
24 |
{status}
|
25 |
</div>
|
26 |
)}
|
27 |
+
<div className="mb-2">
|
28 |
+
<div className="flex items-center">
|
29 |
+
<div className={`${iconBg} ${text} p-2 rounded-full mr-3`}>
|
30 |
+
<Icon size={20} />
|
31 |
+
</div>
|
32 |
+
<h2 className="text-xl font-bold">{title}</h2>
|
33 |
</div>
|
|
|
34 |
</div>
|
35 |
+
<div className="flex-grow px-8 py-4">
|
36 |
<Graphic />
|
37 |
</div>
|
38 |
+
<p className="text-sm font-medium leading-tight mt-2">{description}</p>
|
39 |
+
</>
|
40 |
+
);
|
41 |
+
|
42 |
+
return (
|
43 |
+
<div className={`rounded-xl p-6 text-white w-92 h-72 flex flex-col relative shadow-lg transition-transform duration-300 ease-in-out hover:scale-105 ${gradient}`}>
|
44 |
{isComingSoon ? (
|
45 |
+
<>
|
46 |
+
<CardContent />
|
47 |
+
<button
|
48 |
+
className="w-full bg-white opacity-50 cursor-not-allowed py-2 px-3 rounded-lg text-xs transition-colors mt-3 text-black font-extrabold"
|
49 |
+
disabled
|
50 |
+
>
|
51 |
+
Coming Soon
|
52 |
+
</button>
|
53 |
+
</>
|
54 |
) : (
|
55 |
+
<Link href={`/category/${slug}`} className="flex flex-col flex-grow">
|
56 |
+
<CardContent />
|
|
|
|
|
57 |
</Link>
|
58 |
)}
|
59 |
</div>
|
lib/categories.tsx
CHANGED
@@ -14,7 +14,7 @@ export const categories: Category[] = [
|
|
14 |
slug: "segment",
|
15 |
icon: Scissors,
|
16 |
description: "Slice and dice images with precision. Carve out objects and backgrounds like a digital sculptor.",
|
17 |
-
status: "
|
18 |
colorName: "indigo",
|
19 |
graphic: SegmentationIcon
|
20 |
},
|
@@ -23,7 +23,7 @@ export const categories: Category[] = [
|
|
23 |
slug: "embed",
|
24 |
icon: Sparkles,
|
25 |
description: "Transform words and pixels into mathematical magic.",
|
26 |
-
status: "
|
27 |
colorName: "teal",
|
28 |
graphic: EmbeddingIcon
|
29 |
},
|
@@ -32,7 +32,7 @@ export const categories: Category[] = [
|
|
32 |
slug: "transcribe",
|
33 |
icon: Mic,
|
34 |
description: "AI that hears all and forgets nothing (except the 'uhms').",
|
35 |
-
status: "
|
36 |
colorName: "rose",
|
37 |
graphic: TranscriptionIcon
|
38 |
},
|
@@ -41,7 +41,7 @@ export const categories: Category[] = [
|
|
41 |
slug: "sentiment",
|
42 |
icon: Smile,
|
43 |
description: "Read between the lines. From π€ to π , we've got feelings figured out.",
|
44 |
-
status: "
|
45 |
colorName: "amber",
|
46 |
graphic: SentimentAnalysisIcon
|
47 |
},
|
@@ -50,7 +50,7 @@ export const categories: Category[] = [
|
|
50 |
slug: "classify",
|
51 |
icon: Tags,
|
52 |
description: "Sort the digital chaos.",
|
53 |
-
status: "
|
54 |
colorName: "purple",
|
55 |
graphic: ClassificationIcon
|
56 |
},
|
@@ -59,7 +59,7 @@ export const categories: Category[] = [
|
|
59 |
slug: "generate-text",
|
60 |
icon: Type,
|
61 |
description: "Llama. Qwen. Enough said.",
|
62 |
-
status: "
|
63 |
colorName: "blue",
|
64 |
graphic: TextGenerationIcon
|
65 |
}
|
|
|
14 |
slug: "segment",
|
15 |
icon: Scissors,
|
16 |
description: "Slice and dice images with precision. Carve out objects and backgrounds like a digital sculptor.",
|
17 |
+
status: "Available",
|
18 |
colorName: "indigo",
|
19 |
graphic: SegmentationIcon
|
20 |
},
|
|
|
23 |
slug: "embed",
|
24 |
icon: Sparkles,
|
25 |
description: "Transform words and pixels into mathematical magic.",
|
26 |
+
status: "Available",
|
27 |
colorName: "teal",
|
28 |
graphic: EmbeddingIcon
|
29 |
},
|
|
|
32 |
slug: "transcribe",
|
33 |
icon: Mic,
|
34 |
description: "AI that hears all and forgets nothing (except the 'uhms').",
|
35 |
+
status: "Available",
|
36 |
colorName: "rose",
|
37 |
graphic: TranscriptionIcon
|
38 |
},
|
|
|
41 |
slug: "sentiment",
|
42 |
icon: Smile,
|
43 |
description: "Read between the lines. From π€ to π , we've got feelings figured out.",
|
44 |
+
status: "Available",
|
45 |
colorName: "amber",
|
46 |
graphic: SentimentAnalysisIcon
|
47 |
},
|
|
|
50 |
slug: "classify",
|
51 |
icon: Tags,
|
52 |
description: "Sort the digital chaos.",
|
53 |
+
status: "Available",
|
54 |
colorName: "purple",
|
55 |
graphic: ClassificationIcon
|
56 |
},
|
|
|
59 |
slug: "generate-text",
|
60 |
icon: Type,
|
61 |
description: "Llama. Qwen. Enough said.",
|
62 |
+
status: "Available",
|
63 |
colorName: "blue",
|
64 |
graphic: TextGenerationIcon
|
65 |
}
|
lib/utils.ts
CHANGED
@@ -16,61 +16,61 @@ export const colorConfigs: Record<string, ColorConfig> = {
|
|
16 |
indigo: {
|
17 |
bg: 'bg-indigo-50',
|
18 |
text: 'text-indigo-900',
|
19 |
-
gradient: 'bg-gradient-to-br from-indigo-500 to-
|
20 |
iconBg: 'bg-indigo-200',
|
21 |
},
|
22 |
teal: {
|
23 |
bg: 'bg-teal-50',
|
24 |
text: 'text-teal-900',
|
25 |
-
gradient: 'bg-gradient-to-br from-teal-
|
26 |
iconBg: 'bg-teal-200',
|
27 |
},
|
28 |
rose: {
|
29 |
bg: 'bg-rose-50',
|
30 |
text: 'text-rose-900',
|
31 |
-
gradient: 'bg-gradient-to-br from-rose-
|
32 |
iconBg: 'bg-rose-200',
|
33 |
},
|
34 |
amber: {
|
35 |
bg: 'bg-amber-50',
|
36 |
text: 'text-amber-900',
|
37 |
-
gradient: 'bg-gradient-to-br from-amber-
|
38 |
iconBg: 'bg-amber-200',
|
39 |
},
|
40 |
purple: {
|
41 |
bg: 'bg-purple-50',
|
42 |
text: 'text-purple-900',
|
43 |
-
gradient: 'bg-gradient-to-br from-purple-
|
44 |
iconBg: 'bg-purple-200',
|
45 |
},
|
46 |
blue: {
|
47 |
bg: 'bg-blue-50',
|
48 |
text: 'text-blue-900',
|
49 |
-
gradient: 'bg-gradient-to-br from-blue-
|
50 |
iconBg: 'bg-blue-200',
|
51 |
},
|
52 |
emerald: {
|
53 |
bg: 'bg-emerald-50',
|
54 |
text: 'text-emerald-900',
|
55 |
-
gradient: 'bg-gradient-to-br from-emerald-
|
56 |
iconBg: 'bg-emerald-200',
|
57 |
},
|
58 |
fuchsia: {
|
59 |
bg: 'bg-fuchsia-50',
|
60 |
text: 'text-fuchsia-900',
|
61 |
-
gradient: 'bg-gradient-to-br from-fuchsia-
|
62 |
iconBg: 'bg-fuchsia-200',
|
63 |
},
|
64 |
lime: {
|
65 |
bg: 'bg-lime-50',
|
66 |
text: 'text-lime-900',
|
67 |
-
gradient: 'bg-gradient-to-br from-lime-
|
68 |
iconBg: 'bg-lime-200',
|
69 |
},
|
70 |
sky: {
|
71 |
bg: 'bg-sky-50',
|
72 |
text: 'text-sky-900',
|
73 |
-
gradient: 'bg-gradient-to-br from-sky-
|
74 |
iconBg: 'bg-sky-200',
|
75 |
},
|
76 |
};
|
|
|
16 |
indigo: {
|
17 |
bg: 'bg-indigo-50',
|
18 |
text: 'text-indigo-900',
|
19 |
+
gradient: 'bg-gradient-to-br from-indigo-500 to-indigo-700',
|
20 |
iconBg: 'bg-indigo-200',
|
21 |
},
|
22 |
teal: {
|
23 |
bg: 'bg-teal-50',
|
24 |
text: 'text-teal-900',
|
25 |
+
gradient: 'bg-gradient-to-br from-teal-500 to-teal-700',
|
26 |
iconBg: 'bg-teal-200',
|
27 |
},
|
28 |
rose: {
|
29 |
bg: 'bg-rose-50',
|
30 |
text: 'text-rose-900',
|
31 |
+
gradient: 'bg-gradient-to-br from-rose-500 to-rose-700',
|
32 |
iconBg: 'bg-rose-200',
|
33 |
},
|
34 |
amber: {
|
35 |
bg: 'bg-amber-50',
|
36 |
text: 'text-amber-900',
|
37 |
+
gradient: 'bg-gradient-to-br from-amber-500 to-amber-700',
|
38 |
iconBg: 'bg-amber-200',
|
39 |
},
|
40 |
purple: {
|
41 |
bg: 'bg-purple-50',
|
42 |
text: 'text-purple-900',
|
43 |
+
gradient: 'bg-gradient-to-br from-purple-500 to-purple-700',
|
44 |
iconBg: 'bg-purple-200',
|
45 |
},
|
46 |
blue: {
|
47 |
bg: 'bg-blue-50',
|
48 |
text: 'text-blue-900',
|
49 |
+
gradient: 'bg-gradient-to-br from-blue-500 to-blue-700',
|
50 |
iconBg: 'bg-blue-200',
|
51 |
},
|
52 |
emerald: {
|
53 |
bg: 'bg-emerald-50',
|
54 |
text: 'text-emerald-900',
|
55 |
+
gradient: 'bg-gradient-to-br from-emerald-500 to-emerald-700',
|
56 |
iconBg: 'bg-emerald-200',
|
57 |
},
|
58 |
fuchsia: {
|
59 |
bg: 'bg-fuchsia-50',
|
60 |
text: 'text-fuchsia-900',
|
61 |
+
gradient: 'bg-gradient-to-br from-fuchsia-500 to-fuchsia-700',
|
62 |
iconBg: 'bg-fuchsia-200',
|
63 |
},
|
64 |
lime: {
|
65 |
bg: 'bg-lime-50',
|
66 |
text: 'text-lime-900',
|
67 |
+
gradient: 'bg-gradient-to-br from-lime-500 to-lime-700',
|
68 |
iconBg: 'bg-lime-200',
|
69 |
},
|
70 |
sky: {
|
71 |
bg: 'bg-sky-50',
|
72 |
text: 'text-sky-900',
|
73 |
+
gradient: 'bg-gradient-to-br from-sky-500 to-sky-700',
|
74 |
iconBg: 'bg-sky-200',
|
75 |
},
|
76 |
};
|