Skip to content

Commit a13c5a6

Browse files
authored
Merge pull request #11 from ColourlessSpearmint/about-refactor
Refactor about page
2 parents fe3132c + 7366462 commit a13c5a6

14 files changed

Lines changed: 340 additions & 427 deletions

File tree

assets/daysalive.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Calculate days since 6:00 AM, September 13, 2010
2+
function updateDaysAlive() {
3+
// Create the start date: September 13, 2010 at 6:00 AM
4+
const startDate = new Date(2010, 8, 13, 6, 0, 0); // Month is 0-indexed, so 8 = September
5+
6+
// Get the current date and time
7+
const currentDate = new Date();
8+
9+
// Calculate the difference in milliseconds
10+
const timeDifference = currentDate - startDate;
11+
12+
// Convert milliseconds to days
13+
const millisecondsPerDay = 1000 * 60 * 60 * 24;
14+
const daysAlive = Math.floor(timeDifference / millisecondsPerDay);
15+
16+
// Find the span element and update its content
17+
const spanElement = document.getElementById('daysalive');
18+
if (spanElement) {
19+
spanElement.textContent = daysAlive.toLocaleString();
20+
}
21+
}
22+
23+
// Run the function when the page loads
24+
document.addEventListener('DOMContentLoaded', updateDaysAlive);
25+
26+
// Optional: Update every minute to keep it current
27+
setInterval(updateDaysAlive, 60000);

assets/gitstats.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
async function getGitStats(username) {
2+
try {
3+
const reposResponse = await fetch(`https://api.github.com/users/${username}/repos?per_page=100`);
4+
5+
if (!reposResponse.ok) {
6+
throw new Error(`Failed to fetch repositories: ${reposResponse.status}`);
7+
}
8+
9+
const repos = await reposResponse.json();
10+
11+
// Use Promise.all to make requests in parallel
12+
const commitCounts = await Promise.all(
13+
repos.map(async (repo) => {
14+
try {
15+
const response = await fetch(`https://api.github.com/repos/${username}/${repo.name}/commits?author=${username}&per_page=1`);
16+
17+
if (response.ok) {
18+
const linkHeader = response.headers.get('link');
19+
if (linkHeader) {
20+
const match = linkHeader.match(/page=(\d+)>; rel="last"/);
21+
return match ? parseInt(match[1]) : 1;
22+
} else {
23+
const commits = await response.json();
24+
return commits.length;
25+
}
26+
}
27+
return 0;
28+
} catch (error) {
29+
console.warn(`Failed to fetch commits for ${repo.name}:`, error);
30+
return 0;
31+
}
32+
})
33+
);
34+
35+
const totalCommits = commitCounts.reduce((sum, count) => sum + count, 0);
36+
37+
return {
38+
commitCount: totalCommits,
39+
repoCount: repos.length
40+
};
41+
} catch (error) {
42+
throw new Error(`Error fetching git stats: ${error.message}`);
43+
}
44+
}
45+
46+
getGitStats('ColourlessSpearmint').then(stats => {
47+
const commitElem = document.getElementById('commitcount');
48+
if (commitElem) {
49+
commitElem.textContent = stats.commitCount;
50+
}
51+
52+
const repoElem = document.getElementById('repocount');
53+
if (repoElem) {
54+
repoElem.textContent = stats.repoCount;
55+
}
56+
}).catch(error => {
57+
console.error('Failed to fetch git stats:', error);
58+
});

assets/media/ethan_bio.webp

308 KB
Loading

assets/modules/table.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ table {
1717
}
1818

