mirror of
https://github.com/immich-app/immich.git
synced 2024-11-16 02:18:50 -07:00
[WEB] Load thumbnail with native source property for faster load time (#378)
This commit is contained in:
parent
e4c4b53fcd
commit
2336a6159c
@ -44,6 +44,10 @@ body {
|
|||||||
color: #5f6368;
|
color: #5f6368;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input:focus-visible {
|
||||||
|
outline-offset: 0px !important;
|
||||||
|
outline: none !important;
|
||||||
|
}
|
||||||
@layer utilities {
|
@layer utilities {
|
||||||
.immich-form-input {
|
.immich-form-input {
|
||||||
@apply bg-slate-100 p-2 rounded-md focus:border-immich-primary text-sm;
|
@apply bg-slate-100 p-2 rounded-md focus:border-immich-primary text-sm;
|
||||||
|
@ -246,25 +246,15 @@
|
|||||||
|
|
||||||
<!-- Thumbnail -->
|
<!-- Thumbnail -->
|
||||||
{#if intersecting}
|
{#if intersecting}
|
||||||
{#await loadImageData()}
|
|
||||||
<div
|
|
||||||
style:width={`${thumbnailSize}px`}
|
|
||||||
style:height={`${thumbnailSize}px`}
|
|
||||||
class={`bg-immich-primary/10 ${getSize()} flex place-items-center place-content-center `}
|
|
||||||
>
|
|
||||||
...
|
|
||||||
</div>
|
|
||||||
{:then imageData}
|
|
||||||
<img
|
<img
|
||||||
style:width={`${thumbnailSize}px`}
|
style:width={`${thumbnailSize}px`}
|
||||||
style:height={`${thumbnailSize}px`}
|
style:height={`${thumbnailSize}px`}
|
||||||
in:fade={{ duration: 250 }}
|
in:fade={{ duration: 250 }}
|
||||||
src={imageData}
|
src={`/api/asset/thumbnail/${asset.id}?format=${format}`}
|
||||||
alt={asset.id}
|
alt={asset.id}
|
||||||
class={`object-cover ${getSize()} transition-all duration-100 z-0 ${getThumbnailBorderStyle()}`}
|
class={`object-cover ${getSize()} transition-all duration-100 z-0 ${getThumbnailBorderStyle()}`}
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
/>
|
/>
|
||||||
{/await}
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if mouseOver && asset.type === AssetTypeEnum.Video}
|
{#if mouseOver && asset.type === AssetTypeEnum.Video}
|
||||||
|
Loading…
Reference in New Issue
Block a user