mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2025-11-03 22:21:55 +00:00 
			
		
		
		
	feat: horizontal scrollable chapters as tiles
This commit is contained in:
		@@ -1,18 +1,35 @@
 | 
			
		||||
<template>
 | 
			
		||||
    <h2 v-t="'video.chapters'" />
 | 
			
		||||
    <div :key="chapter.start" v-for="chapter in chapters" @click="$emit('seek', chapter.start)" class="chapter">
 | 
			
		||||
        <img :src="chapter.image" :alt="chapter.title" class="h-12" />
 | 
			
		||||
        <div class="ml-1">
 | 
			
		||||
            <span class="text-xl" v-text="chapter.title" />
 | 
			
		||||
            <br />
 | 
			
		||||
            <span class="text-sm" v-text="timeFormat(chapter.start)" />
 | 
			
		||||
    <!-- <h2 v-t="'video.chapters'" class="mb-5" /> -->
 | 
			
		||||
    <div class="flex overflow-x-auto">
 | 
			
		||||
        <div :key="chapter.start" v-for="chapter in chapters" @click="$emit('seek', chapter.start)" class="chapter">
 | 
			
		||||
            <img :src="chapter.image" :alt="chapter.title" class="" />
 | 
			
		||||
            <div class="m-1 flex">
 | 
			
		||||
                <span class="text-truncate text-sm" :title="chapter.title" v-text="chapter.title" />
 | 
			
		||||
                <span class="text-sm font-bold text-yellow-500" v-text="timeFormat(chapter.start)" />
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<style>
 | 
			
		||||
::-webkit-scrollbar {
 | 
			
		||||
    height: 5px;
 | 
			
		||||
}
 | 
			
		||||
.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>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user