-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
205 lines (188 loc) · 9.9 KB
/
index.html
File metadata and controls
205 lines (188 loc) · 9.9 KB
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
<!doctype html>
<html lang="en" data-theme="dark">
<head>
<meta charset="utf-8" />
<title>Pyotr Void — Software Engineer</title>
<meta
name="description"
content="Personal website of Pyotr Void, Software Engineer"
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="color-scheme" content="dark light" />
<!-- Open Graph -->
<meta property="og:type" content="website" />
<meta property="og:url" content="https://ptrpl4.page" />
<meta property="og:title" content="Pyotr Void — Software Engineer" />
<meta property="og:description" content="Personal website of Pyotr Void, Software Engineer" />
<meta property="og:image" content="https://ptrpl4.page/assets/favicons/web-app-manifest-512x512.png" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:creator" content="@ptrpl4" />
<!-- Favicon -->
<link rel="icon" href="assets/favicons/favicon.svg" type="image/svg+xml" />
<link rel="icon" href="assets/favicons/favicon.ico" />
<link rel="apple-touch-icon" href="assets/favicons/apple-touch-icon.png" />
<link rel="manifest" href="assets/favicons/site.webmanifest" />
<link rel="stylesheet" href="assets/css/main.css?v=2" />
<script>
// Restore saved theme before paint
(function () {
var saved = localStorage.getItem("theme");
if (saved === "light" || saved === "dark") {
document.documentElement.setAttribute("data-theme", saved);
}
})();
</script>
</head>
<body>
<button id="theme-toggle" aria-label="Toggle theme">◐</button>
<div class="space">
<div id="stars"></div>
<div id="sat-orbit"><div id="satellite"></div></div>
<div id="comet"></div>
<div id="sky-object"></div>
<div class="circle">
<header id="header">
<h1>Pyotr Void</h1>
<p class="tagline">
Software Engineer • Human<br>
Never asked for this
</p>
<a class="page-links" href="/projects">projects</a>
<nav aria-label="Social media links">
<ul>
<li>
<a href="https://twitter.com/ptrpl4" aria-label="Twitter">
<svg
aria-hidden="true"
viewBox="0 0 24 24"
width="24"
height="24"
stroke="currentColor"
fill="none"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z"></path>
</svg>
</a>
</li>
<li>
<a href="https://github.com/ptrpl4" aria-label="GitHub">
<svg
aria-hidden="true"
viewBox="0 0 24 24"
width="24"
height="24"
stroke="currentColor"
fill="none"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"></path>
<path d="M9 18c-4.51 2-5-2-7-2"></path>
</svg>
</a>
</li>
<li>
<a href="mailto:ptrpl4@icloud.com" aria-label="Email">
<svg
aria-hidden="true"
viewBox="0 0 24 24"
width="24"
height="24"
stroke="currentColor"
fill="none"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M3 7a2 2 0 0 1 2-3h14a2 2 0 0 1 2 3v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z"></path>
<path d="M3 7l9 6 9-6"></path>
</svg>
</a>
</li>
</ul>
</nav>
</header>
</div>
</div>
<script>
(function () {
function createStars() {
var el = document.getElementById("stars");
var wrapper = document.querySelector(".space");
if (!el || !wrapper) return;
var w = wrapper.offsetWidth;
var h = wrapper.offsetHeight;
var shadows = [];
for (var i = 0; i < 90; i++) {
var x = Math.round(Math.random() * w);
var y = Math.round(Math.random() * h);
var a = (0.25 + Math.random() * 0.65).toFixed(2);
shadows.push(x + "px " + y + "px 1px rgba(200,220,255," + a + ")");
}
el.style.boxShadow = shadows.join(",");
}
createStars();
function setMoonPhase() {
var el = document.getElementById("sky-object");
if (!el) return;
if (Math.random() < 0.15) {
// Full moon
el.style.setProperty("--crescent-opacity", "0");
} else {
// Random crescent: left 2px (thin sliver) to -38px (thick gibbous)
var left = (2 - Math.random() * 40).toFixed(1);
el.style.setProperty("--crescent-left", left + "px");
el.style.setProperty("--crescent-opacity", "1");
}
}
if (document.documentElement.getAttribute("data-theme") === "dark") {
setMoonPhase();
}
// Place sun/moon in a random position in the upper arc above Earth.
// R is scaled to Earth's actual rendered radius so it works on all screen sizes.
function placeSkyObject(animate) {
var wrapper = document.querySelector(".space");
var circle = document.querySelector(".circle");
var el = document.getElementById("sky-object");
if (!el || !wrapper || !circle) return;
var wRect = wrapper.getBoundingClientRect();
var cRect = circle.getBoundingClientRect();
var ex = cRect.left - wRect.left + cRect.width / 2;
var ey = cRect.top - wRect.top + cRect.height / 2;
var er = cRect.width / 2;
var dist = er * 1.45 + Math.random() * er * 0.15;
var skyR = el.offsetWidth / 2 || 32;
var maxX = wRect.width / 2 - skyR - 8;
var maxAngle = Math.min(70 * Math.PI / 180, Math.asin(Math.min(0.99, maxX / dist)));
var angle = (Math.random() * 2 - 1) * maxAngle;
var x = ex + dist * Math.sin(angle);
var y = ey - dist * Math.cos(angle);
if (!animate) {
el.style.transition = "none";
el.style.left = x + "px";
el.style.top = y + "px";
el.offsetHeight; // force reflow before restoring transition
el.style.transition = "";
} else {
el.style.left = x + "px";
el.style.top = y + "px";
}
}
placeSkyObject(false);
document.getElementById("theme-toggle").addEventListener("click", function () {
var html = document.documentElement;
var next = html.getAttribute("data-theme") === "dark" ? "light" : "dark";
html.setAttribute("data-theme", next);
localStorage.setItem("theme", next);
placeSkyObject(true);
if (next === "dark") setMoonPhase();
});
})();
</script>
</body>
</html>