2019-01-03 21:11:23 +00:00
|
|
|
<template>
|
|
|
|
<div class="gallery-page">
|
2019-01-04 14:34:32 +00:00
|
|
|
<GalleryImageViewer class="image-viewer"
|
|
|
|
:is-visible="imageViewerIsVisible"
|
2019-01-09 21:23:03 +00:00
|
|
|
:image-url="viewingImageUrl"
|
2019-01-04 14:34:32 +00:00
|
|
|
@close="imageViewerIsVisible = false" />
|
2019-01-04 13:55:30 +00:00
|
|
|
<div class="gallery">
|
|
|
|
<GalleryFeatured class="gallery__featured"
|
|
|
|
:featured-height="featuredImageHeight"
|
2019-01-09 14:12:30 +00:00
|
|
|
:galleries="galleries"
|
|
|
|
@clicked="handleFeaturedClick" />
|
2019-01-04 13:55:30 +00:00
|
|
|
<GalleryThumbs class="gallery__thumbs"
|
|
|
|
:featured-height="featuredImageHeight"
|
2019-01-09 14:12:30 +00:00
|
|
|
:galleries="galleries"
|
2019-01-09 21:23:03 +00:00
|
|
|
:active-row="activeRow"
|
|
|
|
@thumbClick="handleThumbClick"/>
|
2019-01-03 21:11:23 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-01-04 13:10:41 +00:00
|
|
|
import GalleryFeatured from '@/components/GalleryFeatured'
|
|
|
|
import GalleryThumbs from '@/components/GalleryThumbs'
|
2019-01-04 14:34:32 +00:00
|
|
|
import GalleryImageViewer from '@/components/GalleryImageViewer'
|
2019-01-04 13:10:41 +00:00
|
|
|
|
2019-01-03 21:11:23 +00:00
|
|
|
export default {
|
2019-01-04 13:10:41 +00:00
|
|
|
components: {
|
|
|
|
GalleryFeatured,
|
2019-01-04 14:34:32 +00:00
|
|
|
GalleryThumbs,
|
2019-01-04 15:23:13 +00:00
|
|
|
GalleryImageViewer,
|
2019-01-04 13:10:41 +00:00
|
|
|
},
|
|
|
|
|
2019-01-03 21:11:23 +00:00
|
|
|
props: {
|
|
|
|
galleries: {
|
|
|
|
type: Array,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
data () {
|
|
|
|
return {
|
2019-01-04 13:55:30 +00:00
|
|
|
featuredImageHeight: '16rem',
|
2019-01-09 14:12:30 +00:00
|
|
|
imageViewerIsVisible: false,
|
2019-01-09 21:23:03 +00:00
|
|
|
activeRow: 0,
|
|
|
|
activeGalleryIndex: 0,
|
|
|
|
activeImageIndex: 0
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
viewingImageUrl () {
|
|
|
|
return this.galleries[this.activeGalleryIndex].images[this.activeImageIndex].url
|
2019-01-03 21:11:23 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2019-01-09 14:12:30 +00:00
|
|
|
handleFeaturedClick (index) {
|
|
|
|
this.activeRow = index
|
2019-01-09 21:23:03 +00:00
|
|
|
},
|
|
|
|
handleThumbClick(gallery, image) {
|
|
|
|
this.activeGalleryIndex = gallery
|
|
|
|
this.activeImageIndex = image
|
2019-01-09 14:12:30 +00:00
|
|
|
}
|
2019-01-03 21:11:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.gallery-page {
|
|
|
|
position: relative;
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
2019-01-04 11:50:58 +00:00
|
|
|
.image-viewer {
|
|
|
|
position: absolute;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
}
|
2019-01-03 21:11:23 +00:00
|
|
|
|
|
|
|
@media (max-width: $bp__layout) {
|
|
|
|
.gallery-page {
|
|
|
|
padding-top: $site-menu__header-height;
|
|
|
|
}
|
|
|
|
|
2019-01-04 13:55:30 +00:00
|
|
|
.gallery {
|
2019-01-03 21:11:23 +00:00
|
|
|
position: relative;
|
|
|
|
height: 100%;
|
2019-01-04 09:24:38 +00:00
|
|
|
width: 100%;
|
2019-01-03 21:11:23 +00:00
|
|
|
overflow-x: hidden;
|
|
|
|
overflow-y: auto;
|
|
|
|
}
|
|
|
|
|
2019-01-04 13:55:30 +00:00
|
|
|
.gallery__thumbs {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
}
|
|
|
|
|
2019-01-04 16:18:45 +00:00
|
|
|
.gallery__featured {
|
|
|
|
width: 100vw;
|
|
|
|
}
|
|
|
|
|
2019-01-04 11:50:58 +00:00
|
|
|
.close-viewer {
|
|
|
|
font-size: 10em;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
}
|
2019-01-03 21:11:23 +00:00
|
|
|
|
|
|
|
@media (min-width: $bp__layout) {
|
2019-01-04 13:10:41 +00:00
|
|
|
.mobile-only {
|
|
|
|
display: none;
|
|
|
|
}
|
2019-01-04 09:24:38 +00:00
|
|
|
|
2019-01-03 21:11:23 +00:00
|
|
|
.gallery-page {
|
|
|
|
padding-left: $site-menu__header-width;
|
|
|
|
}
|
|
|
|
|
2019-01-04 13:55:30 +00:00
|
|
|
.gallery {
|
2019-01-04 09:56:46 +00:00
|
|
|
display: flex;
|
2019-01-04 11:50:58 +00:00
|
|
|
flex-direction: row;
|
2019-01-04 09:56:46 +00:00
|
|
|
justify-content: space-between;
|
2019-01-04 09:24:38 +00:00
|
|
|
position: relative;
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
2019-01-04 13:55:30 +00:00
|
|
|
.gallery__featured {
|
|
|
|
order: 2;
|
|
|
|
flex: 0 0 20rem;
|
|
|
|
overflow-y: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.gallery__thumbs {
|
|
|
|
order: 1;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: space-between;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
2019-01-04 15:23:13 +00:00
|
|
|
.gallery__nav {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2019-01-04 11:50:58 +00:00
|
|
|
.close-viewer {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2019-01-03 21:11:23 +00:00
|
|
|
}
|
2019-01-04 11:50:58 +00:00
|
|
|
|
2019-01-03 21:11:23 +00:00
|
|
|
</style>
|