Bestenliste hinzugefügt

This commit is contained in:
2025-04-29 12:55:54 +02:00
parent 08a8f567c4
commit dad3d8826d
7 changed files with 176 additions and 2 deletions

View File

@@ -0,0 +1,27 @@
class HighScoreLoader{
constructor(){
this.table = document.getElementById("highscoreTable");
this.data = undefined;
this.setup();
}
async setup(){
const response = await fetch("/api/highscore");
this.data = await response.json();
for(const score of this.data.scores){
this.table.innerHTML += `
<tr>
<td>${score.rang}</td>
<td>${score.user1.username}</td>
<td>${score.user2.username}</td>
<td>${score.score}</td>
</tr>
`
}
}
}
new HighScoreLoader();