-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·474 lines (420 loc) · 25 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
<!DOCTYPE html>
<html lang="pl-PL"
:lang="lang == 'en' ? 'en' : 'pl-PL'"
>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title
x-text="lang == 'en' ? 'Robert Wierzchowski Programmer / Web Developer Revert' : 'Robert Wierzchowski Programista / Web Developer Revert'"
>Robert Wierzchowski Programista / Web Developer Revert</title>
<meta name="description"
content="Witaj, mam na imię Robert, pochodzę z Nowogardu. Mieszkam w Poznaniu gdzie programuję i tworzę WWW. Dowiedzieć się czegoś więcej o mnie."
:content="lang == 'en' ? 'Welcome, my name is Robert, I am from Nowogard. I live in Poznan where I program and create WWW. Find out more about me.': 'Witaj, mam na imię Robert, pochodzę z Nowogardu. Mieszkam w Poznaniu gdzie programuję i tworzę WWW. Dowiedzieć się czegoś więcej o mnie.'"
>
<meta name="author" content="revert@revert.pl">
<link rel="canonical" href="https://revert.pl">
<meta property="og:title" content="Revert.pl Robert Wierzchowski">
<meta property="og:description" content="Web Developer / Front-end / Programmer">
<meta property="og:type" content="website">
<meta property="og:url" content="https://revert.pl">
<meta property="og:image" content="https://revert.pl/media/rw-profile-2x.jpg">
<meta name="twitter:title" content="Revert.pl Robert Wierzchowski">
<meta name="twitter:description" content="Web Developer / Front-end / Programmer">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://revert.pl/media/rw-profile-2x.jpg">
<meta name="theme-color" content="#33D3EC">
<meta name="msapplication-TileColor" content="#33D3EC">
<link rel="manifest" href="./site.webmanifest">
<link rel="apple-touch-icon" sizes="180x180" href="./favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./favicon/favicon-16x16.png">
<link rel="icon" type="image/x-icon" href="./favicon/favicon.ico">
<link rel="preload" href="https://use.fontawesome.com/releases/v5.13.0/css/all.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.0/css/all.css"></noscript>
<style>
html {
height: 100%;
}
.text-shadow {
text-shadow: 0 0.2rem 0.4rem rgba(0, 0, 0, 0.25);
}
.text-shadow-md {
text-shadow: 0 0.4rem 0.8rem rgba(0, 0, 0, 0.50), 0 0.2rem 0.4rem rgba(0, 0, 0, 0.50);
}
.text-shadow-lg {
text-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.75), 0 0.5rem 1.5rem rgba(0, 0, 0, 0.75);
}
.text-shadow-none {
text-shadow: none;
}
.cursor-blink {
animation: blink 1s infinite step-end;
}
@keyframes blink {
50% {
opacity: 0;
}
}
[x-cloak] {
display: none;
}
</style>
<script src="https://cdn.tailwindcss.com"></script>
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
<script defer src="https://unpkg.com/popper.js@1/dist/umd/popper.min.js"></script>
<script defer src="https://unpkg.com/tippy.js@4"></script>
<script defer src="https://storage.googleapis.com/workbox-cdn/releases/6.4.1/workbox-sw.js"></script>
</head>
<body class="font-sans antialiased min-h-full h-auto flex items-center leading-normal tracking-wider bg-softblue"
:class="theme == 'dark' ? 'text-gray-200' : 'text-gray-900'"
x-data="{
bg: '',
lang: '',
theme: '',
}"
x-init="init"
>
<div class="max-w-4xl xl:max-w-5xl flex items-center min-h-full h-auto lg:h-screen flex-wrap mx-auto mt-36 mb-8 lg:my-0">
<!-- Background video or image -->
<div id="bg-container" class="opacity-0 transition-opacity ease-in-out delay-500 duration-500 fixed z-0 top-0 left-0 right-0 bottom-0 w-full h-full min-h-full overflow-hidden bg-center bg-cover bg-scroll lg:bg-fixed"
data-bg-img="./media/rw-bg.jpg" data-bg-img-2x="./media/rw-bg-2x.jpg"
>
<video id="video"
class="opacity-0 transition-opacity ease-in-out delay-500 duration-700 absolute top-0 left-0 min-w-full min-h-full object-cover"
:class="bg == 'vid' ? 'opacity-100' : 'opacity-0'"
muted loop playsInline webkit-playsinline preload="none"
data-src="./media/video.mov" data-src-2x="./media/video-2x.mov" data-type="video/mp4" poster="./media/rw-bg.jpg"
title="Kolorowy jesienny las widziany z lotu ptaka" aria-label="Kolorowy jesienny las widziany z lotu ptaka"
:title="lang == 'en' ? 'Colorful autumn forest seen from a bird POV' : 'Kolorowy jesienny las widziany z lotu ptaka'"
:aria-label="lang == 'en' ? 'Colorful autumn forest seen from a bird POV' : 'Kolorowy jesienny las widziany z lotu ptaka'"
></video>
<div role="figure" id="overlay" class="absolute top-0 left-0 w-full h-full z-1 bg-black"
:class="theme == 'dark' ? 'bg-opacity-50' : 'bg-opacity-25'"
></div>
</div>
<!-- / Background video or image -->
<!-- Main Col -->
<main class="w-full h-auto lg:w-2/5 mx-4 lg:mx-0">
<!-- Profile Desc -->
<div id="profile" class="relative z-10 rounded-lg lg:rounded-l-lg lg:rounded-r-none shadow-xl bg-opacity-75 transition duration-300 py-4 px-6 md:px-10 lg:px-6 text-center lg:text-left"
:class="theme == 'dark' ? 'bg-gray-900' : 'bg-white'"
>
<!-- Image for mobile view -->
<div class="block lg:hidden relative z-20 rounded-full shadow-xl mx-auto -mt-24 h-40 w-40 bg-cover bg-center transform transition-transform duration-300 hover:scale-105 focus:scale-105 focus:outline-none"
data-bg-img="./media/rw-profile.jpg"
role="img"
aria-label="Robert Wierzchowski uśmiechnięty na zdjęciu plenerowym"
:aria-label="lang == 'en' ? 'Robert Wierzchowski smiling on outdoor photo' : 'Robert Wierzchowski uśmiechnięty na zdjęciu plenerowym'"
>
<a class="block w-full h-full" href="https://vi7.revert.pl"
title="Vi7 Revert.pl Strona Projektu"
aria-label="Vi7 Revert.pl Strona Projektu"
:title="lang == 'en' ? 'Vi7 Revert.pl Project Website' : 'Vi7 Revert.pl Strona Projektu'"
:aria-label="lang == 'en' ? 'Vi7 Revert.pl Project Website' : 'Vi7 Revert.pl Strona Projektu'"
></a>
</div>
<!-- / Image for mobile view -->
<!-- Main title -->
<h1 class="text-2xl text-center font-bold pt-4 lg:pt-0">Robert Wierzchowski</h1>
<!-- / Main title -->
<!-- Underline -->
<div role="figure" class="mx-auto w-4/5 pt-2 mb-1 border-b-2 border-cyan-400"></div>
<!-- / Underline -->
<!-- Description -->
<div x-show="lang == 'pl'" x-cloak class="pt-2 md:pt-4 text-sm text-center">
<!-- Terminal PL -->
<h2 class="inline-flex mb-2">
<span id="terminal-pl">Cześć</span>
<span class="cursor-blink inline-block w-2.5 h-5 bg-opacity-75"
:class="theme == 'dark' ? 'bg-white' : 'bg-black'"
></span>
</h2>
<!-- / Terminal PL -->
<p class="mb-2">Mam na imię <strong>Robert</strong>, pochodzę z <strong>Nowogardu</strong>. Mieszkam w <strong>Poznaniu</strong> gdzie <strong>programuję</strong> i <strong class="whitespace-nowrap">tworzę WWW</strong>.</p>
<p class="mb-2">Pasjonuje mnie <strong>Web</strong>, <strong>muzyka</strong> i <strong>pozytywna psychologia</strong>. Lubię <strong>proste i skuteczne rozwiązania</strong>, <strong>dobre wzorce</strong> oraz <strong>zrównoważoną pracę</strong>.</p>
<p class="mb-2">W wolnym czasie korzystam z przeróżnych form <strong>aktywności rekreacyjnych w ruchu</strong>.</p>
</div>
<div x-show="lang == 'en'" x-cloak class="pt-2 md:pt-4 text-sm text-center">
<!-- Terminal EN -->
<h2 class="inline-flex mb-2">
<span id="terminal-en">Hi</span>
<span class="cursor-blink inline-block w-2.5 h-5 bg-opacity-75"
:class="theme == 'dark' ? 'bg-white' : 'bg-black'"
></span>
</h2>
<!-- / Terminal EN -->
<p class="mb-2">My name is <strong>Robert</strong>, I am from <strong>Nowogard</strong>.
I live in <strong>Poznan</strong> where I <strong>program</strong> and <strong class="whitespace-nowrap">create WWW</strong>.</p>
<p class="mb-2">I am passionate about <strong>the Web</strong>, <strong>music</strong>, and <strong>positive psychology</strong>.
I like <strong>simple yet effective solutions</strong>, <strong>good patterns</strong> and <strong>balanced work</strong>.</p>
<p class="mb-2">In my free time, I enjoy various forms of <strong>recreational activities on the move</strong>.</p>
</div>
<!-- / Description -->
<!-- CTA -->
<div class="pt-2 pb-2 text-center">
<a class="cta-btn link inline-block min-w-[50%] md:min-w-[33%] md:w-1/3 lg:w-3/4 bg-gradient-to-br from-cyan-500 to-cyan-300 hover:from-cyan-300 hover:to-cyan-500 focus:ring-2 active:ring-0 focus:ring-cyan-200 dark:focus:ring-cyan-800 border-b-4 border-cyan-800 hover:border-cyan-700 focus:border-cyan-700 active:border-b-0 active:mb-1 transform transition-all duration-500 hover:scale-105 focus:scale-105 focus:outline-none font-bold uppercase text-shadow active:text-shadow-lg py-2 px-4 rounded-lg" href="https://vi7.revert.pl" data-tippy-content="Vi7.Revert.PL"
:class="theme == 'dark' ? 'text-white' : 'text-gray-900'"
>
<span x-show="lang == 'pl'" x-cloak>Zobacz więcej</span>
<span x-show="lang == 'en'" x-cloak>View more</span>
</a>
</div>
<!-- / CTA -->
<!-- Social icons -->
<div class="mt-2 pb-2 lg:pb-0 w-4/5 lg:w-full mx-auto flex flex-wrap items-center justify-between">
<a class="link transform transition-transform duration-300 text-gray-200 hover:text-cyan-400 hover:scale-125 focus:scale-125 focus:outline-none" href="tel:+48503529991" data-tippy-content="Tel." aria-label="Tel."
:class="theme == 'dark' ? 'text-white' : 'text-gray-900'"
>
<i role="img" class="fas fa-mobile-alt text-2xl"
aria-label="telefon ikona"
:aria-label="lang == 'en' ? 'mobile icon' : 'telefon ikona'"
></i>
</a>
<a class="link transform transition-transform duration-300 text-gray-200 hover:text-cyan-400 hover:scale-125 focus:scale-125 focus:outline-none" href="mailto:revert@revert.pl" data-tippy-content="Email" aria-label="Email"
:class="theme == 'dark' ? 'text-white' : 'text-gray-900'"
>
<i role="img" class="far fa-envelope text-2xl"
aria-label="koperta ikona"
:aria-label="lang == 'en' ? 'envelope icon' : 'koperta ikona'"
></i>
</a>
<a class="link transform transition-transform duration-300 text-gray-200 hover:text-cyan-400 hover:scale-125 focus:scale-125 focus:outline-none" href="https://github.com/riwert" data-tippy-content="GitHub" aria-label="GitHub" target="_blank" rel="noopener"
:class="theme == 'dark' ? 'text-white' : 'text-gray-900'"
>
<i role="img" class="fab fa-github text-2xl"
aria-label="github ikona"
:aria-label="lang == 'en' ? 'github icon' : 'github ikona'"
></i>
</a>
<a class="link transform transition-transform duration-300 text-gray-200 hover:text-cyan-400 hover:scale-125 focus:scale-125 focus:outline-none" href="https://www.facebook.com/riwert" data-tippy-content="Facebook" aria-label="Facebook" target="_blank" rel="noopener"
:class="theme == 'dark' ? 'text-white' : 'text-gray-900'"
>
<i role="img" class="fab fa-facebook text-2xl"
aria-label="facebook ikona"
:aria-label="lang == 'en' ? 'facebook icon' : 'facebook ikona'"
></i>
</a>
<!-- a class="link transform transition-transform duration-300 text-gray-200 hover:text-cyan-400 hover:scale-125 focus:scale-125 focus:outline-none" href="https://www.youtube.com/@RiwertV" data-tippy-content="YouTube" aria-label="YouTube" target="_blank" rel="noopener"
:class="theme == 'dark' ? 'text-white' : 'text-gray-900'"
>
<i role="img" aria-label="youtube icon" class="fab fa-youtube text-2xl"></i>
</a -->
<a class="link transform transition-transform duration-300 text-gray-200 hover:text-cyan-400 hover:scale-125 focus:scale-125 focus:outline-none" href="https://www.linkedin.com/in/robert-wierzchowski/" data-tippy-content="LinkedIn" aria-label="LinkedIn" target="_blank" rel="noopener"
:class="theme == 'dark' ? 'text-white' : 'text-gray-900'"
>
<i role="img" class="fab fa-linkedin text-2xl"
aria-label="linkedin ikona"
:aria-label="lang == 'en' ? 'linkedin icon' : 'linkedin ikona'"
></i>
</a>
</div>
<!-- / Social icons -->
</div>
<!-- / Profile Desc -->
</main>
<!-- / Main Col -->
<!-- Desktop Img Col -->
<div class="relative z-20 w-full lg:w-3/5 xl:w-3/6">
<!-- Big profile image for side bar (desktop) -->
<a href="https://vi7.revert.pl" data-tippy-content="Robert Wierzchowski - Vi7 Revert.pl" aria-label="Robert Wierzchowski - Vi7 Revert.pl" class="link block">
<picture class="block rounded-none lg:rounded-lg overflow-hidden shadow-2xl hidden lg:block transform transition-transform duration-300 hover:opacity-100 hover:scale-105 focus:scale-105"
:class="theme == 'dark' ? 'opacity-75' : 'opacity-85'"
>
<source media="(max-width: 1279.99px)" srcset="./media/rw-profile.jpg">
<source media="(min-width: 1280px)" srcset="./media/rw-profile-2x.jpg">
<img src="./media/rw-profile-2x.jpg" width="614" height="614"
alt="Robert Wierzchowski uśmiechnięty na zdjęciu plenerowym"
:alt="lang == 'en' ? 'Robert Wierzchowski smiling on outdoor photo' : 'Robert Wierzchowski uśmiechnięty na zdjęciu plenerowym'"
>
</picture>
</a>
<!--/ Big profile image for side bar (desktop) -->
</div>
<!--/ Desktop Img Col -->
<!-- Pin to top right corner -->
<div class="absolute top-0 right-0 w-full md:w-auto">
<div class="max-w-4xl mt-3 md:mt-4 mx-4 md:ml-auto lg:mr-4 h-12 flex justify-between lg:justify-end items-center rounded-lg shadow-xl bg-opacity-75 transition duration-300 text-center lg:text-left"
:class="theme == 'dark' ? 'bg-gray-900' : 'bg-white'"
>
<!-- Lang Toggle -->
<div class="flex items-center m-2 md:m-4">
<label for="lang-toggle" class="mr-2"><i role="img" aria-label="Ikona języka PL" :aria-label="lang == 'en' ? 'Icon language PL' : 'Ikona języka PL'" class="fas fa-flag-checkered"></i></label>
<button id="lang-toggle" @click="toggleLang" class="toggle-switch bg-opacity-65 link relative inline-flex flex-shrink-0 h-6 w-12 border-2 rounded-full cursor-pointer transition-colors ease-in-out duration-200"
data-tippy-content="Polski / Angielski" :data-tippy-content="lang == 'en' ? 'Polish / English' : 'Polski / Angielski'"
aria-label="Polski / Angielski" :aria-label="lang == 'en' ? 'Polish / English' : 'Polski / Angielski'"
:class="theme == 'dark' ? 'bg-white border-white' : 'bg-gray-900 border-gray-900'"
>
<span class="sr-only" x-text="lang == 'en' ? 'Toggle language' : 'Przełącz język'">Przełącz język</span>
<span aria-hidden="true" class="pointer-events-none inline-block h-5 w-5 rounded-full shadow transform ring-0 transition ease-in-out duration-200"
:class="{ 'translate-x-6': lang == 'en', 'bg-gray-900': theme == 'dark', 'bg-white': theme == 'light' }"
></span>
</button>
<label for="lang-toggle" class="ml-2"><i role="img" aria-label="Ikona języka EN" :aria-label="lang == 'en' ? 'Icon language EN' : 'Ikona języka EN'" class="fas fa-flag-usa"></i></label>
</div>
<!-- / Lang Toggle -->
<!-- Bg Toggle -->
<div class="flex items-center m-2 md:m-4">
<label for="theme-bg" class="mr-2"><i role="img" aria-label="wideo ikona" :aria-label="lang == 'en' ? 'video icon' : 'wideo ikona'" class="fas fa-film"></i></label>
<button id="theme-bg" @click="toggleBg" class="toggle-switch bg-opacity-65 link relative inline-flex flex-shrink-0 h-6 w-12 border-2 rounded-full cursor-pointer transition-colors ease-in-out duration-200"
data-tippy-content="Wideo / Zdjęcie" :data-tippy-content="lang == 'en' ? 'Video / Picture' : 'Wideo / Zdjęcie'"
aria-label="Wideo / Zdjęcie" :aria-label="lang == 'en' ? 'Video / Picture' : 'Wideo / Zdjęcie'"
:class="theme == 'dark' ? 'bg-white border-white' : 'bg-gray-900 border-gray-900'"
>
<span class="sr-only" x-text="lang == 'en' ? 'Toggle background' : 'Przełącz tło'">Przełącz tło</span>
<span aria-hidden="true" class="pointer-events-none inline-block h-5 w-5 rounded-full shadow transform ring-0 transition ease-in-out duration-200"
:class="{ 'translate-x-6': bg === 'img', 'bg-gray-900': theme == 'dark', 'bg-white': theme == 'light' }"
></span>
</button>
<label for="theme-bg" class="ml-2"><i role="img" aria-label="zdjęcie ikona" :aria-label="lang == 'en' ? 'picture icon' : 'zdjęcie ikona'" class="fas fa-image"></i></label>
</div>
<!-- / Bg Toggle -->
<!-- Theme Toggle -->
<div class="flex items-center m-2">
<label for="theme-toggle" class="mr-2"><i role="img" aria-label="słońce ikona" :aria-label="lang == 'en' ? 'sun icon' : 'słońce ikona'" class="fas fa-sun"></i></label>
<button id="theme-toggle" @click="toggleTheme" class="toggle-switch bg-opacity-65 link relative inline-flex flex-shrink-0 h-6 w-12 border-2 rounded-full cursor-pointer transition-colors ease-in-out duration-200"
data-tippy-content="Dzień / Noc" :data-tippy-content="lang == 'en' ? 'Day / Night' : 'Dzień / Noc'"
aria-label="Dzień / Noc" :aria-label="lang == 'en' ? 'Day / Night' : 'Dzień / Noc'"
:class="theme == 'dark' ? 'bg-white border-white' : 'bg-gray-900 border-gray-900'"
>
<span class="sr-only" x-text="lang == 'en' ? 'Toggle theme mode' : 'Przełącz jasność motywu'">Przełącz jasność motywu</span>
<span aria-hidden="true" class="pointer-events-none inline-block h-5 w-5 rounded-full shadow transform ring-0 transition ease-in-out duration-200"
:class="{ 'translate-x-6': theme === 'dark', 'bg-gray-900': theme == 'dark', 'bg-white': theme == 'light' }"
></span>
</button>
<label for="theme-toggle" class="ml-2"><i role="img" aria-label="księżyc ikona" :aria-label="lang == 'en' ? 'moon icon' : 'księżyc ikona'" class="far fa-moon"></i></label>
</div>
<!-- / Theme Toggle -->
</div>
</div>
<!-- / Pin to top right corner -->
</div>
<script>
// On load actions
window.onload = function() {
// Init tooltips
tippy('.link', {
placement: 'bottom',
})
}
// Tailwind config customization
tailwind.config = {
theme: {
extend: {
colors: {
softred: '#D95252',
softblue: '#33D3EC',
}
}
}
}
// Defer backgrounds on load
function deferBackgrounds() {
var vp2x = 576
var vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0)
var backgrounds = document.querySelectorAll('[data-bg-img]')
for (var i = 0, len = backgrounds.length; i < len; i++) {
if (backgrounds[i].getAttribute('data-bg-img-2x') && vw >= vp2x) {
backgrounds[i].style.backgroundImage = 'url('+backgrounds[i].getAttribute('data-bg-img-2x')+')'
} else if (backgrounds[i].getAttribute('data-bg-img')) {
backgrounds[i].style.backgroundImage = 'url('+backgrounds[i].getAttribute('data-bg-img')+')'
}
backgrounds[i].classList.remove('opacity-0')
}
}
// Defer sources on load
function deferSources() {
var vp2x = 576
var vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0)
var sources = document.querySelectorAll('[data-src]')
for (var i = 0, len = sources.length; i < len; i++) {
if (sources[i].getAttribute('data-src')) {
if (sources[i].tagName.toLowerCase() == 'video') {
var source = document.createElement('source')
if (sources[i].getAttribute('data-src-2x') && vw >= vp2x) {
source.src = sources[i].getAttribute('data-src-2x')
sources[i].setAttribute('width', 1920)
sources[i].setAttribute('height', 1080)
} else if (sources[i].getAttribute('data-src')) {
source.src = sources[i].getAttribute('data-src')
sources[i].setAttribute('width', 960)
sources[i].setAttribute('height', 540)
}
if (sources[i].getAttribute('data-type')) {
source.type = sources[i].getAttribute('data-type')
}
sources[i].innerHTML = ''
sources[i].appendChild(source)
sources[i].load()
sources[i].play()
} else {
sources[i].setAttribute('src', sources[i].getAttribute('data-src'))
}
}
}
}
var welcomesEn = ['Hi!', 'Hey!', 'Hello!', 'Welcome!', 'Good day!', 'Good evening!']
var welcomesPl = ['Cześć!', 'Hej!', 'Siemanko!', 'Witaj!', 'Dzień dobry!', 'Dobry wieczór!']
var currentIndexEn = 0
var currentIndexPl = 0
function typeWords(words, currentIndex, selector) {
var index = 0
var terminal = document.getElementById(selector)
terminal.innerHTML = ''
var interval = setInterval(function () {
terminal.textContent += words[currentIndex][index]
index++
if (index === words[currentIndex].length) {
clearInterval(interval)
setTimeout(function () {
terminal.textContent += ' '
currentIndex = (currentIndex + 1) % words.length
typeWords(words, currentIndex, selector)
}, 1500) // 1,5s
}
}, 500)
}
// AlpineJS
function init() {
// Defaults
this.bg = localStorage.getItem('bg') == 'img' ? 'img' : 'vid'
this.lang = localStorage.getItem('lang') == 'en' ? 'en' : 'pl'
this.theme = localStorage.getItem('theme') == 'dark' ? 'dark' : 'light'
// Run async
setTimeout(function () {
// Run defer functions
deferBackgrounds()
deferSources()
// Start typing words
typeWords(welcomesPl, currentIndexPl, 'terminal-pl')
typeWords(welcomesEn, currentIndexEn, 'terminal-en')
}, 1)
}
function changeLang() {
localStorage.setItem('lang', this.lang)
}
function toggleBg() {
var bg = this.bg === 'vid' ? 'img' : 'vid'
localStorage.setItem('bg', bg)
this.bg = bg
}
function toggleLang() {
var lang = this.lang === 'pl' ? 'en' : 'pl'
localStorage.setItem('lang', lang)
this.lang = lang
}
function toggleTheme() {
var theme = this.theme === 'light' ? 'dark' : 'light'
localStorage.setItem('theme', theme)
this.theme = theme
}
// Register the SW from the Workbox CDN
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('./service-worker.js')
})
}
</script>
</body>
</html>