feat(web): manual stacking asset (#4650)

Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
Alex 2023-10-27 15:34:01 -05:00 committed by GitHub
parent 72dcde9e0f
commit 8b5b6d0821
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 437 additions and 82 deletions

View file

@ -10,6 +10,7 @@
export let asset: AssetResponseDto;
export let element: HTMLDivElement | undefined = undefined;
export let haveFadeTransition = true;
let imgElement: HTMLDivElement;
let assetData: string;
@ -116,7 +117,7 @@
<div
bind:this={element}
transition:fade={{ duration: 150 }}
transition:fade={{ duration: haveFadeTransition ? 150 : 0 }}
class="flex h-full select-none place-content-center place-items-center"
>
{#await loadAssetData({ loadOriginal: false })}
@ -124,7 +125,7 @@
{:then}
<div bind:this={imgElement} class="h-full w-full">
<img
transition:fade={{ duration: 150 }}
transition:fade={{ duration: haveFadeTransition ? 150 : 0 }}
src={assetData}
alt={asset.id}
class="h-full w-full object-contain"