1919
&.compact {
20+
max-width: clamp(600px, 70vw, 1000px);
2021
font-size: 0.92em;
2122
margin: var(--spacing-sm) 0;
23+
table-layout: fixed;
2224

2325
th,
2426
td {

content/about/_index.md

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,176 @@ description: About Me page for Ethan Marks
44
url: /about/
55
layout: about/list
66
---
7+
8+
{{< row >}}
9+
{{< column >}}
10+
11+
## Bio
12+
13+
My name is **Ethan Marks**
14+
15+
I'm a **software engineer**
16+
17+
I'm **14** years old
18+
{{< /column >}}
19+
{{< /row >}}
20+
21+
{{< row >}}
22+
{{< column >}}
23+
![Ethan, a fair-skinned brown-haired teenager, sitting on a boulder and smiling pleasantly underneath a tree](~/ethan_bio.webp)
24+
25+
{{< /column >}}
26+
{{< /row >}}
27+
28+
{{< row >}}
29+
{{< column >}}
30+
31+
## Interests
32+
33+
{{< compact-table >}}
34+
| Interests |
35+
|-----------|
36+
| [Programming](/tags/programming) |
37+
| [Automation](/tags/automation) |
38+
| Mathematics |
39+
| [Cryptology](/tags/cryptology) |
40+
| [Linguistics](/tags/language/) |
41+
| [Cartography](/tags/cartography) |
42+
{{< /compact-table >}}
43+
{{< /column >}}
44+
45+
{{< column >}}
46+
47+
## Likes
48+
49+
{{< compact-table >}}
50+
| Category | My Favorite |
51+
|----------|-------------|
52+
| Colour | <span class="mint"><b>Spearmint Teal</b></span> |
53+
| Novel | [The Golden Compass](https://www.goodreads.com/book/show/119322.The_Golden_Compass) |
54+
| Map Projection | [Waterman Butterfly](https://colourlessspearmint.github.io/blog/waterman) |
55+
| Bird | [Starling](https://en.wikipedia.org/wiki/Starling) |
56+
| Foreign Language | [Bulgarian](https://en.wikipedia.org/wiki/Bulgarian_language) |
57+
| Logical Operator | [XOR](https://en.wikipedia.org/wiki/Exclusive_or) |
58+
{{< /compact-table >}}
59+
{{< /column >}}
60+
61+
{{< column >}}
62+
63+
## Hobbies
64+
65+
{{< compact-table >}}
66+
| Hobbies |
67+
|---------|
68+
| Coding [things](/tags/projects/) |
69+
| Reading, especially sci-fi |
70+
| Playing [Astroneer](https://store.steampowered.com/app/361420/ASTRONEER/) |
71+
| Browsing random Wikipedia articles |
72+
| Memorizing every [xkcd](https://xkcd.com/) comic |
73+
| Traveling and visiting National Parks |
74+
{{< /compact-table >}}
75+
{{< /column >}}
76+
{{< /row >}}
77+
78+
{{< row >}}
79+
{{< column >}}
80+
81+
## Education
82+
83+
I'm a homeschooled high school student currently in my third semester of [dual-enrollment](https://en.wikipedia.org/wiki/Dual_enrollment) at my local community college.
84+
{{< /column >}}
85+
86+
{{< column >}}
87+
88+
## Job
89+
90+
I run a small personal business flipping old laptops. I bought 30 old laptops at auction, and I repair them and install [ChromeOS Flex](https://chromeos.google/products/chromeos-flex/) in order to resell them for profit.
91+
{{< /column >}}
92+
{{< /row >}}
93+
94+
{{< row >}}
95+
{{< column >}}
96+
97+
## Skills
98+
99+
{{< compact-table >}}
100+
| Category | Skills |
101+
|----------|--------|
102+
| General Purpose Language | Python |
103+
| Web Development | HTML, CSS, JavaScript |
104+
| Version Control | Git, GitHub |
105+
| Game Engine | Unity, Godot |
106+
| Image Editing Software | Photoshop, GIMP, Inkscape |
107+
{{< /compact-table >}}
108+
{{< /column >}}
109+
110+
{{< column >}}
111+
112+
## Experience
113+
114+
{{< compact-table >}}
115+
| Experience |
116+
|------------|
117+
| Coding since I was 7 years old |
118+
| Developed and published [Soaring Squirrel Shipment](https://colourlessspearmint.itch.io/soaring-squirrel-shipment), a game about flying squirrels |
119+
| Designed and built my [personal website](/blog/personalwebsite) from scratch |
120+
| Created [Thessa](/blog/thessa), an AI-powered thesaurus |
121+
| Created [ASCII-Globe](/blog/asciiglobe), a text-based cartographic rendering engine |
122+
{{< /compact-table >}}
123+
{{< /column >}}
124+
{{< /row >}}
125+
126+
{{< row >}}
127+
128+
{{< column >}}
129+
130+
## Setup
131+
132+
{{< compact-table >}}
133+
| Category | Setup |
134+
|----------|--------|
135+
| Primary Computer | HP Victus 15 (Kubuntu Linux) |
136+
| Secondary Computer | Surface Laptop 3 (Windows 11) |
137+
| Code Editors | Zed, WebStorm, Google Colab |
138+
| Notes & Organization | Obsidian |
139+
| Browser | Firefox |
140+
{{< /compact-table >}}
141+
{{< /column >}}
142+
143+
{{< column >}}
144+
145+
## Stats
146+
147+
{{< compact-table >}}
148+
| Stat | Count |
149+
|------|-------|
150+
| States Visited | 48 |
151+
| GitHub Repos | <span id="repocount">~6</span> |
152+
| Git Commits | <span id="commitcount">~700</span> |
153+
| Blog Posts | {{< postcount >}} |
154+
| Days Alive | <span id="daysalive">~5400</span> |
155+
{{< /compact-table >}}
156+
{{< /column >}}
157+
158+
{{< /row >}}
159+
160+
{{< row >}}
161+
{{< column >}}
162+
163+
## Cat
164+
165+
I have a cat named Toby. He is 17 years old and blind.
166+
167+
![Toby, a fluffy gray Persian cat, curiously surveys a desert (White Sands National Park) while being petted by Ethan, a brown-haired fair-skinned teenage boy.](~/toby.webp "Me and Toby at White Sands National Park")
168+
169+
{{< /column >}}
170+
{{< /row >}}
171+
172+
{{< row >}}
173+
{{< column >}}
174+
175+
## On the Web
176+
177+
{{< contact-links >}}
178+
{{< /column >}}
179+
{{< /row >}}

layouts/_default/_markup/render-image.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{{ $destination := replace (.Destination | safeURL) "~/" "/media/" }}
22
{{ $img := resources.Get $destination }}
3-
{{ $src := $img.RelPermalink }}
3+
{{ $src := "" }}
4+
{{ if $img }}
5+
{{ $src = $img.RelPermalink }}
6+
{{ else }}
7+
{{ $src = $destination }}
8+
{{ end }}
49

510
{{ $width := "" }}
611
{{ $height := "" }}

0 commit comments

Comments
 (0)