Skip to content

Commit 02503ed

Browse files
authored
Bug fixes and miscellaneous improvements (#8)
* Improved styling of Navbar * Fixed initial width of svg render on homepage * Added logos to homepage and favicons * Updated config to use vite plugin explicitly with TanstackStart * Separates .dockerignore to ensure it is used correctly in builds.
1 parent f039f88 commit 02503ed

22 files changed

+1082
-763
lines changed
File renamed without changes.

frontend/.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
public
3+
mdx
4+
.github
5+
.output
6+
.tanstack
7+
.vscode
8+
db.sqlite3
9+
.env
10+
.venv

frontend/package-lock.json

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

frontend/src/components/Navbar.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const navStyles = {
2020
h-[3rem]
2121
rounded-full
2222
w-30
23+
min-w-30
2324
transition-all
2425
dark:hover:bg-gray-600/20
2526
hover:bg-gray-300/50
@@ -49,21 +50,28 @@ export default function Navbar() {
4950
<nav
5051
className={cn(
5152
navStyles.nav,
52-
"justify-between px-5 grid-cols-3 max-w-6xl hidden md:grid"
53+
"justify-between px-5 grid-cols-3 max-w-6xl hidden md:grid-cols-[150px_1fr_150px] md:grid"
5354
)}
5455
>
5556
<Link
5657
to="/"
5758
activeProps={{ className: navStyles.active }}
5859
inactiveProps={{ className: navStyles.inactive }}
5960
activeOptions={{ exact: true }}
60-
className="flex cursor-pointer items-center justify-center px-1 py-0 m-0 size-[3rem] rounded-full bg-transparent shadow-none border-solid focus-visible:ring-1 focus-visible:ring-blue-500 hover:bg-gray-600/20"
61+
className="flex cursor-pointer items-center justify-center px-1 py-0 m-0 size-[3rem] rounded-full bg-transparent shadow-none border-solid focus-visible:ring-1 focus-visible:ring-blue-500 hover:bg-gray-600/20 justify-self-start"
6162
resetScroll
6263
aria-label="Home page link"
6364
>
64-
<HomeIcon className="p-0" size={32} aria-label="Home icon" />
65+
{/* <HomeIcon className="p-0" size={32} aria-label="Home icon" /> */}
66+
<img src="/static/logo.svg" alt="Logo" className="h-8 dark:hidden" />
67+
<img
68+
src="/static/logo-light.svg"
69+
alt="Logo"
70+
className="h-8 hidden dark:inline"
71+
/>
72+
<span className="sr-only">Home</span>
6573
</Link>
66-
<div className="align-middle grow-0 flex px-5">
74+
<div className="align-middle grow-0 flex px-5 justify-self-stretch justify-center">
6775
<Link
6876
to={BlogRoute.to}
6977
activeProps={{ className: navStyles.active }}
@@ -92,7 +100,7 @@ export default function Navbar() {
92100
About
93101
</Link>
94102
</div>
95-
<div className="flex items-center justify-end grow-0">
103+
<div className="flex items-center justify-self-end">
96104
<div className="px-2">
97105
<GitHub githubLink={"https://github.com/andrew-s28/"} />
98106
</div>

frontend/src/components/ThemeProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export function initialTheme() {
8484
// https://tanstack.com/router/latest/docs/framework/react/guide/document-head-management/#scripts
8585
return {
8686
children: `
87-
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
87+
let prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
8888
if (!("theme" in localStorage)) {
8989
localStorage.setItem("theme", prefersDark ? "dark" : "light");
9090
}

frontend/src/routes/__root.tsx

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,47 @@ export const Route = createRootRoute({
3737
scripts: [initialTheme()],
3838
links: [
3939
{ rel: "stylesheet", href: appCss },
40+
// For iPhone
4041
{
4142
rel: "apple-touch-icon",
43+
type: "image/png",
4244
sizes: "180x180",
43-
href: "/apple-touch-icon.png",
45+
href: "/public/favicon-180x180.png",
46+
},
47+
// For iPad
48+
{
49+
rel: "apple-touch-icon",
50+
type: "image/png",
51+
sizes: "167x167",
52+
href: "/public/favicon-167x167.png",
53+
},
54+
// For Google and Android
55+
{
56+
rel: "icon",
57+
type: "image/png",
58+
sizes: "192x192",
59+
href: "/public/favicon-192x192.png",
60+
},
61+
{
62+
rel: "icon",
63+
type: "image/png",
64+
sizes: "48x48",
65+
href: "/public/favicon-48x48.png",
4466
},
67+
// For all browsers
4568
{
4669
rel: "icon",
4770
type: "image/png",
4871
sizes: "32x32",
49-
href: "/favicon-32x32.png",
72+
href: "/public/favicon-32x32.png",
5073
},
5174
{
5275
rel: "icon",
5376
type: "image/png",
5477
sizes: "16x16",
55-
href: "/favicon-16x16.png",
78+
href: "/public/favicon-16x16.png",
5679
},
57-
{ rel: "icon", href: "/favicon.ico" },
80+
{ rel: "icon", href: "/public/favicon.ico" },
5881
{ rel: "preconnect", href: "https://fonts.googleapis.com" },
5982
{
6083
rel: "preconnect",

frontend/src/routes/index.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function zip(...arrays: (string[] | number[])[]): (string | number)[][] {
2323

2424
function IntroCard() {
2525
return (
26-
<div className="flex flex-col h-full align-middle justify-center m-5">
26+
<div className="flex flex-col h-full align-middle justify-center m-2 translate-y-[-8px]">
2727
<motion.div
2828
initial={{ opacity: 0, translateY: 20 }}
2929
animate={{
@@ -33,13 +33,22 @@ function IntroCard() {
3333
}}
3434
exit={{ opacity: 0, translateY: 20 }}
3535
>
36-
<div className="bg-night-sky-950 text-dawn-pink-100 rounded-3xl px-5 py-2 w-fit mx-auto">
36+
<div className="dark:bg-night-sky-950 bg-dawn-pink-100 dark:text-dawn-pink-100 text-night-sky-950 rounded-3xl px-5 py-2 w-fit mx-auto">
3737
<h1 className="text-[clamp(2rem,6vw,4rem)] text-center font-serif ">
3838
Andrew Scherer
3939
</h1>
4040
<h2 className="text-center text-[clamp(1rem,1vw,2rem)]">
4141
Physical Oceanographer <br /> Software Developer
4242
</h2>
43+
<div className="flex justify-center mt-2">
44+
<Link to="/about" className="group" resetScroll>
45+
<div className="rounded dark:bg-dawn-pink-100 bg-night-sky-950 px-4 dark:text-night-sky-950 text-dawn-pink-100">
46+
<span className="group-hover:font-bold after:content-[attr(title)] after:font-bold after:h-0 after:block after:invisible after:overflow-hidden after:bg-transparent bg-transparent">
47+
Learn More
48+
</span>
49+
</div>
50+
</Link>
51+
</div>
4352
</div>
4453
</motion.div>
4554
</div>
@@ -62,7 +71,7 @@ function Starfield({ configs }: { configs: StarfieldConfig[] }) {
6271

6372
const { width: widthInit } = useWidth();
6473
const { height: heightInit } = useHeight();
65-
const width = widthInit || 1920; // Fallback to 1920 if width is not available
74+
const width = widthInit || 10000; // Fallback to 10000 if width is not available
6675
const height = heightInit || 400; // Fallback to 400 if height is not available
6776
const prefersReducedMotion = usePrefersReducedMotion();
6877

@@ -370,7 +379,7 @@ function Waves({
370379
"10 0 10-10 20-10 2.34 0 4.25 1.9 4.25 4.25 0-1.03-.84-1.87-1.88-1.87-2.1 0-3.81 1.7-3.81 3.81 0 2.1 1.71 3.81 3.81 3.81 ";
371380
const waveWidth = 125;
372381
const { width: widthInit } = useWidth();
373-
const width = widthInit || 600; // Fallback to 600 if width is not available
382+
const width = widthInit || 5000; // Fallback to 10000 if width is not available
374383
const waveRepeat = Math.max(Math.ceil(width / waveWidth), 10);
375384
const path = `M0 0C10 0 10-10 20-10c2.35 0 4.25 1.9 4.25 4.25 0-1.03-.84-1.87-1.87-1.87-2.11 0-3.81 1.7-3.81 3.81 0 2.1 1.7 3.81 3.81 3.81 ${wavePath.repeat(waveRepeat)}`;
376385
const color = `${backgroundColor || ""} ${strokeColor || ""}`;
@@ -575,10 +584,10 @@ function Background() {
575584
<NightSky />
576585
</div>
577586
<div className="absolute top-90 left-0">
578-
<div className="flex h-30 justify-start w-full absolute animate-waves-top motion-reduce:animate-none motion-reduce:-translate-20">
587+
<div className="flex h-30 justify-start w-full absolute animate-waves-top delay-1000 motion-reduce:animate-none motion-reduce:-translate-20">
579588
<Waves backgroundColor="fill-ocean-500" />
580589
</div>
581-
<div className="flex h-30 justify-start w-full absolute animate-waves-middle motion-reduce:animate-none motion-reduce:-translate-10">
590+
<div className="flex h-30 justify-start w-full absolute animate-waves-middle delay-1000 motion-reduce:animate-none motion-reduce:-translate-10">
582591
<Waves backgroundColor="fill-ocean-600" />
583592
</div>
584593
<div className="flex h-30 justify-start w-full absolute animate-waves-bottom">

frontend/src/styles/app.css

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ body {
1919
overflow-x: hidden;
2020
margin-right: calc(-1 * (100vw - 100%));
2121
}
22-
/* li::before {
23-
content: "▶";
24-
} */
2522

2623
@theme {
2724
--breakpoint-xs: 420px;

frontend/static/logo-light.svg

Lines changed: 97 additions & 0 deletions
Loading

frontend/static/logo.svg

Lines changed: 97 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)