-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
683 lines (563 loc) · 34.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>A17 lazyload</title>
<link media="all" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/sunburst.min.css">
<style>
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: inherit;
touch-action: inherit;
}
*,
*::before,
*::after {
box-sizing: inherit;
}
html {
overflow-x: hidden;
overflow-y: scroll;
box-sizing: border-box;
touch-action: manipulation;
scroll-behavior: smooth;
box-sizing: border-box;
}
body {
display: flex;
flex-direction: column;
flex-wrap: nowrap;
min-height: 100vh;
font-family: var(--serif-font);
font-size: 100%;
font-kerning: normal;
line-height: 1;
text-rendering: optimizeLegibility;
font-variant-ligatures: common-ligatures;
font-feature-settings: "kern" on;
-webkit-text-size-adjust: 100%;
text-size-adjust: 100%;
color: #1a1a1a;
background: #fff;
font-family: SuisseIntl, Helvetica, Arial, sans-serif;
}
.f-h1 {
font-weight: 500;
font-size: 2rem;
line-height: 1.2;
letter-spacing: -0.02em;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
}
@media screen and (min-width: 650px) {
.f-h1 {
font-size: 2.25rem;
}
}
@media screen and (min-width: 990px) {
.f-h1 {
font-size: 3rem;
}
}
.f-h2 {
font-weight: 500;
font-size: 1.25rem;
line-height: 1.2;
letter-spacing: -0.02em;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
}
@media screen and (min-width: 990px) {
.f- h2 {
font-size: 1.75rem;
}
}
@media screen and (min-width: 650px) {
.f-h2 {
font-size: 1.5rem;
}
}
.f-body,
input,
main p,
main ul,
main ol,
main dl {
font-size: 0.875rem;
line-height: 1.7;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
}
@media screen and (min-width: 650px) {
.f-body,
input,
main p,
main ul,
main ol,
main dl {
font-size: 1rem;
}
}
.f-small,
small {
font-size: 0.6rem;
line-height: 1.7;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
}
@media screen and (min-width: 650px) {
.f-small,
small {
font-size: 0.8rem;
}
}
header {
padding: 0.75rem 2.5rem;
border-bottom: 1px solid #000;
}
main {
flex-grow: 1;
padding: 3.75rem 2.5rem 0;
}
footer {
margin-top: 60px;
padding: 1.5rem 2.5rem;
border-top: 1px solid #000;
}
header h1 {
padding-top: 3.75rem;
}
@media screen and (min-width: 650px) {
header h1 {
padding-top: 5rem;
}
}
@media screen and (min-width: 990px) {
header h1 {
padding-top: 6.25rem;
}
}
header ul,
footer ul {
display: flex;
flex-direction: row;
}
header li,
footer li {
margin-top: 1.25rem;
list-style-type: none;
}
header li:first-child,
footer li:first-child {
margin-right: auto;
}
@media screen and (min-width: 544px) {
header li,
footer li {
margin-top: 0;
margin-right: 1.25rem;
}
}
header a,
footer a {
color: #1a1a1a;
text-decoration: none;
}
header svg,
footer svg {
display: inline-block;
vertical-align: text-bottom;
}
main h2:not(:first-child) {
margin-top: 3.5rem;
border-top: 1px solid #d9d9d9;
padding-top: 3rem;
}
main small {
display: block;
}
main p,
main small,
main ul,
main ol,
main dl {
margin-top: 1rem;
}
main a {
text-decoration: underline;
color: #111;
}
main a:hover,
main a:active,
main a:focus {
color: #9e9e9e;
}
form {
margin-top: 2.5rem;
padding: 1.25rem;
background: #f2f2f2;
}
fieldset {
border: 0 none;
}
label {
display: block;
}
input {
width: 100%;
margin-top: 0.5rem;
padding: 0.125rem 0.5rem;
}
.input-container {
position: relative;
}
pre,
code,
kbd {
padding: 0;
font-family: "Lucida Console", Courier, monospace;;
font-size: 0.875rem;
line-height: 1.2;
font-weight: 400;
}
pre {
display: block;
margin-top: 1rem;
}
code,
kbd {
display: inline-block;
background-color: #eee;
color: #000;
vertical-align: middle;
padding: 2px 6px;
}
pre code {
display: block;
background-color: #1a1a1a;
color: #f8f8f8;
}
dl {
overflow: hidden;
}
dt {
font-weight: bold;
clear: both;
float: left;
width: 260px;
text-align: right;
}
dt em {
font-weight: normal;
font-size: 80%;
}
dd {
float: left;
padding-left: 2em;
width: calc(100% - 260px);
}
img,
figure,
picture {
display: block;
border: 0 none;
max-width: 500px;
height: auto;
outline: 0 none;
opacity: 1;
transition: opacity .25s;
}
img[data-src]:not([src^="data:image"]),
img[data-srcset]:not([src^="data:image"]),
iframe[data-src] {
opacity: 0;
}
img[data-srcset][src=""] {
content: url("data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==");
}
.img-container {
display: block;
position: relative;
width: 100%;
max-width: 500px;
margin-top: 10px;
background-color: #f2f2f2;
}
.img-container::before {
content: '';
display: block;
height: 0;
padding-bottom: 56.25%;
}
.img-container img,
.img-container figure,
.img-container picture,
.img-container iframe {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
width: 100%;
max-width: initial;
height: 100%;
margin: 0;
object-fit: cover;
}
.grid {
display: flex;
flex-flow: row wrap;
justify-content: flex-start;
align-content: flex-start;
margin: 0 -10px;
padding: 0;
list-style-type: none;
}
.grid li {
flex: 0 0 auto;
width: calc((100% - 60px)/3);
margin: 20px 10px 0;
padding: 0;
}
.grid .img-container {
margin-top: 0;
}
.btn {
display: block;
min-width: 100px;
padding-top: 12px;
padding-bottom: 12px;
border: 1px solid #000;
border-radius: 4px;
font-family: SuisseIntl, Helvetica, Arial, sans-serif;
font-size: 16px;
text-align: center;
white-space: nowrap;
cursor: pointer;
transition: all .25s;
-webkit-appearance: none;
}
</style>
</head>
<body>
<header>
<ul class="f-body">
<li><a href="https://area17.com/" target="_blank">AREA 17</a></li>
<li>
<a href="https://github.com/area17/lazyload">
GitHub
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 1024 1024" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.73 6.56 11.53C4.78 11.33 2.92 10.64 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7.34 3.86 8.02 3.86C8.7 3.86 9.38 3.95 10.02 4.13C11.55 3.09 12.22 3.31 12.22 3.31C12.66 4.41 12.38 5.23 12.3 5.43C12.81 5.99 13.12 6.7 13.12 7.58C13.12 10.65 11.25 11.33 9.47 11.53C9.76 11.78 10.01 12.26 10.01 13.01C10.01 14.08 10 14.94 10 15.21C10 15.42 10.15 15.67 10.55 15.59C13.71 14.53 16 11.53 16 8C16 3.58 12.42 0 8 0Z" transform="scale(64)" fill="currentColor"></path></svg>
</a>
</li>
</ul>
<h1 class="f-h1">A17 lazyload</h1>
</header>
<main>
<h2 class="f-h2">Static data</h2>
<p>Simple, tiny, no dependency, lazy loader. Source code available on <strong><a href="https://github.com/area17/lazyload">github.com/area17/lazyload</a></strong>.</p>
<p>Doesn't preload, unload, mess with media queries, emit events, offer APIs etc. <br>Uses <code>IntersectionObserver</code> if available and if not, it uses a throttled <code>requestAnimationFrame</code> if available. If neither are available it does nothing.</p>
<p>When an element is in the view port it swaps <code>data-src/data-srcset</code> on <code>img</code>, <code>source</code> and <code>iframes</code> to <code>src/srcset</code>. It also adds a load listener and removes the <code>data-</code> attribute on load to allow you to hook styles up to the two different states.</p>
<p>It will also look for <code>data-lazyload</code> and swap that attribute for <code>data-lazyloaded</code>; again so you can hook up styles to the two different states.</p>
<p>If <code>data-srcset</code> to <code>srcset</code> and <a href="http://scottjehl.github.io/picturefill/" target="_blank">picturefill</a> is present, attempts to run picturefill on the element.</p>
<p>When it runs out of elements to watch, the loop ends.</p>
<small>NB: v0.1.0 of @area17/a17-lazyload correlates to v2.1.1 of the original development</small>
<h2 class="f-h2">Setting up</h2>
<p>In your HTML:</p>
<pre><code class="language-html"><script src="path/to/lazyload.min.js"></script></code></pre>
<p><a href="https://github.com/area17/lazyload/blob/master/dist/a17-lazyload.min.js" target="_blank">(minified JS file)</a></p>
<p>In your JavaScript (on DOM ready):</p>
<pre><code class="language-javascript">document.addEventListener('DOMContentLoaded', function(){
lazyload();
});</code></pre>
<p>Also available via NPM:</p>
<pre><code class="language-terminal">npm install @area17/a17-lazyload</code></pre>
<p>Remember to import it:</p>
<pre><code class="language-javascript">import lazyload from '@area17/a17-lazyload';
document.addEventListener('DOMContentLoaded', function(){
lazyload();
});</code></pre>
<h2 class="f-h2">Options</h2>
<p>These options are the defaults, and can be overridden on init:</p>
<pre><code class="language-javascript">var options = {
namespace: '', // add custom name to attributes ie: data-'namespace'-src
pageUpdatedEventName: 'page:updated', // how your app tells the rest of the app an update happened
elements: 'img[data-src], img[data-srcset], source[data-srcset], iframe[data-src], video[data-src], [data-lazyload]', // maybe you just want images?
rootMargin: '0px', // IntersectionObserver option
threshold: 0, // IntersectionObserver option
maxFrameCount: 10, // 60fps / 10 = 6 times a second
forceAutoplayVideoPlay: true // force autoplay of autoplay videos
};
lazyload(options);</code></pre>
<dl>
<dt><code>namespace</code></dt>
<dd><em>string</em> - a string for custom attributes naming, ie: data-'namespace'-src. Defaults to none. This is applied to all data attributes: src, srcset, lazyload, lazyloaded</dd>
<dt><code>pageUpdatedEventName</code></dt>
<dd><em>string</em> - an event name to listen for when the page has new content that might need to be lazy loaded. If set to `false` lazyLoad will only run on initial page load.</dd>
<dt><code>elements</code></dt>
<dd><em>string</em> - string of items to look to lazy load.</dd>
<dt><code>rootMargin</code></dt>
<dd><em>string</em> - <a href="https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver" target="_blank">IntersectionObserver</a> <a href="https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/rootMargin" target="_blank">rootMargin</a> option.</dd>
<dt><code>threshold</code></dt>
<dd><em>integer/array</em> - <a href="https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver" target="_blank">IntersectionObserver</a> <a href="https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/thresholds" target="_blank">threshold</a> option.</dd>
<dt><code>maxFrameCount</code></dt>
<dd><em>integer</em> - as <code>requestAnimationFrame</code> runs as the monitor refreshes, this could be 60 times a second, to throttle this we can tell the script every NUM of frames.</dd>
<dt><code>forceAutoplayVideoPlay</code> <em>> 0.1.2</em></dt>
<dd><em>boolean</em> - defaults to <code>true</code>, iOS Safari doesn't always autoplay lazy loaded videos with the autoplay attribute, this will attempt to force it, but beware, it potentially replaces the video in order to force Safari to play it, which will likely mean any event listeners you have on the video will be lost. You may need to alter your JavaScript or disable this option.</dd>
</dl>
<h2 class="f-h2">Useful CSS</h2>
<p>This demo page uses the following CSS:</p>
<pre><code class="language-css">picture,
img,
iframe {
display: block;
border: 0 none;
opacity: 1;
transition: opacity .25s;
width: 500px;
height: 281px;
background: #f2f2f2;
outline: 0 none;
}
iframe {
width: 560px;
height: 315px;
}
img[data-src]:not([src^="data:image"]),
img[data-srcset]:not([src^="data:image"]),
iframe[data-src] {
opacity: 0;
}
img[data-srcset][src=""] {
content: url("data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==");
}</code></pre>
<p>Its well advisable to give the images/picture/iframes an intrinsic size to stop huge repaints: Either by giving a pixel size and using a transparent gif:</p>
<pre><code><img width="500" height="281" data-src="./images/greenflash_800.jpg" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="></code></pre>
<p>Or, using the padding trick:</p>
<pre><code class="language-css">.img-container {
position: relative;
height: 0;
padding-bottom: 56.25%; // for 16:9 images
}
.img-container img {
position: absolute;
width: 100%;
height: 100%;
object-fit: cover;
}</code></pre>
<h2 class="f-h2">Standard image, no <code>src</code></h2>
<span class="img-container">
<img data-src="./images/greenflash_800.jpg">
</span>
<pre><code class="language-html"><img data-src="./images/greenflash_800.jpg"></code></pre>
<h2 class="f-h2">Standard image, <code>src=""</code></h2>
<span class="img-container">
<img src="" data-src="./images/greenflash_800.jpg">
</span>
<pre><code class="language-html"><img src="" data-src="./images/greenflash_800.jpg"></code></pre>
<h2 class="f-h2">Image on different domain</h2>
<span class="img-container">
<img data-src="https://area17.imgix.net/26b6abd1-b18e-4cd0-87c2-1687d6c30a6a/nytimes-events_photo_04.jpg?auto=compress%2Cformat&fit=min&fm=jpg&ixjsv=2.2.4&q=90&rect=0%2C0%2C2880%2C1620&w=480" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==">
</span>
<pre><code class="language-html"><img data-src="https://area17.imgix.net/26b6abd1-b18e-4cd0-87c2-1687d6c30a6a/nytimes-events_photo_04.jpg?auto=compress%2Cformat&fit=min&fm=jpg&ixjsv=2.2.4&q=90&rect=0%2C0%2C2880%2C1620&w=480" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="></code></pre>
<h2 class="f-h2">Standard image with LQIP</h2>
<span class="img-container">
<img data-src="./images/greenflash_800.jpg" src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAABAAD/4QN8aHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjUtYzAxNCA3OS4xNTE0ODEsIDIwMTMvMDMvMTMtMTI6MDk6MTUgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6Y2QwNDkwYzktYTE1Yy00OTY2LTg2MWMtM2QwMWNjODk2MjhkIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkFDMjExNDdBQjRERDExRTY5M0NCRTVBNkJEODRGOTJCIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkFDMjExNDc5QjRERDExRTY5M0NCRTVBNkJEODRGOTJCIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDQyAoTWFjaW50b3NoKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSB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YTdBNzJqDamqcRNreySwaIY3oM1JILZLG9kzbIgosFBm5mbSQVSue9UDhGRsZFV0CxkbGRVclKGRr1FVhofUQciqsAScjJyKrcDJByMnIqtIT6iqrQf//Z">
</span>
<pre><code class="language-html"><img data-src="./images/greenflash_800.jpg" src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAABAAD/4QN8aHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjUtYzAxNCA3OS4xNTE0ODEsIDIwMTMvMDMvMTMtMTI6MDk6MTUgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6Y2QwNDkwYzktYTE1Yy00OTY2LTg2MWMtM2QwMWNjODk2MjhkIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkFDMjExNDdBQjRERDExRTY5M0NCRTVBNkJEODRGOTJCIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkFDMjExNDc5QjRERDExRTY5M0NCRTVBNkJEODRGOT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oQdQHQRcSagwGNrY9Ii1tZIg5drQi77EiCkQZCK7Xfau1klOYxczB7DFgxbIOMwczF7TBzMGySDk2q9GxVJINQ6B5hN0E3nJuDpDYeYTdBNzJqDamqcRNreySwaIY3oM1JILZLG9kzbIgosFBm5mbSQVSue9UDhGRsZFV0CxkbGRVclKGRr1FVhofUQciqsAScjJyKrcDJByMnIqtIT6iqrQf//Z"></code></pre>
<h2 class="f-h2">Simple responsive image</h2>
<span class="img-container">
<img src="" data-srcset="./images/greenflash_800.jpg 800w, ./images/greenflash_400.jpg 400w" sizes="500px">
</span>
<pre><code class="language-html"><img src="" data-srcset="./images/greenflash_800.jpg 800w, ./images/greenflash_400.jpg 400w" sizes="500px"></code></pre>
<h2 class="f-h2">Responsive image with LQIP</h2>
<span class="img-container">
<img data-srcset="./images/greenflash_800.jpg 800w, ./images/greenflash_400.jpg 400w" sizes="500px" src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAABAAD/4QN8aHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjUtYzAxNCA3OS4xNTE0ODEsIDIwMTMvMDMvMTMtMTI6MDk6MTUgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBl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yM2LhgvFDNJKishXSUyRzwmMGg5Pi8qNEVGQlNUUWJnQ2VWWzhMPTdePzRpSkhbSVxNTk9KW1xdXl9VZmdoaWprbG1ub2EQACAgAFAQYGAQMBAwUDBi8AARECIQMxQRJRYXGBkSITMvChsQTB0eHxQlIjYnIUkjOCQySisjRTRGNzwtKDk6NU4vIFFSUGFiY1ZEVVNnRls4TD03Xj80aUpIW0lcTU5PSltcXV5fVWZnaG/9oADAMBAAIRAxEAPwDipNOm1O10QgBoBsRaEWAik7XURaEWFMNq7Xo2J2KSwcpizT1GDmYqSGFIp2MWCGgzpW6VA6BBoQdQHQRcSagwGNrY9Ii1tZIg5drQi77EiCkQZCK7Xfau1klOYxczB7DFgxbIOMwczF7TBzMGySDk2q9GxVJINQ6B5hN0E3nJuDpDYeYTdBNzJqDamqcRNreySwaIY3oM1JILZLG9kzbIgosFBm5mbSQVSue9UDhGRsZFV0CxkbGRVclKGRr1FVhofUQciqsAScjJyKrcDJByMnIqtIT6iqrQf//Z">
</span>
<pre><code class="language-html"><img data-srcset="./images/greenflash_800.jpg 800w, ./images/greenflash_400.jpg 400w" sizes="500px" src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAABAAD/4QN8aHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjUtYzAxNCA3OS4xNTE0ODEsIDIwMTMvMDMvMTMtMTI6MDk6MTUgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmF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EBAQEBAQAAAAAAAQACAwQFBgcICQoLAQEBAQEBAQEBAQEBAQAAAAAAAQIDBAUGBwgJCgsQAAICAQMCAwQHBgMDBgIBNQEAAhEDIRIxBEFRIhNhcTKBkbFCoQXRwRTwUiNyM2LhgvFDNJKishXSUyRzwmMGg5Pi8qNEVGQlNUUWJnQ2VWWzhMPTdePzRpSkhbSVxNTk9KW1xdXl9VZmdoaWprbG1ub2EQACAgAFAQYGAQMBAwUDBi8AARECIQMxQRJRYXGBkSITMvChsQTB0eHxQlIjYnIUkjOCQySisjRTRGNzwtKDk6NU4vIFFSUGFiY1ZEVVNnRls4TD03Xj80aUpIW0lcTU5PSltcXV5fVWZnaG/9oADAMBAAIRAxEAPwDipNOm1O10QgBoBsRaEWAik7XURaEWFMNq7Xo2J2KSwcpizT1GDmYqSGFIp2MWCGgzpW6VA6BBoQdQHQRcSagwGNrY9Ii1tZIg5drQi77EiCkQZCK7Xfau1klOYxczB7DFgxbIOMwczF7TBzMGySDk2q9GxVJINQ6B5hN0E3nJuDpDYeYTdBNzJqDamqcRNreySwaIY3oM1JILZLG9kzbIgosFBm5mbSQVSue9UDhGRsZFV0CxkbGRVclKGRr1FVhofUQciqsAScjJyKrcDJByMnIqtIT6iqrQf//Z"></code></pre>
<h2 class="f-h2">Simple <picture>, no <code>src</code></h2>
<span class="img-container">
<picture>
<source data-srcset="./images/greenflash_400.jpg, ./images/greenflash_800.jpg 2x" media="(min-width: 800px)">
<source data-srcset="./images/greenflash_400.jpg, ./images/greenflash_800.jpg 2x" media="(max-width: 799px)">
<img>
</picture>
</span>
<pre><code class="language-html"><picture>
<source data-srcset="./images/greenflash_400.jpg, ./images/greenflash_800.jpg 2x" media="(min-width: 800px)">
<source data-srcset="./images/greenflash_400.jpg, ./images/greenflash_800.jpg 2x" media="(max-width: 799px)">
<img>
</picture></code></pre>
<h2 class="f-h2">Simple <picture>, <code>src="./images/greenflash_100.jpg"</code> (LQIP)</h2>
<span class="img-container">
<picture>
<source data-srcset="./images/greenflash_400.jpg, ./images/greenflash_800.jpg 2x" media="(min-width: 800px)">
<source data-srcset="./images/greenflash_400.jpg, ./images/greenflash_800.jpg 2x" media="(max-width: 799px)">
<img src="./images/greenflash_100.jpg">
</picture>
</span>
<pre><code class="language-html"><picture>
<source data-srcset="./images/greenflash_400.jpg, ./images/greenflash_800.jpg 2x" media="(min-width: 800px)">
<source data-srcset="./images/greenflash_400.jpg, ./images/greenflash_800.jpg 2x" media="(max-width: 799px)">
<img src="./images/greenflash_100.jpg">
</picture></code></pre>
<h2 class="f-h2"><picture> with inline LQIP</h2>
<span class="img-container">
<picture>
<source data-srcset="./images/greenflash_400.jpg, ./images/greenflash_800.jpg 2x" media="(min-width: 800px)">
<source data-srcset="./images/greenflash_400.jpg, ./images/greenflash_800.jpg 2x" media="(max-width: 799px)">
<img src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAABAAD/4QN8aHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjUtYzAxNCA3OS4xNTE0ODEsIDIwMTMvMDMvMTMtMTI6MDk6MTUgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1sbnM6eG1w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EVGQlNUUWJnQ2VWWzhMPTdePzRpSkhbSVxNTk9KW1xdXl9VZmdoaWprbG1ub2EQACAgAFAQYGAQMBAwUDBi8AARECIQMxQRJRYXGBkSITMvChsQTB0eHxQlIjYnIUkjOCQySisjRTRGNzwtKDk6NU4vIFFSUGFiY1ZEVVNnRls4TD03Xj80aUpIW0lcTU5PSltcXV5fVWZnaG/9oADAMBAAIRAxEAPwDipNOm1O10QgBoBsRaEWAik7XURaEWFMNq7Xo2J2KSwcpizT1GDmYqSGFIp2MWCGgzpW6VA6BBoQdQHQRcSagwGNrY9Ii1tZIg5drQi77EiCkQZCK7Xfau1klOYxczB7DFgxbIOMwczF7TBzMGySDk2q9GxVJINQ6B5hN0E3nJuDpDYeYTdBNzJqDamqcRNreySwaIY3oM1JILZLG9kzbIgosFBm5mbSQVSue9UDhGRsZFV0CxkbGRVclKGRr1FVhofUQciqsAScjJyKrcDJByMnIqtIT6iqrQf//Z">
</picture>
</span>
<pre><code class="language-html"><picture>
<source data-srcset="./images/greenflash_400.jpg, ./images/greenflash_800.jpg 2x" media="(min-width: 800px)">
<source data-srcset="./images/greenflash_400.jpg, ./images/greenflash_800.jpg 2x" media="(max-width: 799px)">
<img src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAABAAD/4QN8aHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjUtYzAxNCA3OS4xNTE0ODEsIDIwMTMvMDMvMTMtMTI6MDk6MTUgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4L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/wAARCAA4AGQDASIAAhEBAxEB/8QBGwAAAwEBAQEBAQEBAQAAAAAAAQACAwQFBgcICQoLAQEBAQEBAQEBAQEBAQAAAAAAAQIDBAUGBwgJCgsQAAICAQMCAwQHBgMDBgIBNQEAAhEDIRIxBEFRIhNhcTKBkbFCoQXRwRTwUiNyM2LhgvFDNJKishXSUyRzwmMGg5Pi8qNEVGQlNUUWJnQ2VWWzhMPTdePzRpSkhbSVxNTk9KW1xdXl9VZmdoaWprbG1ub2EQACAgAFAQYGAQMBAwUDBi8AARECIQMxQRJRYXGBkSITMvChsQTB0eHxQlIjYnIUkjOCQySisjRTRGNzwtKDk6NU4vIFFSUGFiY1ZEVVNnRls4TD03Xj80aUpIW0lcTU5PSltcXV5fVWZnaG/9oADAMBAAIRAxEAPwDipNOm1O10QgBoBsRaEWAik7XURaEWFMNq7Xo2J2KSwcpizT1GDmYqSGFIp2MWCGgzpW6VA6BBoQdQHQRcSagwGNrY9Ii1tZIg5drQi77EiCkQZCK7Xfau1klOYxczB7DFgxbIOMwczF7TBzMGySDk2q9GxVJINQ6B5hN0E3nJuDpDYeYTdBNzJqDamqcRNreySwaIY3oM1JILZLG9kzbIgosFBm5mbSQVSue9UDhGRsZFV0CxkbGRVclKGRr1FVhofUQciqsAScjJyKrcDJByMnIqtIT6iqrQf//Z">
</picture></code></pre>
<h2 class="f-h2">iFrame</h2>
<span class="img-container">
<iframe data-src="https://www.youtube.com/embed/Wji-BZ0oCwg?list=PL148kCvXk8pDWYE9q9cNdux5JFmu80kN8" width="560" height="315" frameborder="0" allowfullscreen></iframe>
</span>
<pre><code class="language-html"><iframe data-src="https://www.youtube.com/embed/Wji-BZ0oCwg?list=PL148kCvXk8pDWYE9q9cNdux5JFmu80kN8" width="560" height="315" frameborder="0" allowfullscreen></iframe></code></pre>
<h2 class="f-h2">Dynamically added content</h2>
<p><button class="btn" data-addItemsToList-trigger>Add</button></p>
<ul class="grid" data-addItemsToList-target></ul>
</main>
<footer>
<ul>
<li><a href="https://area17.com/" target="_blank">Copyright © AREA 17</a></li>
<li>
<a href="https://github.com/area17/lazyload">
GitHub
<svg class="inline-block align-text-bottom" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 1024 1024" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.73 6.56 11.53C4.78 11.33 2.92 10.64 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7.34 3.86 8.02 3.86C8.7 3.86 9.38 3.95 10.02 4.13C11.55 3.09 12.22 3.31 12.22 3.31C12.66 4.41 12.38 5.23 12.3 5.43C12.81 5.99 13.12 6.7 13.12 7.58C13.12 10.65 11.25 11.33 9.47 11.53C9.76 11.78 10.01 12.26 10.01 13.01C10.01 14.08 10 14.94 10 15.21C10 15.42 10.15 15.67 10.55 15.59C13.71 14.53 16 11.53 16 8C16 3.58 12.42 0 8 0Z" transform="scale(64)" fill="currentColor"></path></svg>
</a>
</li>
</ul>
</footer>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
<script src="./dist/a17-lazyload.js"></script>
<script>
const addItems = (e) => {
e.preventDefault();
$trigger.removeEventListener('click', addItems);
$trigger.parentNode.parentNode.removeChild($trigger.parentNode);
const li = '<li><span class="img-container"><img data-src="./images/greenflash_800.jpg"></span></li>';
const html = li + li + li + li + li + li + li + li + li + li + li + li;
$target.innerHTML = html;
document.dispatchEvent(new CustomEvent('page:updated'));
}
$trigger = document.querySelector('[data-addItemsToList-trigger]');
$target = document.querySelector('[data-addItemsToList-target]');
$trigger.addEventListener('click', addItems, false);
if (typeof lazyload) {
lazyload();
}
if (window.hljs) {
hljs.highlightAll();
}
</script>
</body>
</html>