From 40a055c2a1868e0363cbe56539507b530366199a Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 13 Aug 2024 12:09:35 +0200 Subject: [PATCH] Cards Idea --- src/pages/index.astro | 46 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/src/pages/index.astro b/src/pages/index.astro index 5ad6550..ba1d94b 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -31,6 +31,34 @@ germanPosts.forEach(value => { }); const latestPost = posts.sort((a, b) => dayjs(b.data.created).unix() - dayjs(a.data.created).unix()).at(0); + +const prefixColorMap: { + [key: string]: { + from: string; + to: string; + }; +} = { + PREFIX_ADMIN: { + from: "from-red-600", + to: "to-red-800", + }, + PREFIX_DEVELOPER: { + from: "from-sky-600", + to: "to-sky-800", + }, + PREFIX_MODERATOR: { + from: "from-amber-600", + to: "to-amber-800", + }, + PREFIX_SUPPORTER: { + from: "from-blue-700", + to: "to-blue-900", + }, + PREFIX_BUILDER: { + from: "from-green-500", + to: "to-green-700", + }, +}; --- @@ -149,13 +177,13 @@ const latestPost = posts.sort((a, b) => dayjs(b.data.created).unix() - dayjs(a.d -
+
{Object.entries(teamMember).map(([prefix, players]) => ( -
-

{t("home.prefix." + prefix.replace("PREFIX_", "").toLowerCase())}

-
- {players.map(v => ( - + + {players.map((v, index) => ( +
+ {index == 0 ?

{t("home.prefix." + prefix.replace("PREFIX_", "").toLowerCase())}

: null} +
{v.name}
dayjs(b.data.created).unix() - dayjs(a.d alt={v.name + "s bust"} width="150" height="150"/>
- ))} -
-
+
+ ))} + ))}