0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-30 07:03:05 +00:00
VueTube/NUXT/components/recommended.vue

58 lines
1.4 KiB
Vue
Raw Normal View History

<template>
<div>
<!-- Video Loading Animation -->
<center v-if="recommends.length == 0">
<v-skeleton-loader type="card-avatar, article, actions" />
<v-skeleton-loader type="card-avatar, article, actions" />
</center>
2022-03-21 00:27:41 +00:00
<v-list-item v-for="(video, index) in recommends" :key="index">
<v-card class="entry" :to="`/watch?v=${video.id}`">
<v-card-text>
<div style="position: relative">
<v-img :src="video.thumbnail" />
<div
class="videoRuntimeFloat"
style="color: #fff"
2022-03-21 23:47:11 +00:00
v-text="video.metadata.overlay[0]"
/>
</div>
2022-03-21 23:47:11 +00:00
<div style="margin-top: 0.5em" v-text="video.title" />
<div v-text="parseBottom(video)" />
</v-card-text>
</v-card>
</v-list-item>
</div>
</template>
<style scoped>
.entry {
margin-top: 1em;
width: 100%; /* Prevent Loading Weirdness */
}
.videoRuntimeFloat {
position: absolute;
bottom: 10px;
right: 10px;
background: rgba(0, 0, 0, 0.5);
border-radius: 5px;
padding: 0 3px 0 3px;
}
</style>
<script>
export default {
props: {
recommends: Array,
},
methods: {
parseBottom(video) {
const bottomText = [video.channel, video.metadata.views];
if (video.metadata.published) bottomText.push(video.metadata.published);
return bottomText.join(" • ");
},
},
};
2022-03-21 23:47:11 +00:00
</script>