import { RANK } from "./utils.ts";
const goldColor = "#FAD200";
const goldShadowColor = "#C8A090";
const goldTextColor = "#886000";
const silverColor = "#B0B0B0";
const sliverShadowColor = "#9090C0";
const silverTextColor = "#505050";
const bronzeColor = "#A18D66";
const bronzeShadowColor = "#816D96";
const bronzeTextColor = "#412D06";
const leafIcon =
``;
export const getNextRankBar = (
title: string,
color: string,
percentage: number,
): string => {
const maxWidht = 80;
return `
`;
};
const getSmallTrophyIcon = (
icon: string,
color: string,
count: number,
): string => {
const leftXPosition = 7;
const rightXPosition = 68;
const getIcon = (x: number) => {
return ``;
};
if (count == 1) {
// Double Rank
return getIcon(rightXPosition);
} else if (count == 2) {
// Triple Rank
return `${getIcon(leftXPosition)}${getIcon(rightXPosition)}`;
}
// Single Rank
return "";
};
export const getTrophyIcon = (rank = RANK.UNKNOWN) => {
let color = "currentColor";
let rankColor = "#333";
let backgroundIcon = "";
let gradationColor = "";
if (rank === RANK.SECRET) {
rankColor = "fuchsia";
gradationColor = `
`;
} else if (rank.slice(0, 1) === RANK.S) {
color = goldColor;
rankColor = goldTextColor;
backgroundIcon = leafIcon;
gradationColor = `
`;
} else if (rank.slice(0, 1) === RANK.A) {
color = silverColor;
rankColor = silverTextColor;
backgroundIcon = leafIcon;
gradationColor = `
`;
} else if (rank === RANK.B) {
color = bronzeColor;
rankColor = bronzeTextColor;
gradationColor = `
`;
}
const icon = `
${
rank.slice(0, 1)
}
`;
const optionRankIcon = getSmallTrophyIcon(icon, color, rank.length - 1);
return `
${backgroundIcon}
${optionRankIcon}
${gradationColor}
`;
};