Skip to content

Commit 959347a

Browse files
committed
card metadata info
1 parent 36a5852 commit 959347a

File tree

4 files changed

+39
-6
lines changed

4 files changed

+39
-6
lines changed

public/posts/about-fezcodex.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ so expect plenty of reviews and musings on the latest (or classic) video games t
99
And when I'm not gaming, I'm probably lost in a good book, binging a captivating series like _"The Bear"_, or grooving to some timeless tunes (_De La Soul always on rotation_).
1010

1111
This space is entirely my own, a place where my ideas, opinions, and sometimes questionable tastes run wild.
12-
I share whatever I want, whenever I want, without apology. So, if you're looking for polished, perfectly curated content,
12+
If you're looking for polished, perfectly curated content,
1313
you might find some of that, but mostly, you'll find genuine, unadulterated me. Dive in, explore, and enjoy the ride!

public/posts/dnd-content.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
Dungeons & Dragons is _kinda_ fun, offering engaging narratives and strategic depth.
66
It's a hobby that provides a welcome escape and a platform for creative exploration.
77

8+
[Divinity - Original Sin 2 (Main Theme)](https://www.youtube.com/watch?v=UkgVL05NsWo)
9+
810
## Introduction
911

1012
Let's talk about some of the D&D and RPG content I enjoy.
@@ -18,6 +20,8 @@ The process of building and painting these miniatures is a satisfying aspect of
1820
complementing the imaginative battles they represent. It's an activity that combines creativity,
1921
strategic thinking, and a sense of community, all contributing to a well-rounded pastime.
2022

23+
[Secret Level - Warhammer Episode](https://www.youtube.com/watch?v=ncauRK9f75Q)
24+
2125
## D&D, RPG, and Fantasy: A Quick Dive
2226

2327
It's easy to use terms like D&D, RPG, and fantasy interchangeably, and honestly, I often do! While they're distinct, they share a lot of common ground, especially in the realm of immersive storytelling and world-building.

src/components/LogCard.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
MusicNote,
1010
Television,
1111
ForkKnife,
12+
Star
1213
} from '@phosphor-icons/react';
1314

1415
const categoryIcons = {
@@ -71,6 +72,22 @@ const LogCard = ({ log, index, totalLogs }) => {
7172

7273
const cardStyle = categoryStyles[category] || {};
7374

75+
const renderStars = (rating) => {
76+
const stars = [];
77+
for (let i = 0; i < 5; i++) {
78+
if (i < rating) {
79+
stars.push(
80+
<Star key={i} size={16} weight="fill" className="text-yellow-400" />,
81+
);
82+
} else {
83+
stars.push(
84+
<Star key={i} size={16} weight="fill" className="text-gray-500" />,
85+
);
86+
}
87+
}
88+
return <div className="flex ml-1 mt-1">{stars}</div>;
89+
};
90+
7491
return (
7592
<Link to={`/logs/${slug}`} className="block">
7693
<div
@@ -112,9 +129,7 @@ const LogCard = ({ log, index, totalLogs }) => {
112129
<div className="flex items-center justify-between">
113130
<div className="flex items-center">
114131
<div className="text-yellow-400">
115-
{[...Array(rating)].map((_, i) => (
116-
<span key={i}></span>
117-
))}
132+
{renderStars(rating)}
118133
</div>
119134
<div className="text-gray-400 ml-2">({rating}/5)</div>
120135
</div>

src/components/LogMetadata.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import Label from './Label';
33
import { Star } from '@phosphor-icons/react';
44
import { FaExternalLinkAlt } from 'react-icons/fa';
5+
import colors from '../config/colors';
56

67
const LogMetadata = ({ metadata }) => {
78
if (!metadata) {
@@ -24,10 +25,23 @@ const LogMetadata = ({ metadata }) => {
2425
return <div className="flex ml-1 mt-1">{stars}</div>;
2526
};
2627

28+
const logMetadataBackgroundColorStyle = {
29+
backgroundColor: colors[`${metadata.category.toLowerCase()}-alpha-10`],
30+
};
31+
2732
return (
2833
<aside className="sticky top-24">
29-
<div className="p-6 bg-gray-800/50 rounded-lg border border-gray-700/50">
30-
<h3 className="text-lg font-semibold text-gray-100 mb-4 border-b pb-2 border-gray-500">
34+
<div
35+
className="p-6 rounded-lg border"
36+
style={{
37+
backgroundColor: colors[`${metadata.category.toLowerCase()}-alpha-10`],
38+
borderColor: colors[`${metadata.category.toLowerCase()}-alpha-50`],
39+
}}
40+
>
41+
<h3
42+
className="text-lg font-semibold mb-4 border-b pb-2 border-gray-500"
43+
style={{ color: colors[metadata.category.toLowerCase()] }}
44+
>
3145
About Log
3246
</h3>
3347
<div className="space-y-4">

0 commit comments

Comments
 (0)