diff options
author | mat <github@matdoes.dev> | 2022-06-22 16:48:29 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-06-22 16:48:29 -0500 |
commit | 16ac913b9f9eab9c342083ea5641540eb3a0c3cc (patch) | |
tree | 288c6a9b2c8826a167d019bb61f88ffa484ae738 | |
parent | 90f4b2c916cdd7f61843c7a2c7f4451d44e18367 (diff) | |
download | skyblock-stats-16ac913b9f9eab9c342083ea5641540eb3a0c3cc.tar.gz skyblock-stats-16ac913b9f9eab9c342083ea5641540eb3a0c3cc.tar.bz2 skyblock-stats-16ac913b9f9eab9c342083ea5641540eb3a0c3cc.zip |
Add skill average & actually fix active profile indicator
-rw-r--r-- | src/lib/APITypes.d.ts | 1 | ||||
-rw-r--r-- | src/routes/player/[player]/[profile].svelte | 23 | ||||
-rw-r--r-- | src/routes/player/[player]/index.svelte | 3 |
3 files changed, 25 insertions, 2 deletions
diff --git a/src/lib/APITypes.d.ts b/src/lib/APITypes.d.ts index 236abc3..92153cf 100644 --- a/src/lib/APITypes.d.ts +++ b/src/lib/APITypes.d.ts @@ -421,6 +421,7 @@ export interface Skills { * warning to the user. */ apiEnabled: boolean + average: number } diff --git a/src/routes/player/[player]/[profile].svelte b/src/routes/player/[player]/[profile].svelte index 544d3c4..82d5471 100644 --- a/src/routes/player/[player]/[profile].svelte +++ b/src/routes/player/[player]/[profile].svelte @@ -159,7 +159,12 @@ {#if data.member.skills && data.member.skills.list.length > 0} <section id="skills" class="profile-skills"> - <h2>Skills</h2> + <div class="skill-heading-container"> + <h2 class="inline-heading">Skills</h2> + <span class="average-skill"> + {data.member.skills.average} avg. + </span> + </div> <Skills {data} /> </section> {/if} @@ -379,4 +384,20 @@ width: 100vw !important; } } + + .skill-heading-container { + display: flex; + align-items: center; + justify-content: center; + width: fit-content; + } + .skill-heading-container h2 { + display: inline-block; + margin-right: 0.4em; + margin-bottom: 0; + } + .average-skill { + color: var(--theme-darker-text); + font-size: 0.9rem; + } </style> diff --git a/src/routes/player/[player]/index.svelte b/src/routes/player/[player]/index.svelte index b95ef8a..5a51816 100644 --- a/src/routes/player/[player]/index.svelte +++ b/src/routes/player/[player]/index.svelte @@ -49,6 +49,7 @@ let isActiveProfileOnline: boolean function updateActiveProfile() { + activeProfileLastSave = 0 if (data.profiles) for (const profile of data.profiles) { if (profile.members) @@ -66,7 +67,7 @@ let backgroundUrl: string | null $: { - $navigating + data backgroundUrl = data.customization?.backgroundUrl ?? chooseDefaultBackground(data.player.uuid) updateActiveProfile() } |