-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
314 lines (279 loc) · 19.9 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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap-grid.min.css" integrity="sha256-D9AvR0EzkNZoWZVSvI3ch+uf/Z5izrIpcbsykVphwPU=" crossorigin="anonymous" />
<script type="application/ld+json">
{
"@context":"http://schema.org",
"@type":"Organization",
"@id":"https://ruu.lv/#organization",
"name":"Analog Photography | ruu.lv",
"description":"Life captured on a photographic film 📸",
"email":"[email protected]",
"url":"https://ruu.lv",
"foundingDate":"2019",
"logo":"https://ruu.lv/ui/img/logo/20191224-Poga-0001-Eyes-by-Janis-Rullis-1024x.jpg",
"image":[
{
"@type":"ImageObject",
"@id":"https://ruu.lv/#logo",
"url":"https://ruu.lv/ui/img/logo/20191224-Poga-0001-Eyes-by-Janis-Rullis-1024x.jpg",
"width":1024,
"height":696
}
],
"sameAs":[
"https://www.instagram.com/ruu.lv",
"https://www.youtube.com/channel/UCz7LPJ_cSOByxABXynOGBtw"
]
}
</script>
<!-- TODO: Make shorter and offline cabable. -->
<style>
img {
display: block;
margin: 0 auto;
max-width: 100%;
}
img.placeholder{
width: 100%;
min-height: 100px;
}
</style>
<link rel="shortcut icon" type="image/webp" href="https://ruu.lv/ui/img/logo/favicon-32.webp"/>
<meta charset="UTF-8">
<meta name="theme-color" content="#1d2523"/>
<link rel="manifest" href="https://ruu.lv/manifest.json" />
<meta name="viewport" content="width=device-width">
<title>Analog Photography | ruu.lv</title>
<meta name="title" content="Analog Photography | ruu.lv">
<meta name="description" content="Life captured on a photographic film 📸">
<link rel="canonical" href="https://ruu.lv" />
<!--
## SEO best practices
* https://www.hobo-web.co.uk/definitive-guide-to-using-important-meta-tags/
* https://moz.com/blog/the-ultimate-guide-to-seo-meta-tags
* Avoid keywords because they are being ignored or even raises a penalty.
* https://support.google.com/webmasters/answer/35769#quality_guidelines
* https://developers.google.com/web/fundamentals/design-and-ux/responsive#set-the-viewport
## Helpers
* https://support.google.com/webmasters/community
* https://www.thinkwithgoogle.com/advertising-channels/mobile-marketing/
## Tools
* Re-crawl https://support.google.com/webmasters/answer/6065812
* https://search.google.com/test/mobile-friendly
* https://developers.google.com/web/tools/lighthouse/#devtools
* https://developers.google.com/web/fundamentals/performance/speed-tools/
## Later
* Improve the page load under 1s. With delayed, offline and ofscreen images.
* Accessibility Developer Tools
-->
<!-- TODO: Improve SEO. Use Google trends, Lighthouse, insights, search console, tag manager,market muse, lsi graph, moz,semrush, rankings, webmaster's tools, Google Places or Bussiness, robots.txt, bing webmasters tools, sitemap, AdWords, Website Oprimizer, MozRank, HubSpot, Keyword graber-->
<!-- Display the search input in google results and look in alt. Like: Lode, Sigulda, Klaipeda. -->
<!-- Add a Youtube video with a slideshow and a reference to this page. -->
<!-- keywords: Janis, Rullis, Photography, photo, Foto, Fotogrāfs, analog, film, camera, bw, black-and-white, portreti, portraits, negatīvi, filmiņa, Fuji, Zenit -->
<!-- TODO: Add titles, norels for anchors. -->
<!-- TODO: Notify google about a mobile page? Make it display in the apps. Customized 404, AMP. -->
<!-- Image for a social network sharing. Useful https://metatags.io/ -->
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://ruu.lv/">
<meta property="og:title" content="Analog Photography | ruu.lv">
<meta property="og:description" content="Life captured on a photographic film 📸">
<meta property="og:image" content="https://ruu.lv/ui/img/logo/20191224-Poga-0001-Eyes-by-Janis-Rullis-1024x.jpg">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://ruu.lv/">
<meta property="twitter:title" content="Analog Photography | ruu.lv">
<meta property="twitter:description" content="Life captured on a photographic film 📸">
<meta property="twitter:image" content="https://ruu.lv/ui/img/logo/20191224-Poga-0001-Eyes-by-Janis-Rullis-1024x.jpg">
</head>
<body style="width: 100%; max-width: 1920px; margin: 0 auto;">
<header>
<!-- TODO: Add ALT and a title. -->
<a href="mailto:[email protected]" style="float: center;"><img src="https://ruu.lv/ui/img/email.png"></a>
</header>
<main style="background: lightgray; min-height: 1200px;">
<picture class="lazy">
<source type="image/webp" media="(min-width: 1610px)" data-srcset="https://r9.lv/i/20190921-Sigulda-0001-Alise-by-Janis-Rullis-1920x.webp, https://r9.lv/i/20190921-Sigulda-0001-Alise-by-Janis-Rullis-3840x.webp 2x">
<source type="image/webp" media="(min-width: 1376px)" data-srcset="https://r9.lv/i/20190921-Sigulda-0001-Alise-by-Janis-Rullis-1600x.webp, https://r9.lv/i/20190921-Sigulda-0001-Alise-by-Janis-Rullis-3200x.webp 2x">
<source type="image/webp" media="(min-width: 1034px)" data-srcset="https://r9.lv/i/20190921-Sigulda-0001-Alise-by-Janis-Rullis-1366x.webp, https://r9.lv/i/20190921-Sigulda-0001-Alise-by-Janis-Rullis-2732x.webp 2x">
<source type="image/webp" media="(min-width: 778px)" data-srcset="https://r9.lv/i/20190921-Sigulda-0001-Alise-by-Janis-Rullis-1024x.webp, https://r9.lv/i/20190921-Sigulda-0001-Alise-by-Janis-Rullis-2048x.webp 2x">
<source type="image/webp" media="(min-width: 460px)" data-srcset="https://r9.lv/i/20190921-Sigulda-0001-Alise-by-Janis-Rullis-768x.webp, https://r9.lv/i/20190921-Sigulda-0001-Alise-by-Janis-Rullis-1536x.webp 2x">
<source type="image/webp" media="(max-width: 459px)" data-srcset="https://r9.lv/i/20190921-Sigulda-0001-Alise-by-Janis-Rullis-450x.webp, https://r9.lv/i/20190921-Sigulda-0001-Alise-by-Janis-Rullis-900x.webp 2x">
<img class="placeholder" src="https://ruu.lv/ui/img/placeholder/20190921-Sigulda-0001-Alise-by-Janis-Rullis-700x-gray-placeholder.webp" alt="Sigulda | © 2019 Janis Rullis | ruu.lv" title="Sigulda | © 2019 Janis Rullis | ruu.lv" data-src="https://r9.lv/i/20190921-Sigulda-0001-Alise-by-Janis-Rullis-1600x.webp">
</picture>
<picture class="lazy" id="a2">
<source type="image/webp" media="(min-width: 1610px)" data-srcset="https://r9.lv/i/20190921-Sigulda-0003-Atis-by-Janis-Rullis-1920x.webp, https://r9.lv/i/20190921-Sigulda-0003-Atis-by-Janis-Rullis-3840x.webp 2x">
<source type="image/webp" media="(min-width: 1376px)" data-srcset="https://r9.lv/i/20190921-Sigulda-0003-Atis-by-Janis-Rullis-1600x.webp, https://r9.lv/i/20190921-Sigulda-0003-Atis-by-Janis-Rullis-3200x.webp 2x">
<source type="image/webp" media="(min-width: 1034px)" data-srcset="https://r9.lv/i/20190921-Sigulda-0003-Atis-by-Janis-Rullis-1366x.webp, https://r9.lv/i/20190921-Sigulda-0003-Atis-by-Janis-Rullis-2732x.webp 2x">
<source type="image/webp" media="(min-width: 778px)" data-srcset="https://r9.lv/i/20190921-Sigulda-0003-Atis-by-Janis-Rullis-1024x.webp, https://r9.lv/i/20190921-Sigulda-0003-Atis-by-Janis-Rullis-2048x.webp 2x">
<source type="image/webp" media="(min-width: 460px)" data-srcset="https://r9.lv/i/20190921-Sigulda-0003-Atis-by-Janis-Rullis-768x.webp, https://r9.lv/i/20190921-Sigulda-0003-Atis-by-Janis-Rullis-1536x.webp 2x">
<source type="image/webp" media="(max-width: 459px)" data-srcset="https://r9.lv/i/20190921-Sigulda-0003-Atis-by-Janis-Rullis-450x.webp, https://r9.lv/i/20190921-Sigulda-0003-Atis-by-Janis-Rullis-900x.webp 2x">
<img class="placeholder" src="https://ruu.lv/ui/img/placeholder/20190921-Sigulda-0003-Atis-by-Janis-Rullis-700x-gray-placeholder.webp" alt="Sigulda | © 2019 Janis Rullis | ruu.lv" title="Sigulda | © 2019 Janis Rullis | ruu.lv" data-src="https://r9.lv/i/20190921-Sigulda-0003-Atis-by-Janis-Rullis-1600x.webp">
</picture>
<picture class="lazy">
<source type="image/webp" media="(min-width: 1610px)" data-srcset="https://r9.lv/i/20190831-Lilaste-0001-Forest-by-Janis-Rullis-1920x.webp, https://r9.lv/i/20190831-Lilaste-0001-Forest-by-Janis-Rullis-3840x.webp 2x">
<source type="image/webp" media="(min-width: 1376px)" data-srcset="https://r9.lv/i/20190831-Lilaste-0001-Forest-by-Janis-Rullis-1600x.webp, https://r9.lv/i/20190831-Lilaste-0001-Forest-by-Janis-Rullis-3200x.webp 2x">
<source type="image/webp" media="(min-width: 1034px)" data-srcset="https://r9.lv/i/20190831-Lilaste-0001-Forest-by-Janis-Rullis-1366x.webp, https://r9.lv/i/20190831-Lilaste-0001-Forest-by-Janis-Rullis-2732x.webp 2x">
<source type="image/webp" media="(min-width: 778px)" data-srcset="https://r9.lv/i/20190831-Lilaste-0001-Forest-by-Janis-Rullis-1024x.webp, https://r9.lv/i/20190831-Lilaste-0001-Forest-by-Janis-Rullis-2048x.webp 2x">
<source type="image/webp" media="(min-width: 460px)" data-srcset="https://r9.lv/i/20190831-Lilaste-0001-Forest-by-Janis-Rullis-768x.webp, https://r9.lv/i/20190831-Lilaste-0001-Forest-by-Janis-Rullis-1536x.webp 2x">
<source type="image/webp" media="(max-width: 459px)" data-srcset="https://r9.lv/i/20190831-Lilaste-0001-Forest-by-Janis-Rullis-450x.webp, https://r9.lv/i/20190831-Lilaste-0001-Forest-by-Janis-Rullis-900x.webp 2x">
<img alt="Lilaste | © 2019 Janis Rullis | ruu.lv" title="Lilaste | © 2019 Janis Rullis | ruu.lv" src="https://ruu.lv/ui/img/placeholder/20190831-Lilaste-0001-Forest-by-Janis-Rullis-700x-gray-placeholder.webp" data-src="https://r9.lv/i/20190831-Lilaste-0001-Forest-by-Janis-Rullis-1600x.webp" class="placeholder">
</picture>
<picture class="lazy">
<source type="image/webp" media="(min-width: 1610px)" data-srcset="https://r9.lv/i/20190822-Oma-0001-Album-by-Janis-Rullis-1920x.webp, https://r9.lv/i/20190822-Oma-0001-Album-by-Janis-Rullis-3840x.webp 2x">
<source type="image/webp" media="(min-width: 1376px)" data-srcset="https://r9.lv/i/20190822-Oma-0001-Album-by-Janis-Rullis-1600x.webp, https://r9.lv/i/20190822-Oma-0001-Album-by-Janis-Rullis-3200x.webp 2x">
<source type="image/webp" media="(min-width: 1034px)" data-srcset="https://r9.lv/i/20190822-Oma-0001-Album-by-Janis-Rullis-1366x.webp, https://r9.lv/i/20190822-Oma-0001-Album-by-Janis-Rullis-2732x.webp 2x">
<source type="image/webp" media="(min-width: 778px)" data-srcset="https://r9.lv/i/20190822-Oma-0001-Album-by-Janis-Rullis-1024x.webp, https://r9.lv/i/20190822-Oma-0001-Album-by-Janis-Rullis-2048x.webp 2x">
<source type="image/webp" media="(min-width: 460px)" data-srcset="https://r9.lv/i/20190822-Oma-0001-Album-by-Janis-Rullis-768x.webp, https://r9.lv/i/20190822-Oma-0001-Album-by-Janis-Rullis-1536x.webp 2x">
<source type="image/webp" media="(max-width: 459px)" data-srcset="https://r9.lv/i/20190822-Oma-0001-Album-by-Janis-Rullis-450x.webp, https://r9.lv/i/20190822-Oma-0001-Album-by-Janis-Rullis-900x.webp 2x">
<img alt="Oma | © 2019 Janis Rullis | ruu.lv" title="Oma | © 2019 Janis Rullis | ruu.lv" src="https://ruu.lv/ui/img/placeholder/20190822-Oma-0001-Album-by-Janis-Rullis-700x-gray-placeholder.webp" data-src="https://r9.lv/i/20190822-Oma-0001-Album-by-Janis-Rullis-1600x.webp" class="placeholder">
</picture>
<picture class="lazy">
<source type="image/webp" media="(min-width: 1610px)" data-srcset="https://r9.lv/i/20190616-Belarus-Ukraine-0001-Sinevir-by-Janis-Rullis-1920x.webp, https://r9.lv/i/20190616-Belarus-Ukraine-0001-Sinevir-by-Janis-Rullis-3840x.webp 2x">
<source type="image/webp" media="(min-width: 1376px)" data-srcset="https://r9.lv/i/20190616-Belarus-Ukraine-0001-Sinevir-by-Janis-Rullis-1600x.webp, https://r9.lv/i/20190616-Belarus-Ukraine-0001-Sinevir-by-Janis-Rullis-3200x.webp 2x">
<source type="image/webp" media="(min-width: 1034px)" data-srcset="https://r9.lv/i/20190616-Belarus-Ukraine-0001-Sinevir-by-Janis-Rullis-1366x.webp, https://r9.lv/i/20190616-Belarus-Ukraine-0001-Sinevir-by-Janis-Rullis-2732x.webp 2x">
<source type="image/webp" media="(min-width: 778px)" data-srcset="https://r9.lv/i/20190616-Belarus-Ukraine-0001-Sinevir-by-Janis-Rullis-1024x.webp, https://r9.lv/i/20190616-Belarus-Ukraine-0001-Sinevir-by-Janis-Rullis-2048x.webp 2x">
<source type="image/webp" media="(min-width: 460px)" data-srcset="https://r9.lv/i/20190616-Belarus-Ukraine-0001-Sinevir-by-Janis-Rullis-768x.webp, https://r9.lv/i/20190616-Belarus-Ukraine-0001-Sinevir-by-Janis-Rullis-1536x.webp 2x">
<source type="image/webp" media="(max-width: 459px)" data-srcset="https://r9.lv/i/20190616-Belarus-Ukraine-0001-Sinevir-by-Janis-Rullis-450x.webp, https://r9.lv/i/20190616-Belarus-Ukraine-0001-Sinevir-by-Janis-Rullis-900x.webp 2x">
<img src="https://ruu.lv/ui/img/placeholder/20190616-Belarus-Ukraine-0001-Sinevir-by-Janis-Rullis-700x-gray-placeholder.webp" alt="Belarus-Ukraine | © 2019 Janis Rullis | ruu.lv" title="Belarus-Ukraine | © 2019 Janis Rullis | ruu.lv" data-src="https://r9.lv/i/20190616-Belarus-Ukraine-0001-Sinevir-by-Janis-Rullis-1600x.webp" class="placeholder">
</picture>
<picture class="lazy">
<source type="image/webp" media="(min-width: 1610px)" data-srcset="https://r9.lv/i/20190820-Kurzeme-Klaipeda-0002-Pavilosta-by-Janis-Rullis-1920x.webp, https://r9.lv/i/20190820-Kurzeme-Klaipeda-0002-Pavilosta-by-Janis-Rullis-3840x.webp 2x">
<source type="image/webp" media="(min-width: 1376px)" data-srcset="https://r9.lv/i/20190820-Kurzeme-Klaipeda-0002-Pavilosta-by-Janis-Rullis-1600x.webp, https://r9.lv/i/20190820-Kurzeme-Klaipeda-0002-Pavilosta-by-Janis-Rullis-3200x.webp 2x">
<source type="image/webp" media="(min-width: 1034px)" data-srcset="https://r9.lv/i/20190820-Kurzeme-Klaipeda-0002-Pavilosta-by-Janis-Rullis-1366x.webp, https://r9.lv/i/20190820-Kurzeme-Klaipeda-0002-Pavilosta-by-Janis-Rullis-2732x.webp 2x">
<source type="image/webp" media="(min-width: 778px)" data-srcset="https://r9.lv/i/20190820-Kurzeme-Klaipeda-0002-Pavilosta-by-Janis-Rullis-1024x.webp, https://r9.lv/i/20190820-Kurzeme-Klaipeda-0002-Pavilosta-by-Janis-Rullis-2048x.webp 2x">
<source type="image/webp" media="(min-width: 460px)" data-srcset="https://r9.lv/i/20190820-Kurzeme-Klaipeda-0002-Pavilosta-by-Janis-Rullis-768x.webp, https://r9.lv/i/20190820-Kurzeme-Klaipeda-0002-Pavilosta-by-Janis-Rullis-1536x.webp 2x">
<source type="image/webp" media="(max-width: 459px)" data-srcset="https://r9.lv/i/20190820-Kurzeme-Klaipeda-0002-Pavilosta-by-Janis-Rullis-450x.webp, https://r9.lv/i/20190820-Kurzeme-Klaipeda-0002-Pavilosta-by-Janis-Rullis-900x.webp 2x">
<img class="placeholder" src="https://ruu.lv/ui/img/placeholder/20190820-Kurzeme-Klaipeda-0002-Pavilosta-by-Janis-Rullis-700x-gray-placeholder.webp" alt="Kurzeme-Klaipeda | © 2019 Janis Rullis | ruu.lv" title="Kurzeme-Klaipeda | © 2019 Janis Rullis | ruu.lv" data-src="https://r9.lv/i/20190820-Kurzeme-Klaipeda-0002-Pavilosta-by-Janis-Rullis-1600x.webp">
</picture>
</main>
<footer>
<div class="container-fluid p-0">
<div class="row no-gutters">
<div class="col-3">
<a style="float: left;" href="/video" ><img src="https://ruu.lv/ui/img/Feather-photo-and-video-video.svg?v=2"></a>
</div>
<div class="col-6">
<a href="/2019-9.html"><img src="https://ruu.lv/ui/img/Ic_arrow_forward_48px.svg"></a>
</div>
<div class="col-3">
<a style="float: right;" href="/news"><img src="https://ruu.lv/ui/img/PICOL_icon_News.svg?v=2"></a>
</div>
</div>
</div>
</footer>
<script>
var elem = document.documentElement;
var is_fullscreen=false;
var is_webp_supported=false;
function detectBrowser(){
var sBrowser, sUsrAg = navigator.userAgent;
if (sUsrAg.indexOf("Firefox") > -1) {
sBrowser = "Mozilla Firefox";
// "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0"
} else if (sUsrAg.indexOf("SamsungBrowser") > -1) {
sBrowser = "Samsung Internet";
// "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-G955F Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36
} else if (sUsrAg.indexOf("Opera") > -1 || sUsrAg.indexOf("OPR") > -1) {
sBrowser = "Opera";
// "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 OPR/57.0.3098.106"
} else if (sUsrAg.indexOf("Trident") > -1) {
sBrowser = "Microsoft Internet Explorer";
// "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; Zoom 3.6.0; wbx 1.0.0; rv:11.0) like Gecko"
} else if (sUsrAg.indexOf("Edge") > -1) {
sBrowser = "Microsoft Edge";
// "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299"
} else if (sUsrAg.indexOf("Chrome") > -1) {
sBrowser = "Google Chrome or Chromium";
// "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/66.0.3359.181 Chrome/66.0.3359.181 Safari/537.36"
} else if (sUsrAg.indexOf("Safari") > -1) {
sBrowser = "safari";
// "Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1 980x1306"
} else {
sBrowser = "unknown";
}
// console.log(sBrowser)
return sBrowser;
}
function isWebpSupported(){
return detectBrowser() !== 'safari';
}
function toggleFullscreen(){
if(is_fullscreen){
closeFullscreen();
}else{
openFullscreen();
}
}
// TODO: Check if can remove any of these checks.
function openFullscreen() {
is_fullscreen = true;
document.getElementById('fullscreen-btn').style.background = "#d3d3d366";
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.mozRequestFullScreen) { /* Firefox */
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) { /* Chrome, Safari & Opera */
elem.webkitRequestFullscreen();
} else if (elem.msRequestFullscreen) { /* IE/Edge */
elem.msRequestFullscreen();
}
}
// TODO: Check if can remove any of these checks.
function closeFullscreen() {
is_fullscreen = false;
document.getElementById('fullscreen-btn').style.background = "initial";
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
}
// TODO: Make shorter - convert to ES6. Keep the readability.
// Activate an image by setting it's target.
function loadLazyPic(lazyPic){
var sources, source, img, src;
// In `source` element.
sources = lazyPic.querySelectorAll("source")
var srcCnt = sources.length;
for(var j = 0; j < srcCnt; j++){
source = sources[j];
// Fall back to JPG.
if(!is_webp_supported){
source.dataset.srcset = source.dataset.srcset.replace('webp', 'jpg');
source.type = source.type.replace('webp', 'jpg');
}
source.srcset = source.dataset.srcset;
}
// In `img` element.
img = lazyPic.querySelector("img");
src = img.getAttribute('data-src');
// Fall back to JPG.
if(!is_webp_supported){
src = src.replace('webp', 'jpg');
}
img.setAttribute('src', src);
// Mark the image as processed;
lazyPic.classList.remove("lazy");
}
// Activate all images than needs to be loaded with a delay.
function loadLazyPics(){
var lazyPics = document.querySelectorAll(".lazy")
for(var i = 0; i < lazyPics.length; i++){
// Execture this every 0,05s. Note, the `* i`, otherwise everything is executed at the same time.
setTimeout(loadLazyPic, 50 * i, lazyPics[i]);
}
}
document.addEventListener("DOMContentLoaded", function() {
is_webp_supported = isWebpSupported();
loadLazyPics();
});
</script>
</body>
</html>