Skip to content

Commit

Permalink
Add new ranks
Browse files Browse the repository at this point in the history
  • Loading branch information
petrkucerak committed May 1, 2024
1 parent 68515a6 commit a5849fa
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
30 changes: 26 additions & 4 deletions lib/api.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
import fs from "fs";

const titles = ["Sráč zelenáč", "Sráč", "Sráč mazák", "Velesráč"];
const classes = ["srac-zelenac", "srac", "srac-mazak", "velesrac"];
const titles = [
"Sráč zelenáč",
"Sráč",
"Sráč mazák",
"Velesráč",
"Megasráč",
"Gigasráč",
];
const classes = [
"srac-zelenac",
"srac",
"srac-mazak",
"velesrac",
"megasrac",
"gigasrac",
];
const extension = ["trůn", "trůny", "trůny", "trůny", "trůnů"];

export function getData2HallOfShits() {
Expand Down Expand Up @@ -34,14 +48,22 @@ export function getData2HallOfShits() {
if (out[index].score == 3) out[index].extension = extension[2];
if (out[index].score == 4) out[index].extension = extension[3];
if (out[index].score == 5) out[index].extension = extension[4];
if (out[index].score > 20) {
if (out[index].score >= 20) {
out[index].title = titles[2];
out[index].class = classes[2];
}
if (out[index].score > 50) {
if (out[index].score >= 50) {
out[index].title = titles[3];
out[index].class = classes[3];
}
if (out[index].score >= 100) {
out[index].title = titles[4];
out[index].class = classes[4];
}
if (out[index].score >= 200) {
out[index].title = titles[5];
out[index].class = classes[5];
}
}
});
return out;
Expand Down
9 changes: 6 additions & 3 deletions pages/hall.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ export default function Hall({ nickNames }) {
<LocalTitle title="Legendy" subtitle="" />
<ul>
{nickNames.sort(compareScore).map((person) => {
if (person.nickName === "KajKaj")
if (person.nickName === "Kajkaj" || person.nickName === "Adélka")
return (
<li key={person.nickName} className={person.class}>
Velesráčka <strong>{person.nickName}</strong>:{" "}
{person.score} {person.extension}
{person.title.replace("sráč", "sračka")}{" "}
<strong>{person.nickName}</strong>: {person.score}{" "}
{person.extension}{" "}
</li>
);
else
Expand All @@ -46,6 +47,8 @@ export default function Hall({ nickNames }) {
<li className="srac">Sráč: 5+ trůnů</li>
<li className="srac-mazak">Sráč mazák: 20+ trůnů</li>
<li className="velesrac">Velesráč: 50+ trůnů</li>
<li className="megasrac">Megasráč: 100+ trůnů</li>
<li className="gigasrac">Gigasráč: 200+ trůnů</li>
</ul>
</SectionBody>
</Section>
Expand Down
7 changes: 7 additions & 0 deletions styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@
.velesrac {
@apply text-[#af8566ff] font-semibold text-xl;
}
.megasrac {
@apply text-[#7d52b6] font-semibold text-xl;
}
.gigasrac {
@apply text-[#ce3dc2] font-bold text-xl;
/* text-shadow: 0px 0px 5px #ce3dc2; */
}
/* End of the tagsinput */

.svg-non-block svg {
Expand Down

0 comments on commit a5849fa

Please sign in to comment.