From b36d7a427495f0b3ff8e57731780347c28206ca4 Mon Sep 17 00:00:00 2001 From: Jonas Date: Fri, 2 May 2025 12:38:45 +0200 Subject: [PATCH] Bestenliste --- .../src/Database/ScoreManager/ScoreManager.js | 12 ++++++++++ frontend/highscores/index.html | 7 ++++++ frontend/highscores/index.js | 24 +++++++++---------- frontend/highscores/style.css | 10 +++++++- 4 files changed, 40 insertions(+), 13 deletions(-) diff --git a/backend/src/Database/ScoreManager/ScoreManager.js b/backend/src/Database/ScoreManager/ScoreManager.js index 996db88..eb3fde4 100644 --- a/backend/src/Database/ScoreManager/ScoreManager.js +++ b/backend/src/Database/ScoreManager/ScoreManager.js @@ -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; \ No newline at end of file diff --git a/frontend/highscores/index.html b/frontend/highscores/index.html index 077b6b5..326b6b9 100644 --- a/frontend/highscores/index.html +++ b/frontend/highscores/index.html @@ -32,6 +32,13 @@ +
+ + +
diff --git a/frontend/highscores/index.js b/frontend/highscores/index.js index ed9b70d..0586f48 100644 --- a/frontend/highscores/index.js +++ b/frontend/highscores/index.js @@ -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 += ` - - ${score.rang} - ${score.user1.username} - ${score.user2.username} - ${score.score} - - ` - } + // for(const score of this.data.scores){ + // this.table.innerHTML += ` + // + // ${score.rang} + // ${score.user1.username} + // ${score.user2.username} + // ${score.score} + // + // `; + // } } } diff --git a/frontend/highscores/style.css b/frontend/highscores/style.css index 879a514..2eb86ee 100644 --- a/frontend/highscores/style.css +++ b/frontend/highscores/style.css @@ -65,4 +65,12 @@ tr td:nth-child(3) { } tr td:last-child { border-left: 3px solid rgba(255, 255, 255, 0.6); -} \ No newline at end of file +} + +#siteSelector{ + display: flex; + align-items: center; + justify-content: center; +} + + \ No newline at end of file