marc-leopold/components/GalleryFeatured.vue

67 lines
1.1 KiB
Vue
Raw Normal View History

<template>
2019-01-10 17:17:15 +00:00
<ul class="gallery-featured">
<li v-for="(gallery, index) in galleries"
class="featured-image"
2019-01-10 14:08:58 +00:00
:style="{ 'height': featuredHeight,
'background-image': 'url(' + gallery.featuredImage + ')' }"
:key="index"
@click="$emit('clicked', index)">
<span class="gallery-title">{{ gallery.title }}</span>
</li>
</ul>
</template>
<script>
export default {
props: {
galleries: {
type: Array,
required: true
2019-01-04 13:55:30 +00:00
},
featuredHeight: {
type: String,
required: true
}
},
data () {
return {
}
},
2019-01-10 14:08:58 +00:00
computed: {
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.featured-image {
width: 100%;
background-size: cover;
background-position: center center;
}
@media (max-width: $bp__layout) {
.featured-image {
2019-01-09 12:56:10 +00:00
height: calc(50vh - #{$site-menu__header-height / 2}) !important; // must override inline style set with prop
width: 100vw;
flex: 0 0 100vw;
}
}
@media (min-width: $bp__layout) {
2019-01-10 17:17:15 +00:00
.gallery-featured {
transition: opacity .3s; // TEMP
opacity: .3;
&:hover {
opacity: 1;
}
}
}
</style>