forked from vb/lazyframe
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
252 lines (237 loc) · 10.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>LazyframeAdvanced - Lazyload your iframes - dependency-free library</title>
<meta name="description" content="a dependency-free library to lazyload iframes and save bandwidth and memory">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="dist/lazyframe.css">
<link rel="stylesheet" href="https://unpkg.com/tailwindcss@^2.0/dist/tailwind.min.css">
<style>
.container,
.container-lg {
width: 100%;
padding-left: 1.5rem;
padding-right: 1.5rem;
margin-left: auto;
margin-right: auto;
}
.lazyframe--custom {
background: #bada55;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
text-align: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
}
.lazyframe--custom .lazyframe__title {
position: relative;
width: 100%;
display: block;
font-size: 32px;
color: #000000;
text-shadow: 10px 1px 0 rgba(255, 255, 255, .06);
}
.lazyframe--custom::before {
width: auto;
}
</style>
</head>
<body class="overflow-x-hidden font-sans antialiased text-gray-900 bg-white">
<main>
<section
class="px-0 pt-48 pb-0 m-0 leading-6 text-gray-900 box-border md:pt-40 bg-blue-500"
id="home"
>
<div class="p-0 my-0 mx-auto w-full text-gray-900 box-border bg-blue">
<div class="flex flex-wrap p-0 m-0 box-border">
<div
class="flex-shrink-0 p-0 m-0 w-full max-w-full lg:flex-none lg:w-full box-border"
>
<div
class="visible p-0 mx-auto mt-auto mb-8 box-border"
data-wow-delay=".2s"
style="visibility: visible; animation-delay: 0.2s; animation-name: fadeInUp; max-width: 780px;"
>
<h1
class="p-0 mx-0 mt-0 mb-8 text-5xl font-bold text-center box-border text-white"
style="line-height: 60px;"
>
Lazyframe Advanced
</h1>
<p
class="p-0 mx-auto mt-auto mb-8 text-xl font-normal leading-9 text-center box-border text-white"
>
a dependency-free library to lazyload iframes and save bandwidth and memory
</p>
<ul
class="flex justify-center items-center py-0 pr-0 pl-8 mx-0 mt-0 mb-4 list-none box-border"
style="list-style: outside none none;"
>
<li
class="p-0 m-0 text-left box-border"
style="list-style: outside none none;"
>
<a
href="#installation"
rel="nofollow noopener"
target="_blank"
class="inline-block py-4 px-6 m-2 text-base font-medium text-center text-blue-600 underline align-middle rounded border border-transparent border-solid shadow-none cursor-pointer box-border whitespace-no-wrap bg-white hover:bg-yellow-300 hover:shadow-xs hover:text-blue-700 no-underline focus:shadow-none focus:no-underline"
style="transition: all 0.4s ease-out 0s; outline: none; z-index: 5; list-style: outside none none;"
>
Installation
</a>
</li>
<li
class="p-0 m-0 text-left box-border"
style="list-style: outside none none;"
>
<a
href="https://jmartsch.github.io/lazyframeAdvanced"
rel="nofollow noopener"
target="_blank"
class="inline-block py-4 px-6 m-2 text-base font-medium text-center text-blue-600 underline align-middle rounded border border-transparent border-solid shadow-none cursor-pointer box-border whitespace-no-wrap bg-white hover:bg-yellow-300 hover:shadow-xs hover:text-blue-700 no-underline focus:shadow-none focus:no-underline"
style="transition: all 0.4s ease-out 0s; outline: none; z-index: 5; list-style: outside none none;"
>
GitHub Repo
</a>
</li>
</ul>
</div>
<div
class="relative visible p-0 m-auto text-center box-border"
data-wow-delay=".25s"
style="visibility: visible; animation-delay: 0.25s; animation-name: fadeInUp; max-width: 845px; z-index: 1;"
>
<img
src="images/hero-image.jpg"
alt="hero-image"
class="p-0 m-0 max-w-full align-middle box-border"
/>
<img
src="images/dotted-shape.svg"
alt="shape"
class="absolute bottom-0 p-0 m-0 max-w-full align-middle box-border"
style="z-index: -1; left: -30px;"
/>
<img
src="images/dotted-shape.svg"
alt="shape"
class="absolute p-0 m-0 max-w-full align-middle box-border"
style="z-index: -1; top: -20px; right: -20px;"
/>
</div>
</div>
</div>
</div>
</section>
<div class="p-0 mx-auto mt-20 mb-16 leading-6 text-center text-gray-600 box-border max-w-xl">
<h2 class="p-0 mx-0 mt-0 mb-5 text-4xl font-bold xl:text-3xl box-border">
Why would you use it?
</h2>
<p class="mt-5 mt-5 text-2xl text-center">JavaScripts loaded from external providers like YouTube or Vimeo or Google Maps are big and waste precious bandwidth (especially on mobile). This slows down the loading of your website, even if your visitors don't want to see your beautiful videos or embeds.
</p>
<p class="mt-10">For example here are the number of requests and filesizes of some well-known services:</p>
<ul class="list-unstyled mt-10">
<li>
YouTube – 11 requests ≈ 1099kb (over a megabyte) 😲
</li>
<li>
Google maps – 52 requests ≈ 520kb 😲
</li>
<li>
Vimeo – 8 requests ≈ 232kb 😲
</li>
</ul>
</div>
<div class="p-0 mx-auto mt-0 mb-16 leading-6 text-center text-gray-600 box-border max-w-xl text-xl font-normal leading-7">
<h2 class="p-0 mx-0 mt-0 mb-5 text-4xl font-bold xl:text-3xl box-border">
What does it do?
</h2>
<p class="">LazyframeAdvanced creates a responsive placeholder (and a placholder image from noembed.com or your custom one) for embedded content and only requests its content and scripts when the user interacts with it. </p>
<p class="mt-10">This decreases the page load and idle time. LazyframeAdvanced comes with brand-like themes for YouTube and Vimeo.</p>
<p>The thumnail placeholder is only loaded when the frame is in view, this saves additional bandwidth.
</p>
</div>
<section class="bg-blue-100 p-10 text-center">
<div class="container max-w-xl">
<h2 class="text-2xl font-bold leading-tight lg:text-3xl">Examples</h2>
<div class="mt-8">
<div class="w-full bg-white shadow-lg ">
<div class="lazyframe" data-src="https://www.youtube.com/watch?v=Urj7Uw4TodA" data-vendor="youtube">
</div>
<div class="px-4 py-8">
<h4 class="text-lg font-bold tracking-wide">YouTube video with thumbnail and title from noembed.com</h4>
</div>
</div>
<div class="w-full bg-white shadow-lg mt-10">
<div>
<div class="lazyframe" data-src="https://www.youtube.com/watch?v=Urj7Uw4TodA" data-vendor="youtube"
data-title="custom title for Dream Fiend - Lightyears (feat. September 87)" data-thumbnail="images/80placeholder.jpg">
</div>
<h4 class="px-4 py-8 text-lg font-bold tracking-wide">YouTube video with custom thumbnail image and
custom title</h4>
</div>
</div>
</div>
<div class="w-full bg-white shadow-lg mt-10">
<div>
<div class="lazyframe" data-src="https://vimeo.com/295809481" data-vendor="vimeo">
</div>
</div>
<h4 class="px-4 py-8 text-lg font-bold tracking-wide">Vimeo video with thumbnail and title from
noembed.com
</h4>
</div>
<div class="w-full bg-white shadow-lg mt-10">
<div>
<div class="lazyframe lazyframe--custom"
data-src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2458.7759635643474!2d7.670786116333327!3d51.95627678560363!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x47b9bb46d9040ea7%3A0xdb9a83d22fdc0e67!2sIm%20Drostebusch%2C%2048155%20M%C3%BCnster!5e0!3m2!1sde!2sde!4v1629887007748!5m2!1sde!2sde"
data-thumbnail="https://maps.googleapis.com/maps/api/js/StaticMapService.GetMapImage?1m2&1i8745931&2i5544812&2e1&3u16&4m2&1u528&2u528&5m5&1e0&5sde&6sde&10b1&12b1&client=google-maps-embed&token=102294"
data-title="Click me to load Google Maps">
</div>
<div class="px-4 py-8">
<h4 class="text-lg font-bold tracking-wide">Google maps iframe with static placeholder image
</h4>
</div>
</div>
</div>
<div class="w-full bg-white shadow-lg mt-10">
<div>
<div class="lazyframe lazyframe--custom"
data-src="https://www.surveymonkey.com/r/?sm=%2bd%2bdWobuoz7irMV%2fpzKPcJmrKosuGWSraJtIrFQ4wBQ%3d"
data-title="Click me, to load the iframe">
</div>
</div>
<h4 class="px-4 py-8 text-lg font-bold tracking-wide">Custom iframe with a Surveymonkey form
</h4>
</div>
<div class="w-full bg-white shadow-lg mt-10">
<h4 class="px-4 py-8 text-lg font-bold tracking-wide">This video from vimeo has the data-initinview parameter set to to true, so it autoplays, when it enters the viewport
</h4>
<div class="lazyframe" data-src="https://www.youtube.com/watch?v=Urj7Uw4TodA" data-vendor="youtube"
data-thumbnail="https://placekitten.com/500/281" data-initinview="true">
</div>
</div>
</div>
</section>
<!-- start cta -->
<section class="px-4 py-12 text-center bg-white lg:px-16 md:px-8 xl:px-24 xxl:px-40">
<div class="container">
<h2 class="text-2xl font-bold lg:text-3xl ">Need Help? Found a bug?</h2>
<p class="w-full mx-auto mt-6 text-base text-gray-700 lg:w-1/2">File an
<a href="https://github.com/jmartsch/lazyframeAdvanced/issues"
class="font-semibold text-blue-500">issue on GitHub</a>
</p>
</div>
</section>
<!-- end cta -->
</main>
<script type="module" src="src/init.js"></script>
</body>
</html>