feat(catalog): color equipment by rarity
CI / Verify (push) Successful in 1m0s
CI / Build immutable images and deploy (push) Successful in 3m26s

This commit is contained in:
2026-08-30 06:09:19 +00:00 Unverified
parent 890fb9385a
commit d0e2a95350
10 changed files with 3544 additions and 20 deletions
+3 -9
View File
@@ -2,6 +2,7 @@
import { ImageResponse } from "next/og";
import sharp from "sharp";
import { rarityGradient } from "@/lib/catalog/rarity";
import { getPublicTeamExport } from "@/lib/guides/queries";
const anuphanFonts = Promise.all(
@@ -28,13 +29,6 @@ function amount(value: number): string {
return new Intl.NumberFormat("en-US", { maximumFractionDigits: 0 }).format(value);
}
function weaponBackground(rarity: number | null): string {
if (rarity === 5) return "linear-gradient(90deg, #8a5a00 0%, #0f0800 100%)";
if (rarity === 4) return "linear-gradient(90deg, #a300b8 0%, #000000 100%)";
if (rarity === 3) return "linear-gradient(90deg, #00a0b5 0%, #000000 100%)";
return "#17383d";
}
function contentDisposition(teamName: string): string {
const displayName = teamName.trim() || "team";
const fallback = displayName
@@ -133,7 +127,7 @@ export async function GET(
)}
<div style={{ display: "flex", gap: 6 }}>
{member.weapon && memberAssets[index].weapon ? (
<div style={{ position: "relative", display: "flex", width: 50, height: 50, overflow: "hidden", borderRadius: 10, background: weaponBackground(member.weapon.rarity) }}>
<div style={{ position: "relative", display: "flex", width: 50, height: 50, overflow: "hidden", borderRadius: 10, background: rarityGradient(member.weapon.rarity) }}>
<img src={memberAssets[index].weapon} alt="" width={50} height={50} style={{ objectFit: "contain" }} />
<div style={{ position: "absolute", top: 2, right: 2, display: "flex", borderRadius: 4, background: "#f4fbfa", color: "#06171b", padding: "1px 4px", fontSize: 11, fontWeight: 700 }}>
R{member.refinement}
@@ -141,7 +135,7 @@ export async function GET(
</div>
) : null}
{member.artifact && memberAssets[index].artifact ? (
<div style={{ display: "flex", width: 50, height: 50, overflow: "hidden", borderRadius: 10, background: "#17383d" }}>
<div style={{ display: "flex", width: 50, height: 50, overflow: "hidden", borderRadius: 10, background: rarityGradient(member.artifact.rarity) }}>
<img src={memberAssets[index].artifact} alt="" width={50} height={50} style={{ objectFit: "contain" }} />
</div>
) : null}