update score badge tooltips
Some checks failed
Deploy Website / docker (ubuntu-latest) (push) Failing after 1m2s

This commit is contained in:
Lee 2024-10-20 13:49:14 +01:00
parent 511f56af91
commit d806907604
2 changed files with 7 additions and 3 deletions

@ -8,9 +8,10 @@ export default function FullComboBadge({ score }: ScoreBadgeProps) {
return ( return (
<Tooltip <Tooltip
display={ display={
<div className="flex flex-col justify-center items-center"> <div className="flex flex-col">
{!score.fullCombo ? ( {!score.fullCombo ? (
<> <>
<p className="font-semibold">Misses</p>
<p>Missed Notes: {formatNumberWithCommas(score.missedNotes)}</p> <p>Missed Notes: {formatNumberWithCommas(score.missedNotes)}</p>
<p>Bad Cuts: {formatNumberWithCommas(score.badCuts)}</p> <p>Bad Cuts: {formatNumberWithCommas(score.badCuts)}</p>
</> </>

@ -27,6 +27,8 @@ const badges: ScoreBadge[] = [
<Tooltip <Tooltip
display={ display={
<div> <div>
<p className="font-semibold">Performance Points</p>
<p>Raw: {formatPp(pp)}pp</p>
<p> <p>
Weighted: {formatPp(weightedPp)}pp ({(100 * weight).toFixed(2)}%) Weighted: {formatPp(weightedPp)}pp ({(100 * weight).toFixed(2)}%)
</p> </p>
@ -48,7 +50,7 @@ const badges: ScoreBadge[] = [
create: (score: ScoreSaberScore, leaderboard: ScoreSaberLeaderboard) => { create: (score: ScoreSaberScore, leaderboard: ScoreSaberLeaderboard) => {
const acc = (score.score / leaderboard.maxScore) * 100; const acc = (score.score / leaderboard.maxScore) * 100;
const scoreBadge = getScoreBadgeFromAccuracy(acc); const scoreBadge = getScoreBadgeFromAccuracy(acc);
let accDetails = `Accuracy ${scoreBadge.name != "-" ? scoreBadge.name : ""}`; let accDetails = `${scoreBadge.name != "-" ? scoreBadge.name : ""}`;
if (scoreBadge.max == null) { if (scoreBadge.max == null) {
accDetails += ` (> ${scoreBadge.min}%)`; accDetails += ` (> ${scoreBadge.min}%)`;
} else if (scoreBadge.min == null) { } else if (scoreBadge.min == null) {
@ -65,8 +67,8 @@ const badges: ScoreBadge[] = [
display={ display={
<div className="flex flex-col gap-2"> <div className="flex flex-col gap-2">
<div> <div>
<p className="font-semibold">Accuracy</p>
<p>{accDetails}</p> <p>{accDetails}</p>
{failed && <p className="text-red-500">Failed</p>}
</div> </div>
{modCount > 0 && ( {modCount > 0 && (
@ -75,6 +77,7 @@ const badges: ScoreBadge[] = [
<ScoreModifiers type="full" score={score} /> <ScoreModifiers type="full" score={score} />
</div> </div>
)} )}
{failed && <p className="text-red-500">Failed</p>}
</div> </div>
} }
> >