Image stuff

pull/8570/head
Puru Vijay 3 years ago
parent 32a2b6e8e7
commit 6eba8e48cb

@ -1,6 +1,6 @@
<script> <script>
import Image from './Image.svelte'; import Image from './Image.svelte';
import Machine from './svelte-machine.png?w=640;1280;2560;3840&format=avif;webp;png&as=picture'; import Machine from './svelte-machine.png?w=640;1280;2560;3840&q=95;format=avif;webp;png&as=picture';
import SvelteLogotype from './svelte-logotype.svg'; import SvelteLogotype from './svelte-logotype.svg';
</script> </script>

@ -10,7 +10,7 @@
{#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 src={src?.fallback?.src} {alt} /> <img src={src?.img?.src} {alt} />
</picture> </picture>
<style> <style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

Loading…
Cancel
Save