-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
100 lines (90 loc) · 5.69 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
<!--
___ _ __ __
|_ _| /_\ | \/ |
| | / _ \| |\/| |
|___|_ _ _____ __/_/ \_\_| |_|
| __| /_\ / __\ \ / /
| _| / _ \\__ \\ V /
|___/_/ \_\___/_|_|_
|_ _/ _ \
| || (_) |
|_| \___/___ _ _ ___
| __|_ _| \| | \
| _| | || .` | |) |
|_| |___|_|\_|___/
-->
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Jan Faracik</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="app-block">
<h1>Jan Faracik</h1>
<div class="byline">
<div>
<span>
<svg xmlns="http://www.w3.org/2000/svg" class="ionicon" viewBox="0 0 512 512"><path fill="currentColor" d="M336.76 161l-186.53 82.35c-10.47 4.8-6.95 20.67 4.57 20.67H244a4 4 0 014 4v89.18c0 11.52 16 15 20.78 4.56L351 175.24A10.73 10.73 0 00336.76 161z"/><path d="M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192 192-86 192-192z" fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="32"/></svg>
</span>
<span>London</span>
</div>
<div>
<span id="weather"></span>
<span id="weather-detail"></span>
</div>
</div>
<p>Developer. Passion for user experience and design. I enjoy running, music, and the outdoors.</p>
<p>I'm currently leading the ongoing redesign of <a href="https://jenkins.io">Jenkins</a>. Catch me <span class="virtually">(virtually)</span> at <a href="https://www.devopsworld.com">DevOps World</a>.</p>
<p>I work at <a href="https://www.kainos.com">Kainos</a>. Through them I've worked at FCA, His Majesty's Land Registry and the Department for International Trade.</p>
<p>
Catch me on
<span class="app-icons">
<a href="https://github.com/janfaracik" aria-label="GitHub" class="app-icon app-icon--github"></a>
<a href="https://x.com/janfaracik" aria-label="X (formally known as Twitter)" class="app-icon app-icon--x"></a>
<a href="https://linkedin.com/in/janfaracik/" aria-label="LinkedIn" class="app-icon app-icon--linkedin"></a>
</span>
.
</p>
</div>
<script>
const weatherDetail = document.querySelector("#weather-detail");
const weatherIcon = document.querySelector("#weather");
const rainSvg = '<svg xmlns="http://www.w3.org/2000/svg" class="ionicon" viewBox="0 0 512 512"><path d="M256 272v160a32 32 0 01-32 32h0a32 32 0 01-32-32M464 272c0-114.88-93.12-208-208-208S48 157.12 48 272h0a67.88 67.88 0 0196 0h0a78.28 78.28 0 01102.31-7.27L256 272l9.69-7.27A78.28 78.28 0 01368 272h0a67.88 67.88 0 0196 0zM256 64V48" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/></svg>';
const sunSvg = '<svg xmlns="http://www.w3.org/2000/svg" class="ionicon" viewBox="0 0 512 512"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M256 48v48M256 416v48M403.08 108.92l-33.94 33.94M142.86 369.14l-33.94 33.94M464 256h-48M96 256H48M403.08 403.08l-33.94-33.94M142.86 142.86l-33.94-33.94"/><circle cx="256" cy="256" r="80" fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32"/></svg>';
const snowSvg = '<svg xmlns="http://www.w3.org/2000/svg" class="ionicon" viewBox="0 0 512 512"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M256 32v448M313.72 80A111.47 111.47 0 01256 96a111.47 111.47 0 01-57.72-16M198.28 432a112.11 112.11 0 01115.44 0M449.99 144L62.01 368M437.27 218a112.09 112.09 0 01-57.71-100M74.73 294a112.09 112.09 0 0157.71 100M62.01 144l387.98 224M74.73 218a112.09 112.09 0 0057.71-100M437.27 294a112.09 112.09 0 00-57.71 100"/></svg>';
function getWeatherString() {
const today = new Date();
const year = today.getFullYear();
// Calculate the middle week of the year
const startOfYear = new Date(year, 0, 1);
const endOfYear = new Date(year, 11, 31);
const middleOfYear = new Date(startOfYear.getTime() + (endOfYear.getTime() - startOfYear.getTime()) / 2);
// Calculate the start and end of the middle week
const middleWeekStart = new Date(middleOfYear);
middleWeekStart.setDate(middleOfYear.getDate() - middleOfYear.getDay());
const middleWeekEnd = new Date(middleWeekStart);
middleWeekEnd.setDate(middleWeekStart.getDate() + 6);
// Check if today is in the middle week of the year
const isMiddleWeek = today >= middleWeekStart && today <= middleWeekEnd;
// Check if today is in the third week of December
const isThirdWeekOfDecember = today.getMonth() === 11 && today.getDate() >= 15 && today.getDate() <= 21;
if (isThirdWeekOfDecember) {
weatherIcon.innerHTML = snowSvg;
weatherDetail.innerText = `It's probably snowing`;
} else if (isMiddleWeek) {
weatherIcon.innerHTML = sunSvg;
weatherDetail.innerText = `It's probably sunny`;
} else {
weatherIcon.innerHTML = rainSvg;
weatherDetail.innerText = `It's probably raining`;
}
}
getWeatherString();
</script>
</body>
</html>