refactored image viewer out GalleryPage

This commit is contained in:
ManjaroOne666 2019-01-04 14:34:32 +00:00
parent cc160d0b7a
commit 639d0c9ed8
2 changed files with 64 additions and 29 deletions

View File

@ -0,0 +1,58 @@
<template>
<div class="image-viewer"
:class="{ 'is-visible': isVisible }">
<div class="close-viewer"
@click="$emit('close')">
X
</div>
</div>
</template>
<script>
export default {
props: {
isVisible: {
type: Boolean,
required: true
}
},
data () {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.image-viewer {
background: linear-gradient(
to bottom left,
magenta,
cyan
); // TEMP
}
@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;
}
}
}
</style>

View File

@ -1,12 +1,8 @@
<template> <template>
<div class="gallery-page"> <div class="gallery-page">
<div class="image-viewer" <GalleryImageViewer class="image-viewer"
:class="{ 'is-visible': imageViewerIsVisible }"> :is-visible="imageViewerIsVisible"
<div class="close-viewer" @close="imageViewerIsVisible = false" />
@click="toggleImageViewer">
X
</div>
</div>
<div class="gallery"> <div class="gallery">
<GalleryFeatured class="gallery__featured" <GalleryFeatured class="gallery__featured"
:featured-height="featuredImageHeight" :featured-height="featuredImageHeight"
@ -21,11 +17,13 @@
<script> <script>
import GalleryFeatured from '@/components/GalleryFeatured' import GalleryFeatured from '@/components/GalleryFeatured'
import GalleryThumbs from '@/components/GalleryThumbs' import GalleryThumbs from '@/components/GalleryThumbs'
import GalleryImageViewer from '@/components/GalleryImageViewer'
export default { export default {
components: { components: {
GalleryFeatured, GalleryFeatured,
GalleryThumbs GalleryThumbs,
GalleryImageViewer
}, },
props: { props: {
@ -43,9 +41,6 @@ export default {
}, },
methods: { methods: {
toggleImageViewer () {
this.imageViewerIsVisible = !this.imageViewerIsVisible;
}
} }
} }
</script> </script>
@ -63,11 +58,6 @@ export default {
height: 100%; height: 100%;
top: 0; top: 0;
left: 0; left: 0;
background: linear-gradient(
to bottom left,
magenta,
cyan
); // TEMP
} }
@media (max-width: $bp__layout) { @media (max-width: $bp__layout) {
@ -93,19 +83,6 @@ export default {
font-size: 10em; font-size: 10em;
cursor: pointer; cursor: pointer;
} }
.image-viewer {
z-index: 50;
transition: opacity 1s; //TEMP
opacity: 0;
pointer-events: none;
&.is-visible {
opacity: 1;
pointer-events: auto;
}
}
} }
@media (min-width: $bp__layout) { @media (min-width: $bp__layout) {