mirror of
https://github.com/OpenLiberty/liberty-bikes.git
synced 2025-01-18 10:23:58 +08:00
Rearrange leaderboard order
This commit is contained in:
parent
8a7ddfc8b1
commit
7dbe318f58
@ -3,64 +3,6 @@
|
||||
</div>
|
||||
|
||||
<div id="boardContainer">
|
||||
<div id="wins" class="leaderboard" *ngIf="currentBoard === 'wins'" [@swap]="currentBoard">
|
||||
<div class="row header">
|
||||
<span class="rank">Rank</span>
|
||||
<span class="player">Player</span>
|
||||
<span class="value">Wins</span>
|
||||
</div>
|
||||
<div *ngFor="let r of winsRankings, let i = index" [ngClass]="{
|
||||
row: true,
|
||||
body: true,
|
||||
first: i === 0,
|
||||
second: i === 1,
|
||||
third: i === 2
|
||||
}">
|
||||
<span class="rank">{{i + 1}}</span>
|
||||
<span class="player">{{r.name}}</span>
|
||||
<span class="value">{{r.numWins}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="games" class="leaderboard" *ngIf="currentBoard === 'totalGames'" [@swap]="currentBoard">
|
||||
<div class="row header">
|
||||
<span class="rank">Rank</span>
|
||||
<span class="player">Player</span>
|
||||
<span class="value">Games</span>
|
||||
</div>
|
||||
<div *ngFor="let r of gamesRankings, let i = index" [ngClass]="{
|
||||
row: true,
|
||||
body: true,
|
||||
first: i === 0,
|
||||
second: i === 1,
|
||||
third: i === 2
|
||||
}">
|
||||
<span class="rank">{{i + 1}}</span>
|
||||
<span class="player">{{r.name}}</span>
|
||||
<span class="value">{{r.totalGames}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="ratio" class="leaderboard" *ngIf="currentBoard === 'winLossRatio'" [@swap]="currentBoard">
|
||||
<div class="row header">
|
||||
<span class="rank">Rank</span>
|
||||
<span class="player">Player</span>
|
||||
<span class="value">Win Rate</span>
|
||||
</div>
|
||||
<div *ngFor="let r of ratioRankings, let i = index" [ngClass]="{
|
||||
row: true,
|
||||
body: true,
|
||||
first: i === 0,
|
||||
second: i === 1,
|
||||
third: i === 2
|
||||
}">
|
||||
<span class="rank">{{i + 1}}</span>
|
||||
<span class="player">{{r.name}}</span>
|
||||
<!-- Format is minimum one place before decimal, min and max 2 places after decimal. -->
|
||||
<span class="value">{{r.winLossRatio | number: '1.2-2'}}%</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="rating" class="leaderboard" *ngIf="currentBoard === 'rating'" [@swap]="currentBoard">
|
||||
<div class="row header">
|
||||
<span class="rank">Rank</span>
|
||||
@ -79,4 +21,59 @@
|
||||
<span class="value">{{r.rating}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ratio" class="leaderboard" *ngIf="currentBoard === 'winLossRatio'" [@swap]="currentBoard">
|
||||
<div class="row header">
|
||||
<span class="rank">Rank</span>
|
||||
<span class="player">Player</span>
|
||||
<span class="value">Win Rate</span>
|
||||
</div>
|
||||
<div *ngFor="let r of ratioRankings, let i = index" [ngClass]="{
|
||||
row: true,
|
||||
body: true,
|
||||
first: i === 0,
|
||||
second: i === 1,
|
||||
third: i === 2
|
||||
}">
|
||||
<span class="rank">{{i + 1}}</span>
|
||||
<span class="player">{{r.name}}</span>
|
||||
<!-- Format is minimum one place before decimal, min and max 2 places after decimal. -->
|
||||
<span class="value">{{r.winLossRatio | number: '1.2-2'}}%</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="wins" class="leaderboard" *ngIf="currentBoard === 'wins'" [@swap]="currentBoard">
|
||||
<div class="row header">
|
||||
<span class="rank">Rank</span>
|
||||
<span class="player">Player</span>
|
||||
<span class="value">Wins</span>
|
||||
</div>
|
||||
<div *ngFor="let r of winsRankings, let i = index" [ngClass]="{
|
||||
row: true,
|
||||
body: true,
|
||||
first: i === 0,
|
||||
second: i === 1,
|
||||
third: i === 2
|
||||
}">
|
||||
<span class="rank">{{i + 1}}</span>
|
||||
<span class="player">{{r.name}}</span>
|
||||
<span class="value">{{r.numWins}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="games" class="leaderboard" *ngIf="currentBoard === 'totalGames'" [@swap]="currentBoard">
|
||||
<div class="row header">
|
||||
<span class="rank">Rank</span>
|
||||
<span class="player">Player</span>
|
||||
<span class="value">Games</span>
|
||||
</div>
|
||||
<div *ngFor="let r of gamesRankings, let i = index" [ngClass]="{
|
||||
row: true,
|
||||
body: true,
|
||||
first: i === 0,
|
||||
second: i === 1,
|
||||
third: i === 2
|
||||
}">
|
||||
<span class="rank">{{i + 1}}</span>
|
||||
<span class="player">{{r.name}}</span>
|
||||
<span class="value">{{r.totalGames}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -84,16 +84,16 @@ export class LeaderboardComponent implements OnInit {
|
||||
nextLeaderboard(board: number) {
|
||||
switch (board % 4) {
|
||||
case 0:
|
||||
this.currentBoard = 'wins';
|
||||
this.currentBoard = 'rating';
|
||||
break;
|
||||
case 1:
|
||||
this.currentBoard = 'totalGames';
|
||||
break;
|
||||
case 2:
|
||||
this.currentBoard = 'winLossRatio';
|
||||
break;
|
||||
case 2:
|
||||
this.currentBoard = 'wins';
|
||||
break;
|
||||
default:
|
||||
this.currentBoard = 'rating';
|
||||
this.currentBoard = 'totalGames';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user