marc-leopold/components/GalleryImageViewer.vue

83 lines
1.2 KiB
Vue
Raw Normal View History

<template>
<div class="image-viewer"
2019-01-09 21:23:03 +00:00
:class="{ 'is-visible': isVisible }"
:style="imageViewerStyle">
<div class="close-viewer"
@click="$emit('close')">
X
</div>
</div>
</template>
<script>
export default {
props: {
isVisible: {
type: Boolean,
required: true
2019-01-09 21:23:03 +00:00
},
imageUrl: {
type: String,
required: false,
default () {
return ''
}
}
},
data () {
return {
}
},
2019-01-09 21:23:03 +00:00
computed: {
imageViewerStyle () {
return {
backgroundImage: 'url(' + this.imageUrl + ')'
}
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.image-viewer {
background: linear-gradient(
to bottom left,
magenta,
cyan
); // TEMP
2019-01-09 21:23:03 +00:00
background-size: cover;
background-position: center center;
}
@media (max-width: $bp__layout) {
.close-viewer {
font-size: 10em;
cursor: pointer;
}
.image-viewer {
z-index: 50;
transition: opacity 1s; //TEMP
opacity: 0;
pointer-events: none;
&.is-visible {
opacity: 1;
pointer-events: auto;
}
}
}
2019-01-09 21:23:03 +00:00
@media (min-width: $bp__layout) {
.close-viewer {
display: none;
}
}
</style>