-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1275 from CodeCrowCorp/dev
Feat: added horizontal vods list to channel page
- Loading branch information
Showing
8 changed files
with
178 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<script lang="ts"> | ||
import { is_vod_modal_open } from '$lib/stores/channelStore' | ||
import { getTimeFormat, timeSince } from '$lib/utils' | ||
export let vod: any | ||
</script> | ||
|
||
<!-- svelte-ignore a11y-click-events-have-key-events --> | ||
<!-- svelte-ignore a11y-no-static-element-interactions --> | ||
<div | ||
class="modal {$is_vod_modal_open ? 'modal-open' : ''}" | ||
on:click={() => { | ||
$is_vod_modal_open = false | ||
vod = null | ||
}}> | ||
<div | ||
class="modal-box w-11/12 h-full max-w-[1500px] overflow-hidden" | ||
on:click={(e) => { | ||
e.stopPropagation() | ||
}}> | ||
<form method="dialog"> | ||
<button | ||
class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2" | ||
on:click={() => { | ||
$is_vod_modal_open = false | ||
vod = null | ||
}}>✕</button> | ||
</form> | ||
<h3 class="font-bold text-lg">@{vod?.username}</h3> | ||
{timeSince(vod?.createdAt)} | ||
<iframe | ||
src={vod?.url} | ||
class="w-full h-full max-w-full max-h-full" | ||
allow="fullscreen" | ||
title="vod"></iframe> | ||
</div> | ||
</div> |
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 @@ | ||
<script lang="ts"> | ||
import { get } from '$lib/api' | ||
import { getTimeFormat, timeSince } from '$lib/utils' | ||
import { onMount } from 'svelte' | ||
import DialogVod from './DialogVod.svelte' | ||
import { is_vod_modal_open } from '$lib/stores/channelStore' | ||
export let channelId: number | ||
let vods: any = [], | ||
selectedVod: any | ||
onMount(async () => { | ||
await getVods() | ||
}) | ||
const getVods = async () => { | ||
vods = await get(`vods?channelId=${channelId}`) | ||
} | ||
</script> | ||
|
||
{#if vods?.length} | ||
<div class="flex space-x-4 bg-base-200 rounded-md overflow-x-auto h-52 overflow-y-hidden p-4"> | ||
{#each vods as vod} | ||
<div | ||
class="flex flex-none cursor-pointer relative" | ||
on:click={() => { | ||
$is_vod_modal_open = true | ||
selectedVod = vod | ||
}}> | ||
<!-- <iframe src={vod.url} class="rounded-box"></iframe> --> | ||
<img src={vod.thumbnail} class="rounded-md" alt="vod thumbnail" /> | ||
<span | ||
class="badge badge-md text-ghost rounded-md font-semibold border-none absolute m-1 bottom-0" | ||
>{timeSince(vod.createdAt)}</span> | ||
<!-- <span class="badge badge-md text-ghost rounded-md font-semibold border-none absolute m-1" | ||
>@{vod.username}</span> --> | ||
<div | ||
class="badge badge-md text-ghost rounded-md font-semibold border-none absolute bottom-0 right-0 m-1"> | ||
{getTimeFormat(vod.duration)} | ||
</div> | ||
</div> | ||
{/each} | ||
</div> | ||
<DialogVod vod={selectedVod} /> | ||
{/if} |
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