44 lines
1.7 KiB
TypeScript
44 lines
1.7 KiB
TypeScript
const rarityGradientClasses: Record<number, string> = {
|
|
1: "bg-[linear-gradient(90deg,rgba(23,25,28,1)_0%,rgba(19,20,23,1)_100%)]",
|
|
2: "bg-[linear-gradient(90deg,rgba(11,43,24,1)_0%,rgba(7,18,13,1)_100%)]",
|
|
3: "bg-[#4D7691] bg-[linear-gradient(90deg,rgba(77,118,145,1)_0%,rgba(71,135,165,1)_100%)]",
|
|
4: "bg-[#6D6A9C] bg-[linear-gradient(90deg,rgba(109,106,156,1)_0%,rgba(150,122,179,1)_100%)]",
|
|
5: "bg-[#A67B34] bg-[linear-gradient(90deg,rgba(166,123,52,1)_0%,rgba(178,123,44,1)_100%)]",
|
|
};
|
|
|
|
const rarityGradients: Record<number, string> = {
|
|
1: "linear-gradient(90deg, rgba(23, 25, 28, 1) 0%, rgba(19, 20, 23, 1) 100%)",
|
|
2: "linear-gradient(90deg, rgba(11, 43, 24, 1) 0%, rgba(7, 18, 13, 1) 100%)",
|
|
3: "linear-gradient(90deg, rgba(77, 118, 145, 1) 0%, rgba(71, 135, 165, 1) 100%)",
|
|
4: "linear-gradient(90deg, rgba(109, 106, 156, 1) 0%, rgba(150, 122, 179, 1) 100%)",
|
|
5: "linear-gradient(90deg, rgba(166, 123, 52, 1) 0%, rgba(178, 123, 44, 1) 100%)",
|
|
};
|
|
|
|
const rarityTextClasses: Record<number, string> = {
|
|
3: "text-[#4D7691]",
|
|
4: "text-[#6D6A9C]",
|
|
5: "text-[#A67B34]",
|
|
};
|
|
|
|
const rarityTextColors: Record<number, string> = {
|
|
3: "#4D7691",
|
|
4: "#6D6A9C",
|
|
5: "#A67B34",
|
|
};
|
|
|
|
export function rarityGradientClass(rarity: number | null | undefined): string | undefined {
|
|
return rarity ? rarityGradientClasses[rarity] : undefined;
|
|
}
|
|
|
|
export function rarityGradient(rarity: number | null | undefined): string {
|
|
return (rarity && rarityGradients[rarity]) || "#17383d";
|
|
}
|
|
|
|
export function rarityTextClass(rarity: number | null | undefined): string | undefined {
|
|
return rarity ? rarityTextClasses[rarity] : undefined;
|
|
}
|
|
|
|
export function rarityTextColor(rarity: number | null | undefined): string {
|
|
return (rarity && rarityTextColors[rarity]) || "#17171c";
|
|
}
|