add diff names to scores
All checks were successful
deploy / deploy (push) Successful in 53s

This commit is contained in:
Lee
2023-10-26 17:37:35 +01:00
parent 9d5bc819e8
commit 8a4ec7d153
3 changed files with 67 additions and 11 deletions

37
src/utils/songUtils.ts Normal file
View File

@ -0,0 +1,37 @@
export function songDifficultyToColor(diff: string) {
console.log(diff);
switch (diff.toLowerCase()) {
case "easy":
return "#3cb371";
case "normal":
return "#59b0f4";
case "hard":
return "#FF6347";
case "expert":
return "#bf2a42";
case "expert+":
return "#8f48db";
default:
return "gray";
}
}
export function scoresaberDifficultyNumberToName(
diff: number,
shortened: boolean = false,
) {
switch (diff) {
case 1:
return !shortened ? "Easy" : "E";
case 3:
return !shortened ? "Normal" : "N";
case 5:
return !shortened ? "Hard" : "H";
case 7:
return !shortened ? "Expert" : "Ex";
case 9:
return !shortened ? "Expert+" : "Ex+";
default:
return "unknown";
}
}