update: image moved from background-image to image element

This commit is contained in:
ManjaroOne666 2019-01-13 10:35:38 +00:00
parent 97996d0b71
commit eb6069175c
1 changed files with 28 additions and 2 deletions

View File

@ -1,9 +1,13 @@
<template> <template>
<div class="image-viewer" <div class="image-viewer"
:class="{ 'is-visible': isVisible }"> :class="{ 'is-visible': isVisible }">
<div class="image-container" <div class="viewer-background"
:style="backgroundStyle"> :style="backgroundStyle">
</div> </div>
<div class="image-container">
<img class="image"
:src="imageUrl">
</div>
<div class="close-viewer mobile-only" <div class="close-viewer mobile-only"
@click="$emit('close')"> @click="$emit('close')">
X X
@ -68,7 +72,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.image-viewer { .image-viewer {
background-color: blue; background-color: #222;
} }
.image-container { .image-container {
@ -77,6 +81,16 @@ export default {
background-color: transparent; background-color: transparent;
} }
.image {
width: auto;
height: auto;
max-height: 100%;
max-width: 100%;
margin: 0 auto;
top: 50%;
transform: translateY(-50%);
}
@media (max-width: $bp__layout) { @media (max-width: $bp__layout) {
.close-viewer { .close-viewer {
position: absolute; position: absolute;
@ -142,5 +156,17 @@ export default {
bottom: 8px; bottom: 8px;
background-position: top center; background-position: top center;
} }
.viewer-background {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-size: 100% 100%;
background-position: center center;
filter: blur(100px);
opacity: .3;
}
} }
</style> </style>