diff --git a/src/ui/Banner.vue b/src/ui/Banner.vue index d516024..77421b6 100644 --- a/src/ui/Banner.vue +++ b/src/ui/Banner.vue @@ -10,7 +10,7 @@ >: {{ pad(seconds) }} -

Lotteriet har begynt!

+

Lotteriet har begynt!

diff --git a/src/ui/Countdown.vue b/src/ui/Countdown.vue index c3ba191..0666080 100644 --- a/src/ui/Countdown.vue +++ b/src/ui/Countdown.vue @@ -9,7 +9,7 @@ {{ pad(seconds) }}
X
-

Lotteriet har begynt!

+

Lotteriet har begynt!

diff --git a/src/ui/TotalBought.vue b/src/ui/TotalBought.vue index a676338..47fbd27 100644 --- a/src/ui/TotalBought.vue +++ b/src/ui/TotalBought.vue @@ -2,42 +2,30 @@

Loddstatistikk

-
+
- {{ red.total }} + {{ + color.total + }} kjøpte
-
{{ red.win }} vinn - {{ redPercentage }}% vinn
-
-
-
-
- {{ blue.total }} - kjøpte -
-
-
{{ blue.win }} vinn - {{ bluePercentage }}% vinn
-
-
-
-
- {{ yellow.total }} - kjøpte -
-
-
{{ yellow.win }} vinn - {{ yellowPercentage }}% vinn
-
-
-
-
- {{ green.total }} - kjøpte -
-
-
{{ green.win }} vinn - {{ greenPercentage }}% vinn
+
+ {{ color.win }} vinn - + {{ color.totalPercentage }}% +
+
+ {{ color.percentage }}% vinn +
+
Totalt  @@ -52,6 +40,7 @@ export default { data() { return { + colors: [], red: 0, blue: 0, yellow: 0, @@ -88,8 +77,42 @@ export default { this.yellowPercentage = this.round( this.yellow.win == 0 ? 0 : (this.yellow.win / this.totalWin) * 100 ); + + this.colors.push({ + name: "red", + total: this.red.total, + win: this.red.win, + totalPercentage: this.getPercentage(this.red.win, this.totalWin), + percentage: this.getPercentage(this.red.win, this.red.total) + }); + this.colors.push({ + name: "blue", + total: this.blue.total, + win: this.blue.win, + totalPercentage: this.getPercentage(this.blue.win, this.totalWin), + percentage: this.getPercentage(this.blue.win, this.blue.total) + }); + this.colors.push({ + name: "yellow", + total: this.yellow.total, + win: this.yellow.win, + totalPercentage: this.getPercentage(this.yellow.win, this.totalWin), + percentage: this.getPercentage(this.yellow.win, this.yellow.total) + }); + this.colors.push({ + name: "green", + total: this.green.total, + win: this.green.win, + totalPercentage: this.getPercentage(this.green.win, this.totalWin), + percentage: this.getPercentage(this.green.win, this.green.total) + }); + + this.colors = this.colors.sort((a, b) => (a.win > b.win ? -1 : 1)); }, methods: { + getPercentage: function(win, total) { + return this.round(win == 0 ? 0 : (win / total) * 100); + }, round: function(number) { return Math.round(number * 100) / 100; } @@ -172,6 +195,12 @@ export default { font-weight: bold; } +.small { + font-weight: bold; + font-size: 1.25rem; + display: inline-block; +} + .green { color: $green; }