Bestenliste
This commit is contained in:
@@ -39,6 +39,18 @@ class ScoreManager{
|
||||
|
||||
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;
|
||||
@@ -32,6 +32,13 @@
|
||||
</th>
|
||||
</thead>
|
||||
</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 class="container">
|
||||
|
||||
@@ -8,19 +8,19 @@ class HighScoreLoader{
|
||||
}
|
||||
|
||||
async setup(){
|
||||
const response = await fetch("/api/highscore");
|
||||
this.data = await response.json();
|
||||
// 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>
|
||||
`
|
||||
}
|
||||
// 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>
|
||||
// `;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,4 +65,12 @@ tr td:nth-child(3) {
|
||||
}
|
||||
tr td:last-child {
|
||||
border-left: 3px solid rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
}
|
||||
|
||||
#siteSelector{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user