0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-09 04:55:07 +00:00
VueTube/NUXT/components/CompactRenderers/compactChannelRenderer.vue

91 lines
1.8 KiB
Vue
Raw Normal View History

<template>
<v-card class="entry gridVideoRenderer background" to="/channel" flat>
<div id="details">
<a
:href="
this.$rendererUtils.getNavigationEndpoints(video.navigationEndpoint)
"
class="avatar-link pt-2"
>
<v-img
class="avatar-thumbnail"
2022-03-24 11:47:13 +00:00
:src="
video.thumbnail.thumbnails[video.thumbnail.thumbnails.length - 1]
.url
"
/>
</a>
2022-04-13 10:15:26 +00:00
<v-card-text class="video-info pt-2" v-emoji>
<div
v-for="title in video.title.runs"
:key="title.text"
style="margin-top: 0.5em"
2022-03-24 11:47:13 +00:00
class="vid-title"
>
{{ title.text }}
</div>
2022-03-31 06:01:29 +00:00
<div
class="caption background--text"
:class="$vuetify.theme.dark ? 'text--lighten-4' : 'text--darken-4'"
v-text="parseBottom(video)"
/>
</v-card-text>
</div>
</v-card>
</template>
<style scoped>
.entry {
width: 100%; /* Prevent Loading Weirdness */
}
.vid-title {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
overflow: hidden;
}
.avatar-thumbnail {
margin-top: 0.5rem;
margin-left: 0.5rem;
border-radius: 50%;
2022-03-24 11:47:13 +00:00
width: 50px;
height: 50px;
}
#details {
display: flex;
flex-direction: row;
flex-basis: auto;
2022-03-24 11:47:13 +00:00
padding: 10px;
}
@media screen and (orientation: landscape) {
.entry {
margin-bottom: 8px;
}
#details {
flex-direction: column-reverse;
}
}
</style>
<script>
export default {
props: ["video"],
methods: {
parseBottom(video) {
const bottomText = [
2022-03-24 11:47:13 +00:00
video.subscriberCountText?.runs[0].text,
video.videoCountText?.runs.map((run) => run.text).join(" "),
];
return bottomText.join(" · ");
},
},
};
</script>