marc-leopold/components/GalleryPage.vue

212 lines
3.5 KiB
Vue
Raw Normal View History

2019-01-03 21:11:23 +00:00
<template>
<div class="gallery-page">
<div class="image-viewer"
:class="{ 'is-visible': imageViewerIsVisible }">
<div class="close-viewer"
@click="toggleImageViewer">
X
</div>
</div>
2019-01-04 09:24:38 +00:00
<div class="gallery-container">
<ul class="featured-images">
<li v-for="(gallery, index) in galleries"
class="featured-image"
:key="index">
<span>{{ gallery.title }}</span>
</li>
</ul>
<div class="gallery-thumbs">
<div class="gallery-thumbs__spacer"></div>
<ul class="gallery-thumbs__list">
2019-01-04 09:56:46 +00:00
<li v-for="(gallery, index) in galleries"
:key="index">
<ul class="gallery-thumbs__row">
<li class="featured-image featured-image--mobile-only"></li>
<li v-for="image in gallery.images"
class="thumb-container"
:key="image.url">
<span>{{ image.thumbUrl }}</span>
</li>
</ul>
2019-01-04 09:56:46 +00:00
</li>
</ul>
</div>
2019-01-03 21:11:23 +00:00
</div>
</div>
</template>
<script>
export default {
props: {
galleries: {
type: Array,
required: true
}
},
data () {
return {
imageViewerIsVisible: false
2019-01-03 21:11:23 +00:00
}
},
methods: {
toggleImageViewer () {
this.imageViewerIsVisible = !this.imageViewerIsVisible;
}
2019-01-03 21:11:23 +00:00
}
}
</script>
<style lang="scss" scoped>
.gallery-page {
position: relative;
height: 100%;
width: 100%;
}
.gallery-thumbs__row {
display: flex;
flex-direction: row;
list-style: none;
padding: 0;
margin: 0;
}
.image-viewer {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
background: linear-gradient(
to bottom left,
magenta,
cyan
);
}
2019-01-03 21:11:23 +00:00
@media (max-width: $bp__layout) {
.gallery-page {
padding-top: $site-menu__header-height;
}
2019-01-04 09:24:38 +00:00
.gallery-container {
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;
}
.close-viewer {
font-size: 10em;
cursor: pointer;
}
2019-01-03 21:11:23 +00:00
.featured-images {
width: 100vw;
}
.gallery-thumbs {
position: absolute;
top: 0;
left: 0;
}
.gallery-thumbs__spacer {
display:none;
}
2019-01-03 21:11:23 +00:00
.gallery-thumbs__row {
}
2019-01-04 09:24:38 +00:00
.featured-image {
2019-01-03 21:11:23 +00:00
height: 50vh;
width: 100vw;
flex: 0 0 100vw;
}
.thumb-container {
2019-01-03 21:11:23 +00:00
height: 50vh;
}
2019-01-04 09:24:38 +00:00
.image-viewer {
z-index: 50;
2019-01-03 21:11:23 +00:00
transition: opacity 1s; //TEMP
opacity: 0;
pointer-events: none;
2019-01-03 21:11:23 +00:00
&.is-visible {
opacity: 1;
pointer-events: auto;
}
}
}
2019-01-03 21:11:23 +00:00
@media (min-width: $bp__layout) {
2019-01-04 09:24:38 +00:00
$thumbs-height: 8rem;
$featured-width: 20rem;
$featured-height: 16rem;
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 09:24:38 +00:00
.gallery-container {
2019-01-04 09:56:46 +00:00
display: flex;
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;
}
.close-viewer {
display: none;
}
2019-01-04 09:24:38 +00:00
.featured-images {
order: 2;
flex: 0 0 $featured-width;
2019-01-04 09:56:46 +00:00
overflow-y: auto;
}
.featured-image {
width: 100%;
height: $featured-height;;
2019-01-04 09:56:46 +00:00
&--mobile-only {
display: none;
2019-01-04 09:56:46 +00:00
}
}
.thumb-container {
height: $thumbs-height;
2019-01-04 09:24:38 +00:00
}
.gallery-thumbs {
order: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
2019-01-04 09:24:38 +00:00
overflow: hidden;
}
2019-01-03 21:11:23 +00:00
.gallery-thumbs__list {
height: $thumbs-height;
2019-01-04 09:24:38 +00:00
overflow: hidden;
// overflow: auto; // TEMP
}
.gallery-thumbs__row {
flex: 0 0 $thumbs-height;
2019-01-04 09:24:38 +00:00
}
2019-01-03 21:11:23 +00:00
}
2019-01-03 21:11:23 +00:00
</style>