feat: improve playlists display aside

This commit is contained in:
nieve
2024-08-26 14:55:38 -04:00
committed by Bnyro
parent fa1ee969a7
commit 5266b2d1d9
4 changed files with 399 additions and 265 deletions

View File

@@ -0,0 +1,45 @@
<template>
<div class="w-full">
<img
loading="lazy"
class="aspect-video w-full rounded-md object-contain"
:src="item.thumbnail"
:alt="item.title"
:class="{ 'shorts-img': item.isShort, 'opacity-75': item.watched }"
/>
<!-- progress bar -->
<div class="relative h-1 w-full">
<div
v-if="item.watched && item.duration > 0"
class="absolute bottom-0 left-0 h-1 bg-red-600"
:style="{ width: `clamp(0%, ${(item.currentTime / item.duration) * 100}%, 100%` }"
/>
</div>
</div>
</template>
<script>
export default {
props: {
item: {
type: Object,
default: () => {
return {};
},
},
},
computed: {
title() {
return this.item.dearrow?.titles[0]?.title ?? this.item.title;
},
thumbnail() {
return this.item.dearrow?.thumbnails[0]?.thumbnail ?? this.item.thumbnail;
},
},
};
</script>
<style>
.shorts-img {
@apply w-full object-contain;
}
</style>