Skip to content

Commit d6fa876

Browse files
committed
feat: complete overhaul
1 parent 9d937bc commit d6fa876

42 files changed

Lines changed: 488 additions & 251 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ personal website at [franktbh.me](https://franktbh.me/). built with sveltekit +
55
## notes
66

77
- you can and should move around with vim binds
8-
- feel free to pet the cat [(•˕ •マ](https://en.wikipedia.org/wiki/Cat_(disambiguation))
8+
- feel free to pet the cat [(•˕ •マ](<https://en.wikipedia.org/wiki/Cat_(disambiguation)>)
99
- who knows when i might write a blog. always keep your options open

‎bun.lock‎

Lines changed: 5 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
},
1818
"devDependencies": {
1919
"@eslint/js": "^10.0.1",
20-
"@fontsource/commit-mono": "^5.3.0",
2120
"@fontsource/dejavu-mono": "^5.3.0",
21+
"@fontsource/iosevka": "^5.3.0",
2222
"@fontsource/noto-sans": "^5.3.0",
2323
"@fontsource/noto-sans-jp": "^5.3.0",
2424
"@sveltejs/adapter-auto": "^7.0.1",
2525
"@sveltejs/adapter-static": "^3.0.10",
26-
"@sveltejs/enhanced-img": "^0.11.0",
2726
"@sveltejs/kit": "^2.63.0",
2827
"@sveltejs/vite-plugin-svelte": "^7.1.2",
2928
"@tailwindcss/typography": "^0.5.19",

‎src/app.d.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ declare global {
88
// interface PageState {}
99
// interface Platform {}
1010
}
11+
12+
/** injected by vite.config.ts at build time */
13+
const __BUILD__: { hash: string | null; date: string };
1114
}
1215

1316
export {};

‎src/app.html‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
66
<meta name="text-scale" content="scale" />
7+
<!-- apply the :colorscheme saved by src/lib/theme/themes.ts before first paint,
8+
so a non-default theme doesn't flash mountain on load -->
9+
<script>
10+
try {
11+
const saved = JSON.parse(localStorage.getItem('theme'));
12+
for (const [prop, value] of Object.entries(saved?.vars ?? {}))
13+
document.documentElement.style.setProperty(prop, value);
14+
} catch {}
15+
</script>
716
%sveltekit.head%
817
</head>
918
<body data-sveltekit-preload-data="hover">
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<script lang="ts">
2+
// last line of the homepage; values injected by vite.config.ts
3+
const { hash, date } = __BUILD__;
4+
</script>
5+
6+
<p class="mt-8 text-right text-sm text-dim">
7+
updated {date}{#if hash}<span class="mx-[1ch]">·</span><a
8+
href="https://github.com/plasmavolt/website/commit/{hash}"
9+
target="_blank"
10+
rel="noopener"
11+
class="no-underline">{hash}</a
12+
>{/if}
13+
</p>

‎src/lib/components/Cat.svelte‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</script>
4141

4242
<pre
43-
class="cat m-0 shrink-0 leading-none text-dim select-none [&:has(a:hover)]:text-accent">{#each lines as line, i (i)}{i >
43+
class="cat m-0 shrink-0 leading-none text-dim select-none max-sm:text-sm [&:has(a:hover)]:text-accent">{#each lines as line, i (i)}{i >
4444
0
4545
? '\n'
4646
: ''}{line.lead}<a {href} target="_blank" rel="noopener" class="cursor-grab no-underline"
@@ -54,6 +54,12 @@
5454
>{/each}</pre>
5555

5656
<style>
57+
/* the art is aligned for a 0.6em-wide mono (it was drawn in commit mono).
58+
iosevka is narrower (0.5em), which skews the ascii against the fallback
59+
glyphs, so the cat keeps its own stack. dejavu mono is ~0.6em. */
60+
.cat {
61+
font-family: 'DejaVu Mono', 'Noto Sans JP', monospace;
62+
}
5763
/* hovering anywhere on the cat closes its eyes */
5864
.cat-hover {
5965
display: none;

‎src/lib/components/Header.svelte‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<script lang="ts">
2+
// the plain header (name / tagline / links, cat on the right).
3+
// swap it back in for <FetchHeader /> in +layout.svelte.
4+
import { resolve } from '$app/paths';
5+
import Cat from '$lib/components/Cat.svelte';
6+
import { site } from '$lib/data/site';
7+
</script>
8+
9+
<header class="mb-8 flex items-start justify-between gap-4">
10+
<div class="min-w-0">
11+
<div>
12+
<span class="text-accent">~</span>
13+
<a href={resolve('/')} class="font-bold">{site.name}</a>
14+
<span class="whitespace-nowrap text-dim"
15+
>/ <a href={site.taglineHref} target="_blank" rel="noopener" class="no-underline"
16+
>{site.tagline}</a
17+
></span
18+
>
19+
</div>
20+
<!-- every link carries a leading " · "; the list is pulled 3ch left inside an
21+
overflow-hidden box, so whichever dot starts a line gets clipped. that way
22+
wrapping on mobile never leaves a dangling separator. -->
23+
<div class="overflow-hidden">
24+
<ul
25+
class="-ml-[3ch] flex flex-wrap text-dim [&_a]:underline [&_a]:decoration-dim/50 [&_a]:underline-offset-4 [&_a:hover]:decoration-accent"
26+
>
27+
{#each site.links as link (link.label)}
28+
<li class="before:inline-block before:w-[3ch] before:text-center before:content-['·']">
29+
<a
30+
href={link.href}
31+
target={link.href.startsWith('http') ? '_blank' : undefined}
32+
rel={link.href.startsWith('http') ? 'noopener' : undefined}>{link.label}</a
33+
>
34+
</li>
35+
{/each}
36+
</ul>
37+
</div>
38+
</div>
39+
<Cat />
40+
</header>

‎src/lib/data/about.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
hi, i'm frank! i'm a second-year undergrad studying math and cs at nyu. academically, i'm broadly interested in systems programming, formalization, and PL theory. i also love piano, photography, and crosswords. [reach out](mailto:[email protected]) if you want to say hi!
1+
hi! i'm frank, a second-year undergrad studying math and cs at nyu,
2+
where i'm most academically interested in PL theory and implementation.
3+
among my miscellaneous non-academic interests (aka. hobbies) are classical piano,
4+
photography, and crosswords.
5+
6+
[reach out](mailto:[email protected]) if you want to say hi!

‎src/lib/data/courses.spec.ts‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { describe, expect, it } from 'vitest';
2+
import { parseCourses } from './courses';
3+
4+
describe('parseCourses', () => {
5+
it('splits code from name and skips comments/blank lines', () => {
6+
const text = `# header comment
7+
CSCI-UA 202 operating systems
8+
9+
MATH-UA 325 analysis i
10+
# trailing comment`;
11+
expect(parseCourses(text)).toEqual([
12+
{ code: 'CSCI-UA 202', name: 'operating systems' },
13+
{ code: 'MATH-UA 325', name: 'analysis i' }
14+
]);
15+
});
16+
17+
it('tolerates a line with only a code', () => {
18+
expect(parseCourses('CSCI-UA 999')).toEqual([{ code: 'CSCI-UA 999', name: '' }]);
19+
});
20+
});

0 commit comments

Comments
 (0)