-
-
Notifications
You must be signed in to change notification settings - Fork 719
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve playlists display aside
- Loading branch information
1 parent
fa1ee96
commit 5266b2d
Showing
4 changed files
with
389 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
Oops, something went wrong.