marc-leopold/components/GalleryFeatured.vue

72 lines
1.3 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-17 11:42:41 +00:00
:style="{ '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
},
},
}
</script>
<style lang="scss" scoped>
.featured-image {
width: 100%;
background-size: cover;
background-position: center center;
2019-01-12 20:08:07 +00:00
overflow: hidden;
}
@media (max-width: $bp__layout) {
.featured-image {
2019-01-17 11:42:41 +00:00
height: calc(50vh - #{$site-menu__header-height / 2});
width: 100vw;
flex: 0 0 100vw;
}
2019-01-12 16:51:12 +00:00
.gallery-title {
position: absolute;
display: block;
max-width: 66%;
font-size: 1.5em;
padding: .5em 1em .5em 1em;
margin: 1rem 0 0 0;
color: #fff;
background-color: rgba(0, 0, 0, .3);
border-top-right-radius: 6rem 6rem;
border-bottom-right-radius: 6rem 6rem;
}
}
@media (min-width: $bp__layout) {
2019-01-10 17:17:15 +00:00
.gallery-featured {
transition: opacity .3s; // TEMP
2019-01-12 20:08:07 +00:00
padding: 8px;
2019-01-10 17:17:15 +00:00
}
2019-01-17 12:05:25 +00:00
.featured-image {
height: 0;
padding-top: 100%;
}
}
</style>