2021-01-23 00:18:20 +00:00
|
|
|
<template>
|
|
|
|
<teleport to="body">
|
|
|
|
<div class="album">
|
|
|
|
<div class="album-header">
|
|
|
|
<h3 class="album-title">{{ title }}</h3>
|
|
|
|
|
|
|
|
<Icon
|
|
|
|
icon="cross2"
|
|
|
|
class="close"
|
|
|
|
@click.native="$emit('close')"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
2021-02-03 18:21:47 +00:00
|
|
|
<div
|
|
|
|
class="album-items"
|
|
|
|
:class="{ portrait }"
|
|
|
|
>
|
2021-01-23 00:18:20 +00:00
|
|
|
<div
|
2021-02-05 00:41:53 +00:00
|
|
|
v-for="item in albumItems"
|
2021-01-23 00:18:20 +00:00
|
|
|
:key="item.id"
|
|
|
|
class="item-container"
|
|
|
|
>
|
|
|
|
<a
|
2021-02-22 01:33:39 +00:00
|
|
|
:href="getPath(item, null, { local })"
|
2021-01-23 00:18:20 +00:00
|
|
|
class="item-link"
|
|
|
|
target="_blank"
|
|
|
|
>
|
|
|
|
<img
|
2021-02-22 01:33:39 +00:00
|
|
|
:src="getPath(item, 'thumbnail', { local })"
|
2021-03-16 02:55:20 +00:00
|
|
|
:style="{ 'background-image': `url('${getPath(item, 'lazy', { local })}')` }"
|
|
|
|
:width="item.width"
|
|
|
|
:height="item.height"
|
2021-02-05 00:41:53 +00:00
|
|
|
:title="item.title"
|
2021-01-23 00:18:20 +00:00
|
|
|
loading="lazy"
|
|
|
|
class="item image"
|
|
|
|
>
|
2021-02-03 18:21:47 +00:00
|
|
|
|
2021-03-07 03:05:25 +00:00
|
|
|
<Logo :photo="item" />
|
|
|
|
|
2021-03-07 19:14:02 +00:00
|
|
|
<router-link
|
2021-03-07 18:47:06 +00:00
|
|
|
v-if="comments && item.title && item.entity"
|
|
|
|
:to="`/${item.entity.type}/${item.entity.slug}`"
|
2021-03-07 19:14:02 +00:00
|
|
|
class="item-comment"
|
|
|
|
>{{ item.title }} for {{ item.entity.name }}</router-link>
|
2021-03-07 18:47:06 +00:00
|
|
|
|
|
|
|
<span
|
|
|
|
v-else-if="comments && item.title"
|
2021-02-03 18:21:47 +00:00
|
|
|
class="item-comment"
|
2021-02-05 00:41:53 +00:00
|
|
|
>{{ item.title }}</span>
|
2021-01-23 00:18:20 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</teleport>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-03-07 03:05:25 +00:00
|
|
|
import Logo from './logo.vue';
|
|
|
|
|
2021-02-05 00:41:53 +00:00
|
|
|
function albumItems() {
|
2021-02-10 02:29:41 +00:00
|
|
|
return this.items
|
|
|
|
.filter(Boolean)
|
|
|
|
.map(item => ({
|
|
|
|
...item,
|
|
|
|
title: item.comment || (item.credit && `© ${item.credit}`) || (item.entity && `© ${item.entity.name}`),
|
|
|
|
}));
|
2021-02-05 00:41:53 +00:00
|
|
|
}
|
|
|
|
|
2021-01-23 00:18:20 +00:00
|
|
|
export default {
|
2021-03-07 03:05:25 +00:00
|
|
|
components: {
|
|
|
|
Logo,
|
|
|
|
},
|
2021-01-23 00:18:20 +00:00
|
|
|
props: {
|
|
|
|
items: {
|
|
|
|
type: Array,
|
|
|
|
default: () => [],
|
|
|
|
},
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
default: null,
|
|
|
|
},
|
2021-02-22 01:33:39 +00:00
|
|
|
local: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
2021-02-03 18:21:47 +00:00
|
|
|
},
|
|
|
|
portrait: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
comments: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true,
|
|
|
|
},
|
2021-01-23 00:18:20 +00:00
|
|
|
},
|
2021-02-05 00:41:53 +00:00
|
|
|
computed: {
|
|
|
|
albumItems,
|
|
|
|
},
|
2021-01-23 00:18:20 +00:00
|
|
|
emits: ['close'],
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import 'breakpoints';
|
|
|
|
|
|
|
|
.album {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
position: fixed;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
2021-02-05 01:35:00 +00:00
|
|
|
background: var(--darken-extreme);
|
2021-01-23 00:18:20 +00:00
|
|
|
z-index: 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
.album-header {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.album-title {
|
2021-01-23 22:50:15 +00:00
|
|
|
display: block;
|
2021-01-23 00:18:20 +00:00
|
|
|
flex-grow: 1;
|
|
|
|
align-items: center;
|
2021-01-23 22:50:15 +00:00
|
|
|
padding: 1rem;
|
2021-01-23 00:18:20 +00:00
|
|
|
margin: 0;
|
|
|
|
color: var(--text-light);
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
2021-01-23 22:50:15 +00:00
|
|
|
text-align: center;
|
2021-02-03 18:21:47 +00:00
|
|
|
text-transform: capitalize;
|
2021-01-23 00:18:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.close {
|
2021-01-23 22:03:21 +00:00
|
|
|
width: 1.5rem;
|
|
|
|
height: 1.5rem;
|
2021-01-23 00:18:20 +00:00
|
|
|
padding: 1rem;
|
|
|
|
fill: var(--lighten);
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
cursor: pointer;
|
|
|
|
fill: var(--text-light);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-23 22:03:21 +00:00
|
|
|
.album-items {
|
2021-01-23 00:18:20 +00:00
|
|
|
display: grid;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2021-01-29 14:36:54 +00:00
|
|
|
grid-template-columns: repeat(auto-fit, minmax(25rem, 1fr));
|
2021-01-23 22:03:21 +00:00
|
|
|
grid-gap: 0 1rem;
|
2021-01-23 00:18:20 +00:00
|
|
|
padding: 1rem;
|
2021-01-23 22:09:05 +00:00
|
|
|
margin: auto 0;
|
2021-01-23 22:03:21 +00:00
|
|
|
overflow-y: auto;
|
2021-02-03 18:21:47 +00:00
|
|
|
|
|
|
|
&.portrait {
|
|
|
|
grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
|
|
|
|
}
|
2021-01-23 00:18:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.item-container {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
|
2021-01-23 22:03:21 +00:00
|
|
|
.item-link {
|
2021-02-03 18:21:47 +00:00
|
|
|
position: relative;
|
2021-02-05 01:00:18 +00:00
|
|
|
margin: 0 0 .5rem 0;
|
2021-02-03 18:21:47 +00:00
|
|
|
overflow: hidden;
|
|
|
|
|
2021-03-07 03:05:25 +00:00
|
|
|
&:hover {
|
|
|
|
.item-comment {
|
|
|
|
transform: translateY(0);
|
|
|
|
}
|
|
|
|
|
2021-03-07 19:14:02 +00:00
|
|
|
::v-deep(.album-logo) {
|
2021-03-07 03:05:25 +00:00
|
|
|
opacity: 0;
|
|
|
|
}
|
2021-02-03 18:21:47 +00:00
|
|
|
}
|
2021-01-23 22:03:21 +00:00
|
|
|
}
|
|
|
|
|
2021-01-23 00:18:20 +00:00
|
|
|
.item {
|
2021-02-04 22:09:52 +00:00
|
|
|
max-width: 100%;
|
|
|
|
max-height: 100%;
|
2021-03-16 02:55:20 +00:00
|
|
|
height: auto;
|
|
|
|
background-size: cover;
|
|
|
|
background-position: center;
|
2021-01-23 00:18:20 +00:00
|
|
|
}
|
|
|
|
|
2021-02-03 18:21:47 +00:00
|
|
|
.item-comment {
|
|
|
|
width: 100%;
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: .5rem;
|
|
|
|
color: var(--text-light);
|
2021-03-02 01:30:44 +00:00
|
|
|
background: var(--darken);
|
2021-02-03 18:21:47 +00:00
|
|
|
font-size: .9rem;
|
2021-03-02 01:30:44 +00:00
|
|
|
text-shadow: 0 0 3px var(--darken);
|
2021-03-07 19:14:02 +00:00
|
|
|
text-decoration: none;
|
2021-02-03 18:21:47 +00:00
|
|
|
white-space: normal;
|
|
|
|
line-height: 1.25;
|
|
|
|
transform: translateY(100%);
|
|
|
|
transition: transform .25s ease;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media(max-width: $breakpoint-giga) {
|
2021-02-05 01:00:18 +00:00
|
|
|
.album-items {
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(22.5rem, 1fr));
|
|
|
|
|
|
|
|
.portrait {
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
|
|
|
|
}
|
2021-02-03 18:21:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@media(max-width: $breakpoint-mega) {
|
|
|
|
.album-items.portrait {
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-29 14:36:54 +00:00
|
|
|
@media(max-width: $breakpoint-kilo) {
|
|
|
|
.album-items {
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
|
2021-02-05 01:00:18 +00:00
|
|
|
grid-gap: 0 .5rem;
|
|
|
|
padding: .5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.item-link {
|
|
|
|
margin: 0 0 .25rem 0;
|
2021-01-29 14:36:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-24 16:31:32 +00:00
|
|
|
@media(max-width: $breakpoint) {
|
|
|
|
.album-items {
|
2021-02-05 01:00:18 +00:00
|
|
|
grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
|
2021-01-24 16:31:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-24 16:16:55 +00:00
|
|
|
@media(max-width: $breakpoint-micro) {
|
|
|
|
.album-items {
|
2021-02-05 01:00:18 +00:00
|
|
|
grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
|
2021-01-24 16:16:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-23 22:56:24 +00:00
|
|
|
@media(max-width: $breakpoint-pico) {
|
2021-01-23 22:03:21 +00:00
|
|
|
.album-items {
|
2021-01-23 22:56:24 +00:00
|
|
|
grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
|
2021-01-23 22:03:21 +00:00
|
|
|
}
|
|
|
|
}
|
2021-01-23 00:18:20 +00:00
|
|
|
</style>
|