traxxx/assets/components/tile/release.vue

367 lines
8.7 KiB
Vue
Raw Normal View History

<template>
<div
:id="`${release.type}-${release.id}`"
:class="{ [release.type]: true }"
class="tile"
>
<span class="poster">
<span class="details">
<router-link
2020-02-26 00:15:50 +00:00
v-if="release.site && release.site.independent"
:to="`/network/${release.network.slug}`"
class="site site-link"
><img
:src="`/img/logos/${release.network.slug}/favicon.png`"
class="favicon"
>{{ release.network.name }}</router-link>
<span
2020-02-26 00:15:50 +00:00
v-else-if="release.network"
class="site"
>
<router-link
v-tooltip.bottom="`Part of ${release.network.name}`"
:title="`Part of ${release.network.name}`"
:to="`/network/${release.network.slug}`"
class="site-link"
><img
:src="`/img/logos/${release.network.slug}/favicon.png`"
class="favicon"
></router-link>
<router-link
v-tooltip.bottom="`More from ${release.site.name}`"
:title="`More from ${release.site.name}`"
:to="`/site/${release.site.slug}`"
class="site-link"
>{{ release.site.name }}</router-link>
</span>
2020-02-26 00:15:50 +00:00
<span v-else />
<a
v-if="release.date"
v-tooltip.bottom="release.url && `View scene on ${release.site.name}`"
:title="release.url && `View scene on ${release.site.name}`"
:href="release.url"
2020-03-23 00:43:49 +00:00
:class="{ upcoming: isUpcoming, new: release.isNew }"
target="_blank"
rel="noopener noreferrer"
class="date"
>{{ formatDate(release.date, 'MMM D, YYYY') }}</a>
<a
v-else
:href="release.url"
:class="{ upcoming: isAfter(release.date, new Date()), new: release.isNew }"
title="Scene date N/A, showing date added"
target="_blank"
rel="noopener noreferrer"
class="date"
>{{ `(${formatDate(release.dateAdded, 'MMM D, YYYY')})` }}</a>
</span>
<a
:href="`/${release.type || 'scene'}/${release.id}/${release.slug}`"
target="_blank"
rel="noopener noreferrer"
class="link"
>
<img
v-if="release.poster"
:src="sfw ? `/img/${release.poster.sfw.thumbnail}` : `/media/${release.poster.thumbnail}`"
:alt="release.title"
class="thumbnail"
>
<span
v-else-if="release.covers && release.covers.length > 0"
class="covers"
>
<img
v-for="cover in release.covers"
:key="cover.id"
:src="`/${release.batch === 'dummy' ? 'img' : 'media'}/${cover.thumbnail}`"
:alt="release.title"
class="thumbnail cover"
>
</span>
<div
v-else
:title="release.title"
class="thumbnail"
>No thumbnail available</div>
</a>
</span>
<div class="info">
<a
:href="`/${release.type || 'scene'}/${release.id}/${release.slug}`"
target="_blank"
rel="noopener noreferrer"
class="row link"
>
<h3
v-tooltip.top="release.title"
:title="release.title"
class="title"
>
<Icon
v-if="release.type === 'movie'"
icon="film"
/>{{ release.title }}
</h3>
</a>
<span class="row">
<ul class="actors nolist">
<li
v-for="actor in release.actors"
:key="actor.id"
class="actor"
>
<a
:href="`/actor/${actor.slug}`"
class="actor-link"
>{{ actor.name }}</a>
</li>
</ul>
</span>
2019-11-14 00:18:19 +00:00
<ul
:title="release.tags.map(tag => tag.name).join(', ')"
2019-11-14 00:18:19 +00:00
class="tags nolist"
>
2019-11-14 00:18:19 +00:00
<li
v-for="tag in release.tags"
:key="`tag-${tag.slug}`"
2019-11-14 00:18:19 +00:00
class="tag"
>
<router-link
:to="`/tag/${tag.slug}`"
2019-11-14 00:18:19 +00:00
class="tag-link"
>{{ tag.name }}</router-link>
2019-11-14 00:18:19 +00:00
</li>
</ul>
</div>
</div>
</template>
<script>
function sfw() {
return this.$store.state.ui.sfw;
}
export default {
props: {
release: {
type: Object,
default: null,
},
referer: {
type: String,
default: null,
},
2020-03-23 00:43:49 +00:00
index: {
type: Number,
default: null,
},
},
data() {
return {
isUpcoming: this.isAfter(this.release.date, new Date()),
};
},
computed: {
sfw,
},
};
</script>
<style lang="scss" scoped>
@import 'theme';
.tile {
2020-03-23 00:43:49 +00:00
background: var(--background);
display: flex;
flex-direction: column;
box-sizing: border-box;
padding: 0 0 .5rem 0;
overflow: hidden;
box-shadow: 0 0 3px var(--shadow-weak);
height: 100%;
}
.poster {
position: relative;
margin: 0 0 .5rem 0;
}
.covers {
2020-03-23 00:43:49 +00:00
background: var(--profile);
display: flex;
.cover {
width: 50%;
}
}
.thumbnail {
width: 100%;
height: 14rem;
display: flex;
justify-content: center;
align-items: center;
object-fit: cover;
background-position: center;
background-size: cover;
background-color: var(--darken-hint);
2020-03-23 00:43:49 +00:00
color: var(--shadow);
}
.row {
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: 0 .5rem;
margin: 0 0 .25rem 0;
}
.details {
width: 100%;
display: flex;
justify-content: space-between;
position: absolute;
font-size: 0;
.favicon {
height: 1rem;
margin: 0 .25rem 0 0;
}
}
.site,
.date {
2020-03-23 00:43:49 +00:00
color: var(--text-light);
display: flex;
align-items: center;
2020-03-23 00:43:49 +00:00
background: var(--darken);
position: relative;
font-size: .8rem;
padding: .25rem;
text-decoration: none;
}
.date {
&.upcoming:before {
content: '';
2020-03-23 00:43:49 +00:00
background: var(--primary);
width: .5rem;
display: inline-block;
position: absolute;
top: 0;
bottom: 0;
left: -.5rem;
}
&.new {
font-weight: bold;
}
}
.site {
font-weight: bold;
}
.site-link {
display: flex;
2020-03-23 00:43:49 +00:00
color: var(--text-light);
text-decoration: none;
}
.info {
2019-11-14 00:18:19 +00:00
display: flex;
flex-direction: column;
flex-grow: 1;
}
.link {
text-decoration: none;
}
.title {
margin: 0 .25rem .25rem 0;
2020-03-23 00:43:49 +00:00
color: var(--text);
2020-01-23 13:53:42 +00:00
max-height: 2.75rem;
font-size: 1rem;
2020-01-23 13:53:42 +00:00
line-height: 1.5;
text-overflow: ellipsis;
overflow: hidden;
.icon {
margin: 0 .25rem 0 0;
}
}
.network {
color: #555;
margin: 0 .25rem 0 0;
font-size: .8rem;
}
.actors {
word-wrap: break-word;
overflow: hidden;
max-height: 2.75rem;
line-height: 1.5rem;
}
.tags {
2020-01-02 23:59:02 +00:00
max-height: .5rem;
2019-11-14 00:18:19 +00:00
padding: .25rem .5rem 1rem .5rem;
word-wrap: break-word;
overflow-y: hidden;
}
.actor {
2019-11-14 00:18:19 +00:00
margin: 0 .25rem 0 0;
}
.tag {
margin: 0 .25rem .25rem 0;
}
2019-11-14 00:18:19 +00:00
.actor:not(:last-of-type)::after {
content: ",";
}
2019-11-14 00:18:19 +00:00
.actor-link {
text-decoration: none;
&:hover {
2020-03-23 00:43:49 +00:00
color: var(--primary);
}
}
.actor-link {
2020-03-23 00:43:49 +00:00
color: var(--link);
}
.tag-link {
2020-03-23 00:43:49 +00:00
color: var(--shadow);
display: inline-block;
2019-11-14 00:18:19 +00:00
padding: .25rem;
font-size: .75rem;
font-weight: bold;
text-decoration: none;
line-height: 1;
2020-03-23 00:43:49 +00:00
border: solid 1px var(--shadow-hint);
2019-11-14 00:18:19 +00:00
&:hover {
2020-03-23 00:43:49 +00:00
color: var(--primary);
2019-11-14 00:18:19 +00:00
}
}
</style>