diff --git a/src/ui/Banner.vue b/src/ui/Banner.vue index 68cabbc..d516024 100644 --- a/src/ui/Banner.vue +++ b/src/ui/Banner.vue @@ -4,8 +4,8 @@

- {{ pad(days) }} - {{ pad(hours) }}{{ pad(days) }}: {{ pad(hours) }}: {{ pad(minutes) }}: {{ pad(seconds) }} @@ -58,9 +58,11 @@ export default { initialize: function() { let d = new Date(); let dayOfLottery = 5; - let nextDayOfLottery = new Date( - d.setDate(d.getDate() + ((5 + 7 - d.getDay()) % 7)) - ); + let dayDifference = (dayOfLottery + 7 - d.getDay()) % 7; + if (dayDifference == 0) { + dayDifference = 7; + } + let nextDayOfLottery = new Date(d.setDate(d.getDate() + dayDifference)); nextDayOfLottery = new Date(nextDayOfLottery.setHours(15)); nextDayOfLottery = new Date(nextDayOfLottery.setMinutes(0)); nextDayOfLottery = new Date(nextDayOfLottery.setSeconds(0)); @@ -130,5 +132,8 @@ export default { color: #333333; display: flex; font-family: Arial; + h2 { + display: flex; + } } diff --git a/src/ui/Countdown.vue b/src/ui/Countdown.vue index 538a225..c3ba191 100644 --- a/src/ui/Countdown.vue +++ b/src/ui/Countdown.vue @@ -2,8 +2,8 @@

- {{ days }} dager,  - {{ pad(hours) }}{{ pad(days) }}: {{ pad(hours) }}: {{ pad(minutes) }}: {{ pad(seconds) }} @@ -71,9 +71,11 @@ export default { initialize: function() { let d = new Date(); let dayOfLottery = 5; - let nextDayOfLottery = new Date( - d.setDate(d.getDate() + ((5 + 7 - d.getDay()) % 7)) - ); + let dayDifference = (dayOfLottery + 7 - d.getDay()) % 7; + if (dayDifference == 0) { + dayDifference = 7; + } + let nextDayOfLottery = new Date(d.setDate(d.getDate() + dayDifference)); nextDayOfLottery = new Date(nextDayOfLottery.setHours(15)); nextDayOfLottery = new Date(nextDayOfLottery.setMinutes(0)); nextDayOfLottery = new Date(nextDayOfLottery.setSeconds(0)); diff --git a/src/ui/Vipps.vue b/src/ui/Vipps.vue index 668b475..5b934fc 100644 --- a/src/ui/Vipps.vue +++ b/src/ui/Vipps.vue @@ -1,14 +1,14 @@ @@ -17,12 +17,22 @@ export default { props: { amount: Number }, + data() { + return { + qrLink: + "https://chart.googleapis.com/chart?chs=221x221&cht=qr&choe=UTF-8&chld=L|1&chl=https://qr.vipps.no/28/2/01/031/4797740427?v=1&m=Vinlotteri🍾&a=" + + 100 * this.amount + }; + }, methods: { openVipps: () => { - window.location.assign('https://qr.vipps.no/28/2/01/031/4797740427?v=1&m=Vinlotteri🍾&a=' + 100 * this.amount) + window.location.assign( + "https://chart.googleapis.com/chart?chs=221x221&cht=qr&choe=UTF-8&chld=L|1&chl=https://qr.vipps.no/28/2/01/031/4797740427?v=1&m=Vinlotteri🍾&a=" + + 100 * this.amount + ); } } -} +};