Skip to content

Commit

Permalink
[site] hero fixes (#6488)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored Aug 31, 2022
1 parent fb7b115 commit cade00d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions sites/kit.svelte.dev/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { Blurb } from '@sveltejs/site-kit';
import Hero from './Hero.svelte';
import Logotype from './svelte-kit-logotype.svg';
import Machine from './svelte-kit-machine.webp?w=1440;800&format=avif;webp;png&picture';
import Machine from './svelte-kit-machine.webp?w=1440;800;600;480&format=avif;webp;png&picture';
</script>

<svelte:head>
Expand All @@ -20,7 +20,6 @@
tagline="The fastest way to build svelte apps"
background={Machine}
alt="SvelteKit illustration"
width={800}
/>

<div class="blurb-shifter">
Expand Down
4 changes: 2 additions & 2 deletions sites/kit.svelte.dev/src/routes/Hero.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
</div>

<div class="hero-image">
<picture>
<picture sizes="(min-width: 480px) 800px, (min-width: 1024px) 480px, 600px">
{#each Object.entries(background.sources) as [format, images]}
<source srcset={images.map((i) => `${i.src} ${i.width}w`).join(', ')} type={'image/' + format} />
<source srcset={images.map((i) => `${i.src} ${i.w}w`).join(', ')} type={'image/' + format} />
{/each}
<img src={background.fallback} {alt} />
</picture>
Expand Down

0 comments on commit cade00d

Please sign in to comment.