Skip to content

Commit e869465

Browse files
committed
Update demo
1 parent 2e25a27 commit e869465

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ import Img from '@zerodevx/svelte-img'
116116

117117
By default, LQIPs are 16px in width and set to `cover` the full image dimension. Increase for a
118118
higher quality LQIP at the expense of a larger `base64`, or set to 1px for a dominant single-colour
119-
background.
119+
background. To disable LQIP completely, set `?lqip=0`.
120120

121121
<!-- prettier-ignore -->
122122
```html
@@ -125,7 +125,7 @@ import src from '$lib/a/cat.jpg?lqip=1&run'
125125
import Img from '@zerodevx/svelte-img'
126126
</script>
127127

128-
<!-- Should render a dominant single-colour background -->
128+
<!-- Render dominant colour background -->
129129
<Img {src} alt="cat" >
130130
```
131131

src/routes/+layout.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script>
22
import '../app.postcss'
3-
import { dev } from '$app/env'
3+
import { dev } from '$app/environment'
44
</script>
55

66
<svelte:head>

src/routes/+page.svelte

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script>
2-
import cat01 from './cat01.jpg?run&width=480;1024;1920;2560'
2+
import cat01 from './cat01.jpg?run&width=480;1024;1920;2560&height=1024'
33
import cat02 from './cat02.jpg?run'
44
import cat03 from './cat03.jpg?run'
55
import cat04 from './cat04.jpg?run'
@@ -18,15 +18,15 @@ import Img from '$lib/index.js'
1818
1919
const features = [
2020
[
21-
'Render the bare minimum, minimally invasive, HTML code to represent responsive images, served in multiple widths and next-gen formats.',
21+
'Full width image in 10 variants - <code>avif/webp/jpg</code> formats at <code>480/1024/1920</code> widths, and a LQIP background.',
2222
cat02
2323
],
2424
[
2525
'Delegate the heavy lifting to native browser handlers and existing build pipelines. Render <strong>&lt;img&gt;</strong> tags with modern defaults, with other component props spread into it.',
2626
cat03
2727
],
2828
[
29-
'Images still work without Javascript. Try disabling JS and refreshing the page. Also try checking the lighthouse score.',
29+
'Images still work without Javascript. Try disabling JS and refreshing the page. Also check out the lighthouse score.',
3030
cat04
3131
]
3232
]
@@ -46,11 +46,20 @@ let selected = 0
4646
</div>
4747
</div>
4848

49-
<div class="max-w-7xl mx-auto prose text-center px-4 mb-28">
50-
{#each features as f}
51-
<p>{@html f[0]}</p>
52-
<Img class="w-full h-128 object-cover" src={f[1]} alt="cat" />
53-
{/each}
49+
<div class="max-w-7xl mx-auto prose px-4 mb-28">
50+
<h1>svelte-img</h1>
51+
<blockquote>
52+
Render the bare minimum, minimally invasive, LQIP-included HTML code to represent responsive
53+
images, served in multiple widths and next-gen formats.
54+
</blockquote>
55+
<ol>
56+
{#each features as f}
57+
<li>
58+
<p>{@html f[0]}</p>
59+
<Img class="w-full h-128 object-cover" src={f[1]} alt="cat" />
60+
</li>
61+
{/each}
62+
</ol>
5463

5564
<p>
5665
Image <code>src</code> can be dynamically updated - well, this requires Javascript because interactivity.

0 commit comments

Comments
 (0)