|
|
|
@ -5,14 +5,20 @@
|
|
|
|
/** @type {string} */
|
|
|
|
/** @type {string} */
|
|
|
|
export let alt;
|
|
|
|
export let alt;
|
|
|
|
|
|
|
|
|
|
|
|
console.log(src);
|
|
|
|
export let lazy = false;
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<picture>
|
|
|
|
<picture>
|
|
|
|
{#each Object.entries(src?.sources ?? {}) as [format, images]}
|
|
|
|
{#each Object.entries(src?.sources ?? {}) as [format, images]}
|
|
|
|
<source srcset={images?.map((i) => `${i?.src} ${i?.w}w`).join(', ')} type="image/{format}" />
|
|
|
|
<source srcset={images?.map((i) => `${i?.src} ${i?.w}w`).join(', ')} type="image/{format}" />
|
|
|
|
{/each}
|
|
|
|
{/each}
|
|
|
|
<img height={src.img.h} width={src.img.w} src={src?.img?.src} {alt} />
|
|
|
|
<img
|
|
|
|
|
|
|
|
loading={lazy ? 'lazy' : 'eager'}
|
|
|
|
|
|
|
|
height={src.img.h}
|
|
|
|
|
|
|
|
width={src.img.w}
|
|
|
|
|
|
|
|
src={src?.img?.src}
|
|
|
|
|
|
|
|
{alt}
|
|
|
|
|
|
|
|
/>
|
|
|
|
</picture>
|
|
|
|
</picture>
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
<style>
|
|
|
|
|