fix(submissions): badge and score color
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2023-02-18 10:18:05 +08:00
parent 2c17fba818
commit 79b9b50da1
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
3 changed files with 15 additions and 5 deletions

View File

@ -519,10 +519,10 @@ class UOJSubmission {
echo '<span class="fs-5">'; echo '<span class="fs-5">';
if ($actual_score == 100) { if ($actual_score == 100) {
// rgb(0, 204, 0) // rgb(0, 204, 0)
echo '<span class="badge text-white bg-success">', 'Accepted', '</span>'; echo '<span class="badge text-white uoj-accepted-badge">', 'Accepted', '</span>';
} else { } else {
// rgb(204, 0, 0) // rgb(204, 0, 0)
echo '<span class="badge text-white bg-danger">', 'Unaccepted', '</span>'; echo '<span class="badge text-white uoj-unaccepted-badge">', 'Unaccepted', '</span>';
} }
echo '</span>'; echo '</span>';
} }

View File

@ -503,6 +503,16 @@ form.form-horizontal {
} }
} }
/* Submissions List */
.uoj-accepted-badge {
background-color: rgb(20 184 48) !important;
}
.uoj-unaccepted-badge {
background-color: rgb(219 53 53) !important;
}
/* Submission Page */ /* Submission Page */
.submission-layout { .submission-layout {

View File

@ -110,11 +110,11 @@ function htmlspecialchars(str)
function getColOfScore(score) { function getColOfScore(score) {
if (score == 0) { if (score == 0) {
return ColorConverter.toStr(ColorConverter.toRGB(new HSV(0, 100, 80))); return ColorConverter.toStr(ColorConverter.toRGB(new HSV(0, 76, 86)));
} else if (score == 100) { } else if (score == 100) {
return ColorConverter.toStr(ColorConverter.toRGB(new HSV(120, 100, 80))); return ColorConverter.toStr(ColorConverter.toRGB(new HSV(130, 89, 72)));
} else { } else {
return ColorConverter.toStr(ColorConverter.toRGB(new HSV(30 + score * 60 / 100, 100, 90))); return ColorConverter.toStr(ColorConverter.toRGB(new HSV(30 + score * 60 / 100, 83, 89)));
} }
} }