From 7224b6815c0032ca35ea75cb8f295ba42d9ee453 Mon Sep 17 00:00:00 2001 From: Taken Date: Tue, 23 Sep 2025 20:16:01 +0200 Subject: [PATCH] Added turbo kart racers stat card --- src/app/(stats)/player/[ign]/_client.tsx | 4 ++- .../player/[ign]/_stats/classic/tkr.tsx | 32 +++++++++++++++++++ src/app/globals.css | 1 + src/lib/schema/player.ts | 15 +++++++-- src/lib/schema/stats/classic.ts | 6 ++++ 5 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 src/app/(stats)/player/[ign]/_stats/classic/tkr.tsx diff --git a/src/app/(stats)/player/[ign]/_client.tsx b/src/app/(stats)/player/[ign]/_client.tsx index c013389..904c905 100644 --- a/src/app/(stats)/player/[ign]/_client.tsx +++ b/src/app/(stats)/player/[ign]/_client.tsx @@ -20,6 +20,7 @@ import BuildBattleStats from "./_stats/build-battle/build-battle" import ArenaBrawlStats from "./_stats/classic/arenabrawl" import PaintballStats from "./_stats/classic/paintball" import QuakecraftStats from "./_stats/classic/quakecraft" +import TkrStats from "./_stats/classic/tkr" import VampireZStats from "./_stats/classic/vampirez" import WallsStats from "./_stats/classic/walls" import CopsAndCrimsStats from "./_stats/copsandcrims/copsandcrims" @@ -109,7 +110,8 @@ export function PlayerStats( "paintball": , "walls": , "vampirez": , - "quakecraft": + "quakecraft": , + "tkr": } as const const defaultOrder = Object.keys(statsComponents) diff --git a/src/app/(stats)/player/[ign]/_stats/classic/tkr.tsx b/src/app/(stats)/player/[ign]/_stats/classic/tkr.tsx new file mode 100644 index 0000000..736527a --- /dev/null +++ b/src/app/(stats)/player/[ign]/_stats/classic/tkr.tsx @@ -0,0 +1,32 @@ +import { Separator } from "@/components/ui/separator" +import { formatNumber } from "@/lib/formatters" +import { NonNullStats } from "@/lib/schema/player" +import { title } from "process" +import { EmptyStats, GeneralStats } from "../stats-components" + +export default function TkrStats({ stats }: { stats: NonNullStats["TurboKartRacers"] }) { + if (!stats) return + + return ( + Gold

, + stat:

{`${formatNumber(stats.gold_trophy)}🏆\uFE0E`}

+ }, + { + title:

Silver

, + stat:

{`${formatNumber(stats.silver_trophy)}🏆\uFE0E`}

+ }, + { + title:

Bronze

, + stat:

{`${formatNumber(stats.bronze_trophy)}🏆\uFE0E`}

+ } + ]} + > + +
+ ) +} diff --git a/src/app/globals.css b/src/app/globals.css index 6df06cc..df36ed0 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -21,6 +21,7 @@ --color-mc-light-purple: #FF55FF; --color-mc-yellow: #FFFF55; --color-mc-white: #FFFFFF; + --color-mc-brown: #963; --spacing-header: 3.75rem; --spacing-content: calc(100vh - var(--spacing-header)); } diff --git a/src/lib/schema/player.ts b/src/lib/schema/player.ts index d7d989e..8629af5 100644 --- a/src/lib/schema/player.ts +++ b/src/lib/schema/player.ts @@ -3,7 +3,14 @@ import { arcadeStatsSchema } from "./stats/arcade" import { bedwarsStatsSchema } from "./stats/bedwars" import { blitzStatsSchema } from "./stats/blitz" import { buildBattleStatsSchema } from "./stats/build-battle" -import { arenaBrawlStatsSchema, paintBallStatsSchema, quakecraftStatsSchema, vampireZStatsSchema, wallsStatsSchema } from "./stats/classic" +import { + arenaBrawlStatsSchema, + paintBallStatsSchema, + quakecraftStatsSchema, + turboKartRacersStatsSchema, + vampireZStatsSchema, + wallsStatsSchema +} from "./stats/classic" import { copsAndCrimsStatsSchema } from "./stats/copsandcrims" import { duelsStatsSchema } from "./stats/duels" import { megawallsStats } from "./stats/megawalls" @@ -50,8 +57,9 @@ export const playerSchema = z.looseObject({ Paintball: paintBallStatsSchema.optional(), Walls: wallsStatsSchema.optional(), VampireZ: vampireZStatsSchema.optional(), - Quake: quakecraftStatsSchema.optional() - }).transform(({ Walls3, MCGO, HungerGames, SuperSmash, Battleground, Arena, Quake, ...rest }) => { + Quake: quakecraftStatsSchema.optional(), + GingerBread: turboKartRacersStatsSchema.optional() + }).transform(({ Walls3, MCGO, HungerGames, SuperSmash, Battleground, Arena, Quake, GingerBread, ...rest }) => { return { MegaWalls: Walls3, CopsAndCrims: MCGO, @@ -60,6 +68,7 @@ export const playerSchema = z.looseObject({ Warlords: Battleground, ArenaBrawl: Arena, Quakecraft: Quake, + TurboKartRacers: GingerBread, ...rest } }).optional(), diff --git a/src/lib/schema/stats/classic.ts b/src/lib/schema/stats/classic.ts index 4055dbb..f9e9d3f 100644 --- a/src/lib/schema/stats/classic.ts +++ b/src/lib/schema/stats/classic.ts @@ -69,3 +69,9 @@ export const quakecraftStatsSchema = z.object({ dash_cooldown: z.coerce.number().default(0), dash_power: z.coerce.number().default(0) }) + +export const turboKartRacersStatsSchema = z.object({ + gold_trophy: z.number().default(0), + silver_trophy: z.number().default(0), + bronze_trophy: z.number().default(0) +})