-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabout.html
More file actions
327 lines (286 loc) · 11.5 KB
/
about.html
File metadata and controls
327 lines (286 loc) · 11.5 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
<title>About - Nicolas Mallinckrodt</title>
<link rel="stylesheet" href="project.css">
<link rel="stylesheet" href="https://use.typekit.net/jlz2zhe.css">
<link rel="icon" type="image/x-icon" href="util/favicon.ico">
<style>
.about-section {
margin-bottom: 3em;
}
.about-title {
font-size: 1.5em;
opacity: 0.8;
margin-bottom: 0.5em;
}
.skills-container {
display: flex;
flex-wrap: wrap;
gap: 1em;
margin-top: 1em;
}
.skill-tag {
background-color: rgba(255, 255, 255, 0.2);
padding: 0.5em 1.2em;
border-radius: 2em;
font-size: 1.2em;
}
.contact-dots {
display: flex;
gap: 2em;
flex-wrap: wrap;
margin-top: 1em;
justify-content: flex-start;
}
.link-dot {
cursor: pointer;
flex-shrink: 0;
}
@media screen and (max-width: 768px) {
.skill-tag {
font-size: 1em;
padding: 0.4em 0.8em;
}
.contact-dots {
gap: 1em;
justify-content: center;
}
}
</style>
</head>
<body>
<div class="header">
<div class="text-block">
<div class="top-text">
<span class="name">nicolas</span>
<span class="time" id="time">12:16</span>
</div>
<div class="divider"></div>
<div class="bottom-text">
<span class="inverted name">mallinckrodt</span>
<span class="inverted date" id="date">26.08.2024</span>
</div>
</div>
</div>
<div class="container">
<div class="heading-container">
<div class="dot smoll yellow" id="index">
<span class="spinning-text spinning-text-small">BACK</span>
</div>
<h1>About</h1>
</div>
<section class="project-content">
<p>Loading...</p>
</section>
</div>
<div class="dot red small" url="projects" id="projects">
<span class="spinning-text spinning-text-small">Projects</span>
</div>
<div class="dot red small" url="writing" id="writing">
<span class="spinning-text spinning-text-small">Writing</span>
</div>
<div class="dot red small" url="about" id="about">
<span class="spinning-text spinning-text-small">About</span>
</div>
<script>
function updateTime() {
const now = new Date();
const day = String(now.getDate()).padStart(2, '0');
const month = String(now.getMonth() + 1).padStart(2, '0');
const year = now.getFullYear();
const formattedDate = `${day}.${month}.${year}`;
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
const timezoneOffset = now.getTimezoneOffset();
const timezoneHours = String(Math.abs(timezoneOffset) / 60).padStart(2, '0');
const timezoneMinutes = String(Math.abs(timezoneOffset) % 60).padStart(2, '0');
const timezoneSign = timezoneOffset > 0 ? '-' : '+';
const formattedTime = `${hours}:${minutes}:${seconds} GMT${timezoneSign}${timezoneHours}${timezoneMinutes}`;
document.getElementById("date").innerHTML = formattedDate;
document.getElementById("time").innerHTML = formattedTime;
}
setInterval(updateTime, 1000);
updateTime();
</script>
<script>
/**
* Initializes click handlers for navigation dots
*/
function initDotNavigation() {
document.querySelectorAll('.dot').forEach((dot) => {
// Skip if already has listener
if (dot.dataset.hasListener) return;
dot.dataset.hasListener = 'true';
dot.addEventListener('click', function(e) {
e.preventDefault();
e.stopPropagation();
this.classList.add('dot-big');
const route = this.id;
const url = this.getAttribute('url');
const linkUrl = this.dataset.linkUrl;
setTimeout(() => {
if (route === 'index') {
window.location.href = 'index.html';
} else if (url) {
window.location.href = `${route}.html`;
} else if (linkUrl) {
window.open(linkUrl, '_blank');
} else if (route) {
window.location.href = `https://${route}`;
}
setTimeout(() => {
this.classList.remove('dot-big');
}, 800);
}, 400);
});
});
}
// Initialize on page load
document.addEventListener('DOMContentLoaded', initDotNavigation);
// Add scroll-based spinning animation for mobile
if (window.innerWidth < 1200) {
window.addEventListener('scroll', () => {
const scrollPercentage = (window.scrollY / (document.documentElement.scrollHeight - window.innerHeight)) * 100;
const rotation = scrollPercentage * 3.6;
let multi = 1;
document.querySelectorAll('.spinning-text-small').forEach((element) => {
element.style.transform = `rotate(${rotation*multi}deg)`;
multi*=1.4;
});
});
}
</script>
<script>
const API_URL = 'https://nicolas-py.github.io/portfolio-provider/api/portfolio.json';
/**
* Checks if a URL or email is a placeholder/example
* @param {string} value - The URL or email to check
* @returns {boolean} True if it's a valid (non-placeholder) value
*/
function isValidContact(value) {
if (!value) return false;
const placeholders = ['example.com', 'placeholder', 'test.com', 'sample.com'];
return !placeholders.some(p => value.toLowerCase().includes(p));
}
/**
* Creates a contact dot element
* @param {string} url - The URL to link to
* @param {string} label - The label text
* @param {string} colorClass - The color class (red or yellow)
* @returns {HTMLElement} The dot element
*/
function createContactDot(url, label, colorClass = 'red') {
const dotElement = document.createElement('div');
dotElement.className = `dot smoll ${colorClass} link-dot`;
dotElement.dataset.linkUrl = url;
const span = document.createElement('span');
span.className = 'spinning-text spinning-text-small';
span.textContent = label;
dotElement.appendChild(span);
return dotElement;
}
/**
* Fetches about data from the API and renders it
*/
async function loadAbout() {
const container = document.querySelector('.project-content');
try {
const response = await fetch(API_URL);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
const about = data.about;
if (!about) {
container.innerHTML = '<p>No about information found.</p>';
return;
}
container.innerHTML = '';
// Name and Title section (only show if data exists)
if (about.name || about.title || about.bio) {
const introSection = document.createElement('div');
introSection.className = 'about-section';
if (about.name) {
const nameHeading = document.createElement('h2');
nameHeading.textContent = about.name;
introSection.appendChild(nameHeading);
}
if (about.title) {
const titleP = document.createElement('p');
titleP.className = 'about-title';
titleP.textContent = about.title;
introSection.appendChild(titleP);
}
if (about.bio) {
const bioP = document.createElement('p');
bioP.textContent = about.bio;
introSection.appendChild(bioP);
}
container.appendChild(introSection);
}
// Skills section (only show if skills exist)
if (about.skills && about.skills.length > 0) {
const skillsSection = document.createElement('div');
skillsSection.className = 'about-section';
const skillsHeading = document.createElement('h2');
skillsHeading.textContent = 'Skills';
skillsSection.appendChild(skillsHeading);
const skillsContainer = document.createElement('div');
skillsContainer.className = 'skills-container';
about.skills.forEach(skill => {
const skillTag = document.createElement('span');
skillTag.className = 'skill-tag';
skillTag.textContent = skill;
skillsContainer.appendChild(skillTag);
});
skillsSection.appendChild(skillsContainer);
container.appendChild(skillsSection);
}
// Contact section - using dots instead of links, only show valid contacts
if (about.contact) {
const hasValidContacts =
isValidContact(about.contact.github) ||
isValidContact(about.contact.linkedin) ||
isValidContact(about.contact.email);
if (hasValidContacts) {
const contactSection = document.createElement('div');
contactSection.className = 'about-section';
const contactHeading = document.createElement('h2');
contactHeading.textContent = 'Contact';
contactSection.appendChild(contactHeading);
const contactDots = document.createElement('div');
contactDots.className = 'contact-dots';
// GitHub dot
if (isValidContact(about.contact.github)) {
const githubDot = createContactDot(about.contact.github, 'GitHub', 'red');
contactDots.appendChild(githubDot);
}
// LinkedIn dot
if (isValidContact(about.contact.linkedin)) {
const linkedinDot = createContactDot(about.contact.linkedin, 'LinkedIn', 'yellow');
contactDots.appendChild(linkedinDot);
}
// Email dot
if (isValidContact(about.contact.email)) {
const emailDot = createContactDot(`mailto:${about.contact.email}`, 'Email', 'red');
contactDots.appendChild(emailDot);
}
contactSection.appendChild(contactDots);
container.appendChild(contactSection);
}
}
// Re-initialize dot navigation for dynamically added dots
initDotNavigation();
} catch (error) {
console.error('Error loading about:', error);
container.innerHTML = '<p>Failed to load about information. Please try again later.</p>';
}
}
document.addEventListener('DOMContentLoaded', loadAbout);
</script>
</body>
</html>