Lib: Add non-lazy variants for card, image and dropdown

This commit is contained in:
2024-12-23 01:16:48 +01:00
parent c327fe0b1f
commit 6994547d13
5 changed files with 210 additions and 0 deletions

View File

@ -0,0 +1,15 @@
<script lang="ts">
import type { HTMLImgAttributes } from "svelte/elements";
import { fetch_image_base64 } from "$lib/image";
interface ImageProps extends HTMLImgAttributes {
/** The URL to the image resource to load */
src: string;
}
let { src, ...restProps }: ImageProps = $props();
</script>
{#await fetch_image_base64(src) then data}
<img src={data} class="bg-surface-100 transition-opacity" {...restProps} />
{/await}