0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-29 22:53:05 +00:00
VueTube/NUXT/components/CompactRenderers/compactChannelRenderer.vue

121 lines
2.6 KiB
Vue
Raw Normal View History

<template>
2022-05-14 05:10:38 +00:00
<v-card
flat
to="/channel"
class="entry gridVideoRenderer background"
2022-05-18 03:19:22 +00:00
:class="
roundThumb && roundTweak > 0
? $vuetify.theme.dark
2022-05-18 03:53:03 +00:00
? 'lighten-1'
: 'darken-1'
2022-05-18 03:19:22 +00:00
: ''
"
:style="{
borderRadius: roundThumb ? `${roundTweak / 2}rem` : '0',
margin:
roundThumb && roundTweak > 0 ? '0 1rem 1rem 1rem' : '0 0 0.25rem 0',
}"
2022-05-14 05:10:38 +00:00
@click="$store.dispatch('channel/fetchChannel', video.channelId)"
>
2022-05-18 04:22:14 +00:00
<div id="details" class="pa-4">
<a
:href="
this.$rendererUtils.getNavigationEndpoints(video.navigationEndpoint)
"
2022-05-18 04:22:14 +00:00
class="avatar-link"
>
<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-05-18 04:22:14 +00:00
<v-card-text class="video-info py-0" v-emoji>
<div
v-for="title in video.title.runs"
:key="title.text"
2022-05-18 23:36:27 +00:00
class="vid-title mt-1"
>
{{ 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>
2022-05-19 17:55:13 +00:00
<v-btn
fab
text
elevation="0"
class="background--text"
:class="$vuetify.theme.dark ? 'text--lighten-4' : 'text--darken-4'"
2022-05-19 19:00:02 +00:00
style="width: 50px !important; height: 50px !important; z-index: 420"
2022-05-19 17:55:13 +00:00
>
<v-icon>mdi-share-outline</v-icon>
</v-btn>
</div>
</v-card>
</template>
2022-05-14 05:10:38 +00:00
<script>
export default {
props: ["video"],
2022-05-18 03:19:22 +00:00
computed: {
roundTweak() {
return this.$store.state.tweaks.roundTweak;
},
roundThumb() {
return this.$store.state.tweaks.roundThumb;
},
},
2022-05-14 05:10:38 +00:00
methods: {
parseBottom(video) {
const bottomText = [
video.subscriberCountText?.runs[0].text,
video.videoCountText?.runs.map((run) => run.text).join(" "),
];
return bottomText.join(" · ");
},
},
};
</script>
<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 {
border-radius: 50%;
2022-03-24 11:47:13 +00:00
width: 50px;
height: 50px;
}
#details {
display: flex;
flex-direction: row;
flex-basis: auto;
}
@media screen and (orientation: landscape) {
.entry {
margin-bottom: 8px;
}
#details {
flex-direction: column-reverse;
}
}
</style>