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