feat(catalog): color equipment by rarity
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user