Skip to content

Commit

Permalink
win loss draw for wsmatches
Browse files Browse the repository at this point in the history
  • Loading branch information
userXinos committed May 17, 2024
1 parent ff6a10f commit 2bb137b
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions src/pages/WSMatches.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@
<span>{{ match.Corporation2Name }}</span>
</p>
<p class="score">
<span class="corp-info">{{ getCorpStat(match.Corporation1Id) }}</span>
<span>{{ match.Corporation1Score }}</span>
<span> - </span>
<span>{{ match.Corporation2Score }}</span>
<span class="corp-info">{{ getCorpStat(match.Corporation2Id) }}</span>
</p>
<p v-if="(match.DateEnded - nowDate) > 0">
<!--suppress TypeScriptValidateTypes -->
Expand Down Expand Up @@ -133,6 +135,16 @@ async function fetchData() {
response.value = await fetch(matchesUrl)
.then((r) => r.json());
}
function getCorpStat(id: string) {
const corp = corps.value.find((e) => e.Id == id);
if (corp) {
const [w, l, d, e] = Object.entries(corp)
.filter(([k]) => !['Name', 'Id'].includes(k))
.map(([, v]) => v);
return `[W:${w}/L:${l}/D:${d}/E:${e}]`;
}
}
</script>
<style scoped lang="scss">
Expand Down Expand Up @@ -178,11 +190,19 @@ async function fetchData() {
}
.score {
font-size: 150%;
span {
color: $border-color;
display: flex;
align-items: start;
justify-content: center;
gap: 8px;
span:not(.corp-info) {
font-size: 150%;
color: $border-color;
}
span.corp-info {
font-size: 90%;
}
}
.corp-names {
Expand Down

0 comments on commit 2bb137b

Please sign in to comment.