mirror of
https://git.srhtnin.garden/sarah/srhtnin.github.io.git
synced 2026-10-14 10:48:12 +02:00
Added users and leaderboard.
This commit is contained in:
1 parent
56c2b08435
commit
8a23a7f16d
2 files changed
+190
No files matched your search
@@ -0,0 +1,63 @@
|
||||
async function RenderLeaderboard() {
|
||||
const Response = await fetch(
|
||||
ApiUrl + "/Leaderboard.php"
|
||||
);
|
||||
|
||||
const Result =
|
||||
await Response.json();
|
||||
|
||||
if (!Result.Success) {
|
||||
return;
|
||||
}
|
||||
|
||||
const Body =
|
||||
document.getElementById(
|
||||
"LeaderboardBody"
|
||||
);
|
||||
|
||||
Body.replaceChildren();
|
||||
|
||||
for (
|
||||
const Player
|
||||
of Result.Players
|
||||
) {
|
||||
const Row =
|
||||
document.createElement(
|
||||
"tr"
|
||||
);
|
||||
|
||||
const Rank =
|
||||
document.createElement(
|
||||
"td"
|
||||
);
|
||||
|
||||
const Username =
|
||||
document.createElement(
|
||||
"td"
|
||||
);
|
||||
|
||||
const Dew =
|
||||
document.createElement(
|
||||
"td"
|
||||
);
|
||||
|
||||
Rank.textContent =
|
||||
Player.Rank + ".";
|
||||
|
||||
Username.textContent =
|
||||
Player.Username;
|
||||
|
||||
Dew.textContent =
|
||||
Player.Dew;
|
||||
|
||||
Row.append(
|
||||
Rank,
|
||||
Username,
|
||||
Dew
|
||||
);
|
||||
|
||||
Body.appendChild(
|
||||
Row
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user