object-fit and redesign top-wines
This commit is contained in:
@@ -122,8 +122,6 @@ export default {
|
|||||||
@import "../styles/media-queries.scss";
|
@import "../styles/media-queries.scss";
|
||||||
@import "../styles/variables.scss";
|
@import "../styles/variables.scss";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.top-container {
|
.top-container {
|
||||||
height: 30em;
|
height: 30em;
|
||||||
background-color: $primary;
|
background-color: $primary;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ ol {
|
|||||||
|
|
||||||
.winner-list-container {
|
.winner-list-container {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(12.5em, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(12.5em, 1fr));
|
||||||
gap: 5%;
|
gap: 5%;
|
||||||
|
|
||||||
.single-winner {
|
.single-winner {
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ export default {
|
|||||||
.bought-container {
|
.bought-container {
|
||||||
margin-top: 2em;
|
margin-top: 2em;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||||
grid-gap: 50px;
|
grid-gap: 50px;
|
||||||
|
|
||||||
.ballot-element-local {
|
.ballot-element-local {
|
||||||
|
|||||||
111
src/ui/Wines.vue
111
src/ui/Wines.vue
@@ -1,21 +1,29 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="wines.length > 0">
|
<div v-if="wines.length > 0" class="wines-main-container">
|
||||||
<h3>
|
<div class="info-and-link">
|
||||||
<router-link to="viner"
|
<h3>
|
||||||
>Topp 10 viner <span class="vin-link">Se alle ></span></router-link
|
Topp 5 viner
|
||||||
>
|
</h3>
|
||||||
</h3>
|
<router-link to="viner">
|
||||||
<ol class="list-container">
|
<span class="vin-link">Se alle viner </span>
|
||||||
<li v-for="(wine, index) in wines" :key="wine" class="single-item">
|
</router-link>
|
||||||
<span class="wine-occurences">{{ index + 1}}.</span>
|
</div>
|
||||||
|
<div class="wine-container">
|
||||||
|
<div v-for="wine in wines" :key="wine" class="single-item">
|
||||||
|
<!-- <span class="wine-occurences">{{ index + 1}}.</span> -->
|
||||||
|
<div class="hearts-container">
|
||||||
|
<span>{{wine.occurences}}</span>
|
||||||
|
<i class="icon icon--heart"></i>
|
||||||
|
</div>
|
||||||
|
<img :src="wine.image" class="wine-image">
|
||||||
|
<!-- <span class="wine-win-info"> {{ wine.occurences }} {{amount(wine.occurences)}}</span> -->
|
||||||
<span class="wine-name">{{ wine.name }}</span>
|
<span class="wine-name">{{ wine.name }}</span>
|
||||||
<span class="wine-win-info"> {{ wine.occurences }} {{amount(wine.occurences)}}</span>
|
<!-- <a
|
||||||
<a
|
|
||||||
class="wine-link"
|
class="wine-link"
|
||||||
:href="wine.vivinoLink"
|
:href="wine.vivinoLink"
|
||||||
>Les mer</a>
|
>Les mer</a> -->
|
||||||
</li>
|
</div>
|
||||||
</ol>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -29,7 +37,10 @@ export default {
|
|||||||
Wine
|
Wine
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return { wines: [], clickedWine: null, wineOpen: false };
|
return {
|
||||||
|
wines: [],
|
||||||
|
clickedWine: null,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
let response = await overallWineStatistics();
|
let response = await overallWineStatistics();
|
||||||
@@ -49,7 +60,7 @@ export default {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
this.wines = response.slice(0, 10);
|
this.wines = response.slice(0, 5);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
amount(occurences){
|
amount(occurences){
|
||||||
@@ -124,39 +135,61 @@ export default {
|
|||||||
@import "./src/styles/global.scss";
|
@import "./src/styles/global.scss";
|
||||||
@import "../styles/media-queries.scss";
|
@import "../styles/media-queries.scss";
|
||||||
|
|
||||||
h3 {
|
.wines-main-container {
|
||||||
& a {
|
margin-bottom: 10em;
|
||||||
text-decoration: none;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-container{
|
.info-and-link{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.wine-container {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid: auto-flow min-content / 1fr;
|
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||||
row-gap: 5px;
|
grid-gap: 2rem;
|
||||||
padding: 0;
|
|
||||||
|
|
||||||
.single-item{
|
.single-item{
|
||||||
|
height: 400px;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid: 1fr / .1fr 1fr .3fr .3fr;
|
grid-template-rows: .3fr 1fr .3fr;
|
||||||
|
|
||||||
.wine-occurences{
|
grid-gap: 1em;
|
||||||
font-weight: bold;
|
-webkit-box-shadow: 0px 2px 21px -1px rgba(127,127,127,0.5);
|
||||||
|
-moz-box-shadow: 0px 2px 21px -1px rgba(127,127,127,0.5);
|
||||||
|
box-shadow: 0px 2px 21px -1px rgba(127,127,127,0.5);
|
||||||
|
|
||||||
|
.hearts-container{
|
||||||
|
margin: 10px 10px 0 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
justify-self: end;
|
||||||
|
|
||||||
|
width: 80px;
|
||||||
|
height: 30px;
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
border-radius: 20px;
|
||||||
|
|
||||||
|
.icon--heart{
|
||||||
|
font-size: 30px;
|
||||||
|
color: $link-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.wine-image {
|
||||||
|
width: 60px;
|
||||||
|
height: 200px;
|
||||||
|
align-self: center;
|
||||||
|
justify-self: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wine-name{
|
.wine-name{
|
||||||
display: inline-block;
|
margin-left: 1em;
|
||||||
text-overflow: ellipsis;
|
margin-right: .5em;
|
||||||
white-space: nowrap;
|
padding-bottom: 1em;
|
||||||
overflow: hidden;
|
font-size: 20px;
|
||||||
}
|
|
||||||
|
|
||||||
.wine-link {
|
|
||||||
color: #333333;
|
|
||||||
text-decoration: underline 1px solid $link-color;
|
|
||||||
font-weight: bold;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user