2020-08-20 17:52:02 +00:00
|
|
|
<template>
|
|
|
|
<ul class="clips nolist">
|
|
|
|
<li
|
|
|
|
v-for="clip in clips"
|
|
|
|
:key="`clip-${clip.id}`"
|
|
|
|
class="clip"
|
|
|
|
>
|
2020-08-20 18:48:52 +00:00
|
|
|
<div class="clip-poster-container">
|
|
|
|
<a
|
|
|
|
v-if="clip.poster"
|
|
|
|
:href="`/media/${clip.poster.path}`"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
2020-08-20 17:52:02 +00:00
|
|
|
>
|
2020-08-20 18:48:52 +00:00
|
|
|
<img
|
|
|
|
:src="`/media/${clip.poster.thumbnail}`"
|
|
|
|
class="clip-poster"
|
|
|
|
>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<span
|
|
|
|
v-if="clip.duration"
|
|
|
|
class="clip-duration"
|
|
|
|
>{{ formatDuration(clip.duration) }}</span>
|
|
|
|
</div>
|
2020-08-20 17:52:02 +00:00
|
|
|
|
|
|
|
<div class="clip-info">
|
2020-08-20 18:48:52 +00:00
|
|
|
<h3
|
|
|
|
v-if="clip.title"
|
|
|
|
class="clip-row clip-title"
|
|
|
|
:title="clip.title"
|
|
|
|
>{{ clip.title }}</h3>
|
|
|
|
|
|
|
|
<p class="clip-row clip-description">{{ clip.description }}</p>
|
|
|
|
|
|
|
|
<Tags
|
|
|
|
:tags="clip.tags"
|
|
|
|
class="clip-row clip-tags"
|
|
|
|
/>
|
2020-08-20 17:52:02 +00:00
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Tags from './tags.vue';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Tags,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
clips: {
|
|
|
|
type: Array,
|
|
|
|
default: () => [],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2020-08-20 18:48:52 +00:00
|
|
|
@import 'breakpoints';
|
|
|
|
|
|
|
|
.clips {
|
2020-08-20 17:52:02 +00:00
|
|
|
display: grid;
|
2020-08-20 18:48:52 +00:00
|
|
|
grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
|
|
|
|
grid-gap: 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.clip {
|
2020-08-20 17:52:02 +00:00
|
|
|
background: var(--background);
|
|
|
|
box-shadow: 0 0 3px var(--shadow-weak);
|
|
|
|
margin: 0 0 .5rem 0;
|
|
|
|
}
|
|
|
|
|
2020-08-20 18:48:52 +00:00
|
|
|
.clip-poster-container {
|
|
|
|
position: relative;
|
|
|
|
margin: 0 0 1rem 0;
|
|
|
|
}
|
|
|
|
|
2020-08-20 17:52:02 +00:00
|
|
|
.clip-poster {
|
|
|
|
width: 100%;
|
2020-08-20 18:48:52 +00:00
|
|
|
height: 10rem;
|
2020-08-20 17:52:02 +00:00
|
|
|
object-fit: cover;
|
|
|
|
object-position: center;
|
|
|
|
}
|
|
|
|
|
2020-08-20 18:48:52 +00:00
|
|
|
.clip-duration {
|
2020-08-20 21:35:18 +00:00
|
|
|
background: var(--darken);
|
2020-08-20 18:48:52 +00:00
|
|
|
color: var(--text-light);
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
2020-08-20 21:35:18 +00:00
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
padding: .25rem .5rem;
|
|
|
|
font-size: .9rem;
|
2020-08-20 18:48:52 +00:00
|
|
|
font-weight: bold;
|
|
|
|
text-shadow: 0 0 2px var(--darken-strong);
|
|
|
|
}
|
|
|
|
|
2020-08-20 17:52:02 +00:00
|
|
|
.clip-info {
|
2020-08-20 18:48:52 +00:00
|
|
|
padding: 0 1rem;
|
2020-08-20 17:52:02 +00:00
|
|
|
}
|
|
|
|
|
2020-08-20 18:48:52 +00:00
|
|
|
.clip-row {
|
|
|
|
margin: 0 0 .75rem 0;
|
2020-08-20 17:52:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.clip-title {
|
|
|
|
padding: 0;
|
2020-08-20 18:48:52 +00:00
|
|
|
font-size: 1rem;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
|
|
|
|
.clip-description {
|
|
|
|
line-height: 1.5;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media(max-width: $breakpoint-micro) {
|
|
|
|
.clips {
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
|
|
|
|
}
|
2020-08-20 17:52:02 +00:00
|
|
|
}
|
|
|
|
</style>
|