Compare commits
2 Commits
1485083d60
...
fb2b72875f
Author | SHA1 | Date | |
---|---|---|---|
fb2b72875f | |||
fadfdee316 |
@ -1,5 +1,6 @@
|
|||||||
import { useOverlayDataStore } from "@/store/overlayDataStore";
|
import { useOverlayDataStore } from "@/store/overlayDataStore";
|
||||||
import { formatNumber } from "@/utils/numberUtils";
|
import { formatNumber } from "@/utils/numberUtils";
|
||||||
|
import { accuracyToColor } from "@/utils/songUtils";
|
||||||
import useStore from "@/utils/useStore";
|
import useStore from "@/utils/useStore";
|
||||||
|
|
||||||
export default function ScoreStats() {
|
export default function ScoreStats() {
|
||||||
@ -13,7 +14,14 @@ export default function ScoreStats() {
|
|||||||
<p className="text-2xl font-bold">{formatNumber(scoreStats.score)}</p>
|
<p className="text-2xl font-bold">{formatNumber(scoreStats.score)}</p>
|
||||||
<p className="text-2xl">Combo: {formatNumber(scoreStats.combo)}x</p>
|
<p className="text-2xl">Combo: {formatNumber(scoreStats.combo)}x</p>
|
||||||
<p className="text-2xl">
|
<p className="text-2xl">
|
||||||
{scoreStats.rank} {scoreStats.accuracy.toFixed(2)}%
|
<span
|
||||||
|
style={{
|
||||||
|
color: accuracyToColor(scoreStats.accuracy),
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{scoreStats.accuracy == 100 ? "SS" : scoreStats.rank}
|
||||||
|
</span>{" "}
|
||||||
|
{scoreStats.accuracy.toFixed(2)}%
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -26,7 +26,9 @@ export default function SongInfo() {
|
|||||||
/>
|
/>
|
||||||
<div className="flex flex-col justify-between pb-2 pt-1">
|
<div className="flex flex-col justify-between pb-2 pt-1">
|
||||||
<div>
|
<div>
|
||||||
<p className="text-xl font-bold">{songInfo.songName}</p>
|
<p className="text-xl font-bold">
|
||||||
|
{songInfo.songName} {songInfo.songSubName}
|
||||||
|
</p>
|
||||||
<p className="text-md">{songInfo.songMapper}</p>
|
<p className="text-md">{songInfo.songMapper}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-1 flex items-center gap-2">
|
<div className="mt-1 flex items-center gap-2">
|
||||||
|
@ -15,6 +15,20 @@ export function songDifficultyToColor(diff: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function accuracyToColor(acc: number) {
|
||||||
|
if (acc >= 90) {
|
||||||
|
return "rgb(0, 255, 255)";
|
||||||
|
} else if (acc >= 80) {
|
||||||
|
return "rgb(255, 255, 255)";
|
||||||
|
} else if (acc >= 70) {
|
||||||
|
return "rgb(0, 255, 0)";
|
||||||
|
} else if (acc >= 60) {
|
||||||
|
return "rgb(255, 235, 4)";
|
||||||
|
} else {
|
||||||
|
return "rgb(255, 0, 0)";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function scoresaberDifficultyNumberToName(
|
export function scoresaberDifficultyNumberToName(
|
||||||
diff: number,
|
diff: number,
|
||||||
shortened: boolean = false,
|
shortened: boolean = false,
|
||||||
|
Reference in New Issue
Block a user