Try get a smaller version of the wine image.

This commit is contained in:
2020-10-11 12:27:01 +02:00
committed by KevinMidboe
parent 584d497c6a
commit 1383a310b3

View File

@@ -27,7 +27,7 @@
</router-link>
<div class="won-wine">
<img :src="win.wine.image">
<img :src="smallerWineImage(win.wine.image)">
<div class="wine-details">
<h3>{{ win.wine.name }}</h3>
@@ -71,6 +71,11 @@ export default {
this.winner = winner
this.winningColors = this.findWinningColors()
},
smallerWineImage(image) {
if (image && image.includes(`515x515`))
return image.replace(`515x515`, `175x175`)
return image
},
findWinningColors() {
const colors = this.winner.highscore.map(win => win.color)
const colorOccurences = {}