feat: horizontal scrollable chapters as tiles

This commit is contained in:
Sai Karthik 2022-06-17 10:36:05 +05:30
parent 1144becbf2
commit 32c3f6e4e4
No known key found for this signature in database
GPG Key ID: F5B9A961BF6EAF0E
1 changed files with 25 additions and 8 deletions

View File

@ -1,18 +1,35 @@
<template> <template>
<h2 v-t="'video.chapters'" /> <!-- <h2 v-t="'video.chapters'" class="mb-5" /> -->
<div :key="chapter.start" v-for="chapter in chapters" @click="$emit('seek', chapter.start)" class="chapter"> <div class="flex overflow-x-auto">
<img :src="chapter.image" :alt="chapter.title" class="h-12" /> <div :key="chapter.start" v-for="chapter in chapters" @click="$emit('seek', chapter.start)" class="chapter">
<div class="ml-1"> <img :src="chapter.image" :alt="chapter.title" class="" />
<span class="text-xl" v-text="chapter.title" /> <div class="m-1 flex">
<br /> <span class="text-truncate text-sm" :title="chapter.title" v-text="chapter.title" />
<span class="text-sm" v-text="timeFormat(chapter.start)" /> <span class="text-sm font-bold text-yellow-500" v-text="timeFormat(chapter.start)" />
</div>
</div> </div>
</div> </div>
</template> </template>
<style> <style>
::-webkit-scrollbar {
height: 5px;
}
.chapter { .chapter {
@apply flex items-center mb-2 cursor-pointer w-sm max-w-90vw; @apply cursor-pointer;
align-self: center;
padding: 10px;
img {
width: 100%;
height: 100%;
}
}
.text-truncate {
white-space: nowrap;
width: 10em;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
} }
</style> </style>