traxxx/assets/components/releases/release.vue

551 lines
10 KiB
Vue
Raw Normal View History

<template>
<div
v-if="release"
class="content"
>
<Expand
v-if="expanded"
class="expand"
:expanded="expanded"
@expand="(state) => expanded = state"
/>
2020-06-30 22:25:27 +00:00
<Scroll
class="scroll-light"
:expandable="false"
>
<Media
:release="release"
:class="{ expanded }"
/>
2020-06-30 22:25:27 +00:00
</Scroll>
<div class="details">
<div class="column">
2020-06-30 22:25:27 +00:00
<div class="tidbits">
<a
v-if="release.date"
:title="release.url && `View scene on ${release.entity.name}`"
:href="release.url"
:class="{ link: release.url }"
target="_blank"
rel="noopener noreferrer"
class="tidbit date"
>
<span class="showable">{{ formatDate(release.date, 'MMM D, YYYY', release.datePrecision) }}</span>
<span class="hideable">{{ formatDate(release.date, 'MMMM D, YYYY', release.datePrecision) }}</span>
<Icon
v-if="release.url"
icon="share2"
/>
2020-06-30 22:25:27 +00:00
</a>
</div>
2020-06-29 23:07:48 +00:00
<div class="site">
<template v-if="release.entity.parent && !release.entity.independent">
<a
v-if="release.entity.parent.hasLogo"
:href="`/network/${release.entity.parent.slug}`"
class="logo-link"
>
2020-06-30 22:25:27 +00:00
<img
:src="`/img/logos/${release.entity.parent.slug}/thumbs/network.png`"
:title="release.entity.parent.name"
:alt="release.entity.parent.name"
class="logo logo-parent"
2020-06-30 22:25:27 +00:00
>
</a>
<a
v-else
:href="`/network/${release.entity.parent.slug}`"
class="logo-link logo-name"
>{{ release.entity.parent.name }}</a>
2020-06-30 22:25:27 +00:00
<span class="chain">presents</span>
2020-06-29 23:07:48 +00:00
<a
v-if="release.entity.hasLogo"
2020-06-29 23:07:48 +00:00
:href="`/${release.entity.type}/${release.entity.slug}`"
class="logo-link"
2020-06-29 23:07:48 +00:00
>
<img
2020-06-30 22:25:27 +00:00
v-if="release.entity.type === 'network'"
:src="`/img/logos/${release.entity.slug}/thumbs/network.png`"
2020-06-29 23:07:48 +00:00
:title="release.entity.name"
class="logo logo-site"
>
<img
2020-06-30 22:25:27 +00:00
v-else
:src="`/img/logos/${release.entity.parent.slug}/thumbs/${release.entity.slug}.png`"
:title="release.entity.name"
class="logo logo-site"
>
</a>
<a
v-else
:href="`/${release.entity.type}/${release.entity.slug}`"
class="logo-link logo-name"
>{{ release.entity.name }}</a>
</template>
<a
v-else
:href="`/${release.entity.type}/${release.entity.slug}`"
>
<img
:src="`/img/logos/${release.entity.slug}/thumbs/network.png`"
:title="release.entity.name"
class="logo logo-site"
>
</a>
2020-06-29 23:07:48 +00:00
</div>
</div>
</div>
<Expand
v-if="release.photos.length > 0"
class="expand-bottom"
:expanded="expanded"
@expand="(state) => expanded = state"
/>
<div class="info column">
2020-07-01 03:04:02 +00:00
<div class="row">
<h2
v-if="release.title"
class="title"
>{{ release.title }}</h2>
<h2
v-else-if="release.actors.length > 0"
class="title title-composed"
>
{{ release.actors.map(actor => actor.name).join(', ') }} for {{ release.entity.name }}
<Icon
v-tooltip="`This scene has no known official title`"
icon="question2"
/>
</h2>
2020-07-01 03:04:02 +00:00
</div>
2020-06-29 23:07:48 +00:00
<div
v-if="release.tags.length > 0"
class="row"
>
<ul class="tags nolist">
<li
v-for="tag in release.tags"
:key="`tag-${tag.slug}`"
class="tag"
>
<a
:href="`/tag/${tag.slug}`"
class="link"
>{{ tag.name }}</a>
</li>
</ul>
</div>
<div class="row associations">
<ul
v-lazy-container="{ selector: '.lazy' }"
class="actors nolist"
>
<li
v-for="actor in release.actors"
:key="actor.id"
>
<Actor :actor="actor" />
</li>
</ul>
<div
v-if="release.movies && release.movies.length > 0"
class="movies"
>
<Release :release="release.movies[0]" />
</div>
</div>
<div
v-if="release.scenes && release.scenes.length > 0"
class="scenes"
>
<h3>Scenes</h3>
<Releases
:releases="release.scenes"
class="row"
/>
</div>
<div
v-if="release.description"
class="row"
>
<span class="row-label">Description</span>
<p class="description">{{ release.description }}</p>
</div>
<div class="row row-tidbits">
<div
v-if="release.duration"
class="row-tidbit"
>
<span class="row-label">Duration</span>
<div class="duration">
<span
v-if="release.duration >= 3600"
class="duration-segment"
>{{ Math.floor(release.duration / 3600).toString().padStart(2, '0') }}:</span>
<span class="duration-segment">{{ Math.floor((release.duration % 3600) / 60).toString().padStart(2, '0') }}:</span>
<span class="duration-segment">{{ (release.duration % 60).toString().padStart(2, '0') }}</span>
</div>
</div>
<div
v-if="release.shootId"
class="row-tidbit"
>
<span class="row-label">Shoot #</span>
{{ release.shootId }}
</div>
<div
v-if="release.studio"
class="row-tidbit"
>
<span class="row-label">Studio</span>
<router-link
:to="`/studio/${release.studio.slug}`"
class="link studio"
>{{ release.studio.name }}</router-link>
</div>
<div
v-if="release.productionDate"
class="row-tidbit"
>
<span class="row-label">Production date</span>
{{ formatDate(release.productionDate, 'MMMM D, YYYY') }}
</div>
</div>
<div
v-if="release.comment"
class="row"
>
<span class="row-label">Comment</span>
<span>{{ release.comment }}</span>
</div>
<div class="row">
<span class="row-label">Added</span>
2020-07-01 03:04:02 +00:00
<router-link
:to="`/added/${formatDate(release.createdAt, 'YYYY/MM/DD')}`"
:title="`Added on ${formatDate(release.createdAt, 'MMMM D, YYYY HH:mm')}`"
class="link added"
2020-07-01 03:04:02 +00:00
>{{ formatDate(release.createdAt, 'MMMM D, YYYY HH:mm') }}</router-link>
</div>
</div>
</div>
</template>
<script>
2020-06-29 23:07:48 +00:00
import Media from './media.vue';
import Actor from '../actors/tile.vue';
2020-06-30 22:25:27 +00:00
import Release from './tile.vue';
import Releases from './releases.vue';
import Scroll from '../scroll/scroll.vue';
import Expand from '../expand/expand.vue';
function pageTitle() {
return this.release
&& (this.release.title
|| (this.release.actors.length > 0 ? `${this.release.actors.map(actor => actor.name).join(', ')} for ${this.release.entity.name}` : null));
}
async function mounted() {
this.release = await this.$store.dispatch('fetchReleaseById', this.$route.params.releaseId);
}
export default {
components: {
Actor,
2020-06-29 23:07:48 +00:00
Media,
Release,
Releases,
Scroll,
Expand,
},
data() {
return {
release: null,
expanded: false,
};
},
computed: {
pageTitle,
},
mounted,
};
</script>
<style lang="scss" scoped>
@import 'theme';
.column {
width: 1200px;
max-width: 100%;
padding: 0 1rem;
margin: 0 auto;
box-sizing: border-box;
}
2020-01-09 01:09:17 +00:00
.details {
background: var(--profile);
color: var(--text-light);
box-shadow: 0 0 3px var(--shadow-weak);
cursor: default;
.column {
2020-06-30 22:25:27 +00:00
height: 100%;
display: flex;
2020-06-29 23:07:48 +00:00
justify-content: space-between;
align-items: center;
padding: 0 1rem;
}
.link {
color: var(--text-light);
.icon {
fill: var(--lighten);
}
&:hover {
color: var(--text-light);
.icon {
fill: var(--text-light);
}
}
}
}
2020-06-29 23:07:48 +00:00
.tidbits {
flex-shrink: 0;
2020-06-30 22:25:27 +00:00
height: 100%;
2020-06-29 23:07:48 +00:00
}
.tidbit {
2020-06-29 23:07:48 +00:00
display: inline-flex;
align-items: center;
height: 100%;
2020-06-29 23:07:48 +00:00
&.date {
flex-shrink: 0;
2020-06-30 22:25:27 +00:00
padding: 0 2rem 0 0;
2020-06-29 23:07:48 +00:00
font-weight: bold;
2020-06-30 22:25:27 +00:00
.icon {
fill: var(--lighten);
margin: -.2rem 0 0 .75rem;
2020-06-30 22:25:27 +00:00
}
}
}
.site {
display: inline-flex;
align-items: center;
padding: .25rem 0;
font-size: 0;
}
.logo {
display: inline-block;
}
.logo-link {
text-decoration: none;
}
.logo-site {
2020-06-30 22:25:27 +00:00
height: 2.5rem;
max-width: 15rem;
margin: .25rem 0;
object-fit: contain;
object-position: 100% 50%;
}
.logo-parent {
height: 1.5rem;
max-width: 10rem;
object-fit: contain;
object-position: 100% 50%;
}
.logo-name {
padding: .5rem 0;
color: var(--text-light);
font-size: 1.25rem;
font-weight: bold;
}
.chain {
color: var(--lighten);
padding: 0 .5rem;
font-weight: bold;
font-size: .8rem;
}
.expand-bottom {
border-bottom: solid 1px var(--shadow-hint);
}
2020-06-29 23:07:48 +00:00
.info {
padding: 1rem;
border-left: solid 1px var(--shadow-hint);
border-right: solid 1px var(--shadow-hint);
flex-grow: 1;
}
.row {
margin: 0 0 1.5rem 0;
2020-06-29 23:07:48 +00:00
&.associations {
align-items: start;
}
}
.row-label {
display: block;
margin: 0 0 .5rem 0;
color: var(--shadow);
font-weight: bold;
.icon {
margin: 0 .5rem 0 0;
fill: var(--shadow);
}
}
.row-tidbit {
display: inline-block;
margin: 0 2rem 0 0;
}
.title {
display: inline-block;
2020-06-29 23:07:48 +00:00
margin: 0;
.icon {
fill: var(--shadow);
padding: .25rem;
&:hover {
fill: var(--primary);
cursor: pointer;
}
}
}
.title-composed {
color: var(--shadow);
2020-06-29 23:07:48 +00:00
}
.title-shoot {
margin: 0 0 0 .5rem;
color: var(--shadow);
font-size: .9rem;
font-weight: bold;
}
.description {
line-height: 1.5;
margin: -.25rem 0 0 0;
}
.duration {
font-size: 0;
}
.duration-segment {
font-size: 1rem;
}
.actors {
2020-04-27 00:37:30 +00:00
display: grid;
grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
2020-06-29 23:07:48 +00:00
grid-gap: .5rem;
2020-03-09 04:06:37 +00:00
flex-grow: 1;
flex-wrap: wrap;
}
.link {
2020-06-30 22:25:27 +00:00
display: inline-flex;
color: var(--link);
text-decoration: none;
&:hover {
color: var(--primary);
.icon {
fill: var(--primary);
}
}
}
.tag .link {
background: var(--background);
display: inline-block;
padding: .5rem;
margin: 0 .25rem .25rem 0;
box-shadow: 0 0 2px var(--shadow-weak);
text-decoration: none;
text-transform: capitalize;
&:hover {
color: var(--primary);
}
}
.showable {
display: none;
}
@media(max-width: $breakpoint3) {
.logo-parent,
.chain {
display: none;
}
.logo-site {
width: 100%;
}
}
@media(max-width: $breakpoint) {
.hideable {
display: none;
}
.row .showable {
display: block;
}
.tidbit .showable {
display: inline-block;
}
2020-04-27 00:37:30 +00:00
.actors {
grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
}
}
</style>