diff --git a/src/ui/Highscore.vue b/src/ui/Highscore.vue index 194b1d6..46046c4 100644 --- a/src/ui/Highscore.vue +++ b/src/ui/Highscore.vue @@ -73,9 +73,8 @@ ol { gap: 5%; .single-winner { - width: 12.5em; + width: 100%; background: $primary; - padding: 1em 0 0 1em; display: grid; grid-template: 1fr .3fr / 1fr 1fr 1fr; align-items: center; @@ -88,11 +87,15 @@ ol { grid-row: 1; grid-column: 1 / 3; font-size: 3em; + margin-left: 5px; + padding: .2em 0 0 5px; } .winner-name { grid-row: 2; grid-column: 1 / -1; + margin-left: 5px; + padding-left: 5px; } .winner-icon { diff --git a/src/ui/TotalBought.vue b/src/ui/TotalBought.vue index 128c13b..327090f 100644 --- a/src/ui/TotalBought.vue +++ b/src/ui/TotalBought.vue @@ -21,16 +21,12 @@ " :key="color.name" > -

+

{{translate(color.name)}} vinnersjanse -

-

{{ color.totalPercentage }}% vinn

-
-
{{ color.win }} vinn
-
+ {{ color.totalPercentage }}% +

{{ color.total }} kjøpte

+

{{ color.win }} vinn

@@ -53,16 +49,18 @@ export default { redPercentage: 0, yellowPercentage: 0, greenPercentage: 0, - bluePercentage: 0 + bluePercentage: 0, }; }, async mounted() { let response = await colorStatistics(); + this.red = response.red; this.blue = response.blue; this.green = response.green; this.yellow = response.yellow; this.total = response.total; + this.totalWin = this.red.win + this.yellow.win + this.blue.win + this.green.win; this.stolen = response.stolen; @@ -133,14 +131,17 @@ export default { return this.round(win == 0 ? 0 : (win / total) * 100); }, round: function(number) { - return Math.round(number * 100) / 100; + + //this can make the odds added together more than 100%, maybe rework? + let actualPercentage = Math.round(number * 100) / 100; + let rounded = actualPercentage.toFixed(0); + return rounded; } } };