From aa0ba4be092dba964467a456b303e894e8e5b336 Mon Sep 17 00:00:00 2001 From: gunshiz Date: Tue, 1 Sep 2026 15:33:42 +0700 Subject: [PATCH] Improve mobile team equipment layout --- components/public/team-search.tsx | 6 +++--- lib/catalog/element.test.ts | 22 +++++++++++----------- lib/catalog/element.ts | 16 ++++++++-------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/components/public/team-search.tsx b/components/public/team-search.tsx index c09f72e..a3aed08 100644 --- a/components/public/team-search.tsx +++ b/components/public/team-search.tsx @@ -81,10 +81,10 @@ export function TeamSearch({ teams }: { teams: PublicGuide["teams"] }) { className="min-w-0 rounded-lg p-1 text-center sm:p-2" style={{ backgroundColor: elementBackgroundColor(member.character.element) }} > -
+
@@ -98,7 +98,7 @@ export function TeamSearch({ teams }: { teams: PublicGuide["teams"] }) { C{member.constellation}
-
+
{member.weapon ? (
{ - it("maps every character element to its 20% opacity color", () => { - expect(elementBackgroundColor("Pyro")).toBe("#12000033"); - expect(elementBackgroundColor("Hydro")).toBe("#00051233"); - expect(elementBackgroundColor("Anemo")).toBe("#06141533"); - expect(elementBackgroundColor("Electro")).toBe("#0D000F33"); - expect(elementBackgroundColor("Dendro")).toBe("#000F0433"); - expect(elementBackgroundColor("Cryo")).toBe("#03202133"); - expect(elementBackgroundColor("Geo")).toBe("#0F0D0033"); + it("maps every character element to its 40% opacity color", () => { + expect(elementBackgroundColor("Pyro")).toBe("#12000066"); + expect(elementBackgroundColor("Hydro")).toBe("#00051266"); + expect(elementBackgroundColor("Anemo")).toBe("#06141566"); + expect(elementBackgroundColor("Electro")).toBe("#0D000F66"); + expect(elementBackgroundColor("Dendro")).toBe("#000F0466"); + expect(elementBackgroundColor("Cryo")).toBe("#03202166"); + expect(elementBackgroundColor("Geo")).toBe("#0F0D0066"); }); it("uses the neutral character background when the element is unavailable", () => { - expect(elementBackgroundColor(null)).toBe("#17383d33"); - expect(elementBackgroundColor(undefined)).toBe("#17383d33"); - expect(elementBackgroundColor("Unknown")).toBe("#17383d33"); + expect(elementBackgroundColor(null)).toBe("#17383d66"); + expect(elementBackgroundColor(undefined)).toBe("#17383d66"); + expect(elementBackgroundColor("Unknown")).toBe("#17383d66"); }); }); diff --git a/lib/catalog/element.ts b/lib/catalog/element.ts index e35057f..2cae2ba 100644 --- a/lib/catalog/element.ts +++ b/lib/catalog/element.ts @@ -1,13 +1,13 @@ const elementBackgroundColors: Record = { - Pyro: "#12000033", - Hydro: "#00051233", - Anemo: "#06141533", - Electro: "#0D000F33", - Dendro: "#000F0433", - Cryo: "#03202133", - Geo: "#0F0D0033", + Pyro: "#12000066", + Hydro: "#00051266", + Anemo: "#06141566", + Electro: "#0D000F66", + Dendro: "#000F0466", + Cryo: "#03202166", + Geo: "#0F0D0066", }; export function elementBackgroundColor(element: string | null | undefined): string { - return (element && elementBackgroundColors[element]) || "#17383d33"; + return (element && elementBackgroundColors[element]) || "#17383d66"; }