Skip to content

Commit 24a6ef7

Browse files
committed
fix: color bades on project tiles.
1 parent 7dc6bfa commit 24a6ef7

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

src/components/PostTile.js

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,32 @@ const PostTile = ({ post }) => {
1414
},
1515
);
1616

17+
const categoryColor =
18+
post.category === 'dev'
19+
? 'var(--color-dev-badge)'
20+
: post.category === 'series'
21+
? 'var(--color-series-badge)'
22+
: post.category === 'd&d' || post.category === 'dnd'
23+
? 'var(--color-dnd-badge)'
24+
: post.category === 'gist'
25+
? 'var(--color-gist-badge)'
26+
: post.category === 'feat'
27+
? 'var(--color-feat-badge)'
28+
: 'var(--color-rant-badge)';
29+
30+
const categoryBg =
31+
post.category === 'dev'
32+
? 'rgba(59, 130, 246, 0.3)'
33+
: post.category === 'series'
34+
? 'rgba(237, 197, 49, 0.3)'
35+
: post.category === 'd&d' || post.category === 'dnd'
36+
? 'rgba(236, 72, 153, 0.3)'
37+
: post.category === 'gist'
38+
? 'rgba(245, 158, 11, 0.3)'
39+
: post.category === 'feat'
40+
? 'rgba(168, 85, 247, 0.3)'
41+
: 'rgba(16, 185, 129, 0.2)';
42+
1743
return (
1844
<motion.div
1945
whileHover={{ y: -5 }}
@@ -32,7 +58,13 @@ const PostTile = ({ post }) => {
3258
<div className="absolute inset-0 bg-gradient-to-t from-zinc-900 to-transparent" />
3359

3460
<div className="absolute bottom-3 left-4 flex items-center gap-2">
35-
<span className="px-2 py-0.5 text-[9px] font-mono font-bold uppercase tracking-widest text-emerald-400 bg-emerald-500/10 border border-emerald-500/20 rounded-sm">
61+
<span
62+
className="px-2 py-0.5 text-[9px] font-mono font-bold uppercase tracking-widest border rounded-sm transition-all duration-300 text-gray-300"
63+
style={{
64+
borderColor: categoryColor,
65+
backgroundColor: categoryBg,
66+
}}
67+
>
3668
{post.category || 'Post'}
3769
</span>
3870
{post.isSeries && (

0 commit comments

Comments
 (0)