mirror of https://github.com/hykilpikonna/AquaDX
[F] Fix ranking typing
parent
37f67469a6
commit
ece64c3f4a
|
@ -46,12 +46,11 @@ h1
|
||||||
|
|
||||||
|
|
||||||
blockquote
|
blockquote
|
||||||
//background: rgba(255, 210, 210, .1)
|
|
||||||
$c1: rgba(255, 149, 149, 0.05)
|
$c1: rgba(255, 149, 149, 0.05)
|
||||||
$c2: rgba(255, 152, 152, 0.12)
|
$c2: rgba(255, 152, 152, 0.12)
|
||||||
background: repeating-linear-gradient(45deg, $c1, $c1 10px, $c2 10px, $c2 20px)
|
background: repeating-linear-gradient(45deg, $c1, $c1 10px, $c2 10px, $c2 20px)
|
||||||
padding: 10px 20px 10px 20px
|
padding: 10px 20px 10px 20px
|
||||||
margin: 0
|
margin: 16px 0
|
||||||
border-left: solid #ff7c7c 3px
|
border-left: solid #ff7c7c 3px
|
||||||
border-radius: 5px
|
border-radius: 5px
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ export interface UserMe {
|
||||||
emailConfirmed: boolean
|
emailConfirmed: boolean
|
||||||
ghostCard: Card
|
ghostCard: Card
|
||||||
cards: Card[]
|
cards: Card[]
|
||||||
computedName: string
|
computedName: string,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CardSummaryGame {
|
export interface CardSummaryGame {
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
import { AQUA_HOST, DATA_HOST } from "./config";
|
import { AQUA_HOST, DATA_HOST } from "./config";
|
||||||
import type { AllMusic, Card, CardSummary, GenericGameSummary, MusicMeta, TrendEntry, UserMe } from "./generalTypes";
|
import type {
|
||||||
|
AllMusic,
|
||||||
|
Card,
|
||||||
|
CardSummary,
|
||||||
|
GenericGameSummary,
|
||||||
|
GenericRanking,
|
||||||
|
MusicMeta,
|
||||||
|
TrendEntry,
|
||||||
|
UserMe
|
||||||
|
} from "./generalTypes";
|
||||||
import type { GameName } from "./scoring";
|
import type { GameName } from "./scoring";
|
||||||
|
|
||||||
interface RequestInitWithParams extends RequestInit {
|
interface RequestInitWithParams extends RequestInit {
|
||||||
|
@ -119,7 +128,7 @@ export const GAME = {
|
||||||
post(`/api/v2/game/${game}/trend`, { username }),
|
post(`/api/v2/game/${game}/trend`, { username }),
|
||||||
userSummary: (username: string, game: GameName): Promise<GenericGameSummary> =>
|
userSummary: (username: string, game: GameName): Promise<GenericGameSummary> =>
|
||||||
post(`/api/v2/game/${game}/user-summary`, { username }),
|
post(`/api/v2/game/${game}/user-summary`, { username }),
|
||||||
ranking: (game: GameName): Promise<GenericGameSummary> =>
|
ranking: (game: GameName): Promise<GenericRanking[]> =>
|
||||||
post(`/api/v2/game/${game}/ranking`, { }),
|
post(`/api/v2/game/${game}/ranking`, { }),
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +1,28 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {CHARTJS_OPT, clz, registerChart, renderCal, title} from "../libs/ui";
|
import { title } from "../libs/ui";
|
||||||
import { DATA, GAME } from "../libs/sdk";
|
import { GAME } from "../libs/sdk";
|
||||||
import type { GenericRanking } from "../libs/generalTypes";
|
import type { GenericRanking } from "../libs/generalTypes";
|
||||||
|
|
||||||
title(`Ranking`)
|
title(`Ranking`)
|
||||||
|
|
||||||
let d: {
|
let d: { users: GenericRanking[] }
|
||||||
user: GenericRanking
|
|
||||||
} | null = null
|
|
||||||
|
|
||||||
Promise.all([
|
Promise.all([
|
||||||
GAME.ranking('mai2')
|
GAME.ranking('mai2')
|
||||||
]).then(([user]) => {
|
]).then(([ users ]) => {
|
||||||
console.log(user)
|
d = { users }
|
||||||
|
|
||||||
d = {user}
|
|
||||||
localStorage.setItem("tmp-ranking-details", JSON.stringify(d))
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<main class="content">
|
<main class="content">
|
||||||
<h2>Global Leaderboard</h2>
|
<h2>Global Leaderboard</h2>
|
||||||
|
|
||||||
{#if d !== null}
|
{#if d}
|
||||||
{#each d.user as user}
|
{#each d.users as user}
|
||||||
<div class="lb-placement">
|
<div class="lb-placement">
|
||||||
<p class="placement-rank">{user.rank}</p>
|
<p class="placement-rank">{user.rank}</p>
|
||||||
<h4 class="placement-name">{user.name}</h4>
|
<h4 class="placement-name">{user.name}</h4>
|
||||||
<h4 class="placement-accuracy">{(user.accuracy / 1).toFixed(2)}%</h4>
|
<h4 class="placement-accuracy">{(+user.accuracy).toFixed(2)}%</h4>
|
||||||
<h4 class="placement-rating">{user.rating}</h4>
|
<h4 class="placement-rating">{user.rating}</h4>
|
||||||
<h4 class="placement-full-combo">{user.fullCombo}</h4>
|
<h4 class="placement-full-combo">{user.fullCombo}</h4>
|
||||||
<h4 class="placement-all-perfect">{user.allPerfect}</h4>
|
<h4 class="placement-all-perfect">{user.allPerfect}</h4>
|
||||||
|
|
Loading…
Reference in New Issue