remove background on media

This commit is contained in:
Jon Staab 2024-11-18 14:57:27 -08:00
parent e9b711593c
commit fd88c15bf9

View file

@ -22,11 +22,8 @@
const expand = () => pushModal(ContentLinkDetail, {url}, {fullscreen: true})
</script>
<Link
external
href={url}
style="background-color: rgba(15, 15, 14, 0.5)"
class="relative my-2 flex w-full flex-grow flex-col overflow-hidden rounded-xl">
<Link external href={url} class="my-2 flex">
<div class="overflow-hidden rounded-box leading-[0]">
{#if url.match(/\.(mov|webm|mp4)$/)}
<video controls src={url} class="max-h-96 object-contain object-center">
<track kind="captions" />
@ -41,23 +38,25 @@
<span class="loading loading-spinner" />
</div>
{:then preview}
<div class="bg-alt flex flex-col max-w-xl leading-normal">
{#if preview.image}
<img
alt="Link preview"
src={imgproxy(preview.image)}
class="max-h-96 object-contain object-center" />
class="max-h-72 object-contain object-center bg-alt" />
{/if}
<div class="h-px" />
{#if preview.title}
<div class="flex flex-col px-4 py-2">
<div class="flex flex-col gap-2 p-4">
<strong class="overflow-hidden text-ellipsis whitespace-nowrap">{preview.title}</strong>
<small>{ellipsize(preview.description, 140)}</small>
<p>{ellipsize(preview.description, 140)}</p>
</div>
{/if}
</div>
{:catch}
<p class="mb-1 p-12 text-center">
<p class="p-12 text-center bg-alt">
Unable to load a preview for {url}
</p>
{/await}
{/if}
</div>
</Link>