feat: add global winrate

This commit is contained in:
Valentin Kaelin 2019-11-10 19:22:20 +01:00
parent 1774306504
commit 48d2fade07

View file

@ -1,7 +1,6 @@
<template> <template>
<div class="bg-blue-800 rounded-lg"> <div class="bg-blue-800 rounded-lg">
<div class="pb-2"> <div class="relative heading flex justify-center py-4 rounded-t-lg text-blue-200">
<div class="relative flex justify-center py-4 heading rounded-t-lg text-blue-200">
<svg class="w-6 h-6"> <svg class="w-6 h-6">
<use xlink:href="#graph" /> <use xlink:href="#graph" />
</svg> </svg>
@ -173,8 +172,28 @@
</li> </li>
</ul> </ul>
</template> </template>
</div> </div>
<div class="flex flex-col items-center pb-2 leading-snug">
<div
class="text-teal-400 text-xl"
>{{ calculateWinrate(stats.global.wins, stats.global.count).winrate|percent }}</div>
<div class="flex text-sm">
<span
:class="winLossColor(stats.global.wins, stats.global.losses).win"
class=""
>{{ stats.global.wins }}</span>
<span class="mx-1 text-gray-400 font-bold">-</span>
<span
:class="winLossColor(stats.global.wins, stats.global.losses).loss"
class=""
>{{ stats.global.losses }}</span>
</div> </div>
<span class="text-xs">Global winrate</span>
</div>
</div> </div>
</template> </template>