Bestenliste

This commit is contained in:
2025-05-02 12:38:45 +02:00
parent dad3d8826d
commit b36d7a4274
4 changed files with 40 additions and 13 deletions

View File

@@ -39,6 +39,18 @@ class ScoreManager{
return allSortetScores.indexOf(score) + 1; return allSortetScores.indexOf(score) + 1;
} }
async getSplitedScoreCount(){
const allSortetScores = await this.getAllScores();
const count = Math.ceil(allSortetScores.lenght / 25);
return count;
}
async getSpiltedScore(count){
}
} }
module.exports = ScoreManager; module.exports = ScoreManager;

View File

@@ -32,6 +32,13 @@
</th> </th>
</thead> </thead>
</table> </table>
<div id="siteSelector">
<label for="site">Seite</label>
<select id="site" name="site">
<option>1</option>
<option>2</option>
</select>
</div>
</div> </div>
</div> </div>
<div class="container"> <div class="container">

View File

@@ -8,19 +8,19 @@ class HighScoreLoader{
} }
async setup(){ async setup(){
const response = await fetch("/api/highscore"); // const response = await fetch("/api/highscore");
this.data = await response.json(); // this.data = await response.json();
for(const score of this.data.scores){ // for(const score of this.data.scores){
this.table.innerHTML += ` // this.table.innerHTML += `
<tr> // <tr>
<td>${score.rang}</td> // <td>${score.rang}</td>
<td>${score.user1.username}</td> // <td>${score.user1.username}</td>
<td>${score.user2.username}</td> // <td>${score.user2.username}</td>
<td>${score.score}</td> // <td>${score.score}</td>
</tr> // </tr>
` // `;
} // }
} }
} }

View File

@@ -66,3 +66,11 @@ tr td:nth-child(3) {
tr td:last-child { tr td:last-child {
border-left: 3px solid rgba(255, 255, 255, 0.6); border-left: 3px solid rgba(255, 255, 255, 0.6);
} }
#siteSelector{
display: flex;
align-items: center;
justify-content: center;
}