Skip to content

Commit d0faf89

Browse files
authored
Update projects, navigation. (#78)
1 parent 0051553 commit d0faf89

File tree

13 files changed

+118
-117
lines changed

13 files changed

+118
-117
lines changed

src/components/Button.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const Button = ({
1111
return (
1212
<div
1313
className={clsx(
14-
"cursor-pointer bg-zinc-900 p-3 px-6 font-semibold text-white dark:bg-zinc-200 dark:font-bold dark:text-black",
14+
"cursor-pointer bg-zinc-900 p-3 px-6 rounded text-white dark:bg-zinc-200 dark:font-bold dark:text-black",
1515
className
1616
)}
1717
>

src/components/Footer.tsx

-17
This file was deleted.

src/components/Header.tsx

+16-28
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import clsx from "clsx";
22
import Link from "next/link";
33
import { useRouter } from "next/router";
4-
import { MutableRefObject, useCallback, useEffect, useRef, useState } from "react";
5-
import { GitHub, Home, Twitter } from "react-feather";
4+
import { MutableRefObject, ReactNode, useCallback, useEffect, useRef, useState } from "react";
5+
import { GitHub, Home } from "react-feather";
66
import { Theme } from "./Theme";
77

88
const PADDING = 8;
@@ -75,7 +75,7 @@ const Separator = ({ className }: { className?: string }) => {
7575
const styles = {
7676
text: "dark:font-semibold text-white dark:text-black",
7777
homeText: "font-semibold dark:font-bold",
78-
underline: "underline-themed",
78+
underline: "sm:hover:underline",
7979
};
8080

8181
export const Header = () => {
@@ -86,11 +86,11 @@ export const Header = () => {
8686
<div
8787
className={clsx(
8888
styles.text,
89-
"pointer-events-none fixed inset-x-0 bottom-0 flex sm:inset-x-8 sm:bottom-8"
89+
"pointer-events-none fixed inset-x-4 bottom-4 flex sm:inset-x-8 sm:bottom-8"
9090
)}
9191
>
9292
<nav
93-
className="pointer-events-auto relative flex w-full items-center bg-black/80 py-4 pl-4 pr-2 backdrop-blur dark:bg-white/80 sm:mx-auto sm:w-auto sm:rounded-md sm:px-6 sm:pr-4"
93+
className="pointer-events-auto relative mx-auto flex w-auto items-center rounded-md bg-black/80 px-6 py-4 backdrop-blur dark:bg-white/80"
9494
ref={navRef as any}
9595
>
9696
<div
@@ -112,13 +112,13 @@ export const Header = () => {
112112
/>
113113
</Link>
114114
<Separator />
115-
<ul className="flex gap-3 sm:gap-6">
115+
<ul className="flex items-center gap-3 sm:gap-6">
116116
{(
117117
[
118118
["/projects/", "projects", projectsRef],
119119
// ['/blog/', 'blog'],
120120
["/about/", "about", aboutRef],
121-
] as [string, string, MutableRefObject<HTMLAnchorElement>][]
121+
] as [string, ReactNode, MutableRefObject<HTMLAnchorElement>][]
122122
).map(([url, title, ref]) => {
123123
return (
124124
<li key={url}>
@@ -128,30 +128,18 @@ export const Header = () => {
128128
</li>
129129
);
130130
})}
131+
<li>
132+
<Link
133+
href={"https://github.com/jsonnull"}
134+
className={clsx(styles.underline)}
135+
target="_blank"
136+
>
137+
<GitHub width={18} height={18} className="" />
138+
</Link>
139+
</li>
131140
</ul>
132141
<Separator className="pr-1 sm:pr-4" />
133142
<Theme onChange={(theme) => setTheme(theme)} />
134-
<Separator className="hidden px-1 sm:block sm:px-4" />
135-
<ul className="ml-auto flex items-center gap-1 leading-none text-zinc-400 dark:text-zinc-600 sm:gap-2">
136-
{(
137-
[
138-
[GitHub, "https://github.com/jsonnull"],
139-
[Twitter, "https://twitter.com/jsonnull"],
140-
] as [any, string][]
141-
).map(([Icon, href]) => {
142-
return (
143-
<a
144-
href={href}
145-
key={href}
146-
target="_blank"
147-
rel="noopener noreferrer"
148-
className="rounded-full p-2 hover:bg-zinc-600 hover:text-white dark:hover:bg-zinc-400 dark:hover:text-black"
149-
>
150-
<Icon width={18} height={18} />
151-
</a>
152-
);
153-
})}
154-
</ul>
155143
</div>
156144
</nav>
157145
</div>

src/components/Page.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import clsx from "clsx";
12
import Head from "next/head";
23
import * as React from "react";
34
import { Header } from "./";
@@ -30,7 +31,12 @@ export const Page = ({
3031
}
3132

3233
return (
33-
<div className="flex min-h-screen flex-col bg-white text-black dark:bg-black dark:text-zinc-200">
34+
<div
35+
className={clsx(
36+
"flex min-h-screen flex-col bg-white text-black dark:bg-black dark:text-zinc-200",
37+
"decoration-black underline-offset-2 dark:decoration-zinc-200"
38+
)}
39+
>
3440
<Head>
3541
{/* Meta tags */}
3642
<title>{title} | Jason Nall</title>

src/components/Project.tsx

+42-15
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,54 @@
11
import clsx from "clsx";
2+
import { Project as ProjectType } from "../types";
23

34
export const Project = ({
4-
name,
5-
description,
6-
progress = 100,
7-
milestone,
5+
project,
86
className,
97
retired,
108
}: {
11-
name: string;
12-
description: string;
13-
progress?: number;
14-
milestone: string;
9+
project: ProjectType;
1510
className?: string;
1611
retired?: boolean;
1712
}) => {
13+
const { name, description, milestones, tags, website } = project;
14+
const { name: milestone, progress = 100 } = milestones[0];
15+
16+
let title = <h3 className="text-xl font-semibold leading-tight">{name}</h3>;
17+
1818
return (
19-
<div className={clsx(className, "flex flex-col", retired && "text-dimmed")}>
20-
<div className="rounded-t pb-4 text-xl font-semibold">{name}</div>
21-
<div className="pb-6 text-sm">{description}</div>
19+
<section className={clsx(className, "flex flex-col", retired && "text-dimmed")}>
20+
<div className="flex flex-row items-center gap-2">
21+
{website && (
22+
<a href={website.url} target="_blank" className="hover:underline">
23+
{title}
24+
</a>
25+
)}
26+
{!website && title}
27+
</div>
28+
<div className="text pt-4">
29+
{description}{" "}
30+
{website && (
31+
<a
32+
href={website.url}
33+
target="_blank"
34+
className="text-dimmed text-sm hover:underline"
35+
>
36+
{website.title}
37+
</a>
38+
)}
39+
</div>
40+
{tags?.length && (
41+
<div className="flex flex-row gap-2 pt-4 text-sm">
42+
{tags.map((tag) => (
43+
<div className="text-dimmed">{tag}</div>
44+
))}
45+
</div>
46+
)}
47+
<div className="mt-auto h-6" />
2248
<div
2349
className={clsx(
24-
"mt-auto flex",
25-
"border border-solid border-zinc-500",
50+
"flex",
51+
"rounded border border-solid border-zinc-500",
2652
"pattern-lines pattern-bg-transparent pattern-fg-zinc-500"
2753
)}
2854
>
@@ -31,14 +57,15 @@ export const Project = ({
3157
"m-[-1px] flex h-6 min-w-[120px] items-center pl-2 pr-1",
3258
"text-sm text-zinc-100 dark:font-bold dark:text-black",
3359
"bg-zinc-900 dark:bg-zinc-200",
34-
retired && "bg-zinc-700 dark:bg-zinc-400"
60+
retired && "bg-zinc-500 dark:bg-zinc-500",
61+
progress === 100 ? "rounded" : "rounded-l"
3562
)}
3663
style={{ width: `calc(${progress}% + 2px)` }}
3764
>
3865
{milestone && <div>{milestone}</div>}
3966
{progress !== 100 && <div className="ml-auto">{progress}%</div>}
4067
</div>
4168
</div>
42-
</div>
69+
</section>
4370
);
4471
};

src/components/ProjectGrid.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,11 @@ export const ProjectGrid = ({
1111
}) => {
1212
return (
1313
<div className={clsx("grid grid-flow-row grid-cols-1 gap-16 md:grid-cols-2")}>
14-
{projects.map(({ name, description, milestones }) => {
14+
{projects.map(project => {
1515
return (
1616
<Project
17-
key={name}
18-
name={name}
19-
description={description}
20-
milestone={milestones[0].name}
21-
progress={milestones[0].progress}
17+
project={project}
18+
key={project.name}
2219
retired={retired}
2320
/>
2421
);

src/components/Spacer.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ export const Spacer = (props: SpacerProps) => {
66
return (
77
<div
88
className={clsx(
9-
"extraWide" in props && "pb-48",
10-
"wide" in props && "pb-32",
11-
"medium" in props && "pb-16",
9+
"extraWide" in props && "pb-36 pb-48",
10+
"wide" in props && "pb-24 sm:pb-32",
11+
"medium" in props && "pb-12 sm:pb-16",
1212
"small" in props && "pb-8"
1313
)}
1414
/>

src/components/index.tsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import clsx from "clsx";
22
import * as React from "react";
33

4-
export * from "./Footer";
54
export * from "./Header";
65
export * from "./Page";
76
export * from "./Title";
@@ -15,9 +14,6 @@ export const Wrapper = (props: { children: React.ReactNode; className?: string }
1514
};
1615

1716
export const Heading = (props: { children: React.ReactNode; className?: string }) => {
18-
return (
19-
<h1 className={clsx("text-3xl font-semibold tracking-tight", props.className)}>
20-
{props.children}
21-
</h1>
22-
);
17+
// <h1 className={clsx("text-2xl font-semibold text-zinc-500", props.className)}>
18+
return <h1 className={clsx("text-xl font-semibold", props.className)}>{props.children}</h1>;
2319
};

src/data/projects/index.ts

+19-7
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,33 @@ export const alea: Project = {
66
milestones: [{ name: "v1", progress: 15 }],
77
};
88

9+
export const configuration: Project = {
10+
name: "Configuration",
11+
description:
12+
"System configuration for all of my development machines, defined using Nix and home-manager.",
13+
milestones: [{ name: "Currently maintaining", progress: 100 }],
14+
tags: ["nix", "home-manager", "neovim", "lua"],
15+
website: { url: "https://github.com/jsonnull/configuration", title: "jsonnull/configuration" },
16+
};
17+
18+
export const electronTrpc: Project = {
19+
name: "electron-trpc",
20+
description: "Ergonomic and type-safe solution for building IPC in Electron.",
21+
milestones: [{ name: "Currently maintaining", progress: 100 }],
22+
tags: ["electron", "trpc"],
23+
website: { url: "https://www.electron-trpc.dev", title: "electron-trpc.dev" },
24+
};
25+
926
export const jsonnull: Project = {
1027
name: "jsonnull.com",
1128
description: "My personal blog, where I share technical work.",
1229
milestones: [{ name: "Redesign", progress: 50 }],
30+
tags: ["next.js", "tailwind"],
31+
website: { url: "https://github.com/jsonnull/jsonnull.com", title: "jsonnull/jsonnull.com" },
1332
};
1433

1534
export const novel: Project = {
1635
name: "Novel",
1736
description: "I'm writing an epic fantasy novel!",
1837
milestones: [{ name: "First draft", progress: 5 }],
1938
};
20-
21-
export const configuration: Project = {
22-
name: "Configuration",
23-
description:
24-
"System configuration for all of my development machines, defined using Nix and home-manager.",
25-
milestones: [{ name: "Currently maintaining", progress: 100 }],
26-
};

src/global.css

+14-14
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@
33
@tailwind utilities;
44

55
::-moz-selection {
6-
color: white;
7-
background: rgba(109, 117, 153, 0.99);
8-
text-shadow: none;
9-
opacity: 1;
6+
color: white;
7+
background: rgba(109, 117, 153, 0.99);
8+
text-shadow: none;
9+
opacity: 1;
1010
}
1111

1212
::selection {
13-
color: white;
14-
background: rgba(109, 117, 153, 0.99);
15-
text-shadow: none;
16-
opacity: 1;
13+
color: white;
14+
background: rgba(109, 117, 153, 0.99);
15+
text-shadow: none;
16+
opacity: 1;
1717
}
1818

1919
@layer components {
20-
.text-dimmed {
21-
@apply text-zinc-700 dark:text-zinc-400;
22-
}
23-
.underline-themed {
24-
@apply sm:hover:underline decoration-zinc-400 dark:decoration-zinc-600;
25-
}
20+
.text-dimmed {
21+
@apply text-zinc-500;
22+
}
23+
.underline-themed {
24+
@apply decoration-zinc-500 hover:decoration-black sm:underline;
25+
}
2626
}

src/pages/index.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import clsx from "clsx";
22
import Image from "next/image";
33
import Link from "next/link";
44
import React from "react";
5-
import { ArrowRight } from "react-feather";
5+
import { ArrowRight, GitHub } from "react-feather";
66
import { Heading, Page, Wrapper } from "../components";
77
import { Button } from "../components/Button";
88
import { ProjectGrid } from "../components/ProjectGrid";
99
import { Spacer } from "../components/Spacer";
10-
import { configuration, jsonnull } from "../data/projects";
10+
import { electronTrpc, jsonnull } from "../data/projects";
1111
import { profileDataURI } from "../lib/profileDataURI";
1212

1313
export const Title = ({ className }: { className?: string }) => {
@@ -44,17 +44,17 @@ const Home = () => {
4444
<TitleSection />
4545
<Spacer extraWide />
4646
<div className="flex flex-col items-center">
47-
<Heading>Recent Projects</Heading>
47+
<Heading>Projects</Heading>
4848
</div>
4949
<Spacer medium />
50-
<ProjectGrid projects={[jsonnull, configuration]} />
50+
<ProjectGrid projects={[electronTrpc, jsonnull]} />
5151
<Spacer medium />
5252
<div className="flex justify-center">
5353
<Link href="/projects">
5454
<Button>
55-
<div className="underline-themed flex items-center">
55+
<div className="flex items-center gap-2 sm:hover:underline">
5656
See my other projects
57-
<ArrowRight size={18} className="ml-2" />
57+
<ArrowRight size={18} />
5858
</div>
5959
</Button>
6060
</Link>

0 commit comments

Comments
 (0)