Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
613 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export const Footer: React.FC = () => { | ||
return ( | ||
<div className="text-center text-gray-600 text-sm p-4 mt-8"> | ||
© {new Date().getFullYear()} Timo Lins ·{" "} | ||
<a className="text-blue-500" href="https://github.com/timolins"> | ||
Source | ||
</a> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React from "react"; | ||
|
||
import { Repo } from "../../core/github"; | ||
import { config } from "../../config"; | ||
|
||
const RepoList: React.FC<{ | ||
title: string; | ||
url: string; | ||
repos: Repo[]; | ||
}> = ({ repos, title, url }) => ( | ||
<div> | ||
<h2 className="text-lg text-gray-600 font-semibold">{title}</h2> | ||
<ul> | ||
{repos.map(({ id, name, url, description, owner }) => ( | ||
<li | ||
key={id} | ||
className="my-4 py-4 px-4 -mx-4 hover:bg-gray-100 rounded-md" | ||
> | ||
<a href={url}> | ||
<div> | ||
<span className="text-blue-400">{owner.login}/</span> | ||
<span className="text-blue-600">{name}</span> | ||
</div> | ||
<div>{description}</div> | ||
</a> | ||
</li> | ||
))} | ||
</ul> | ||
<a href={url} className="text-blue-600 text-sm"> | ||
View more on <span className="font-semibold">GitHub</span> → | ||
</a> | ||
</div> | ||
); | ||
|
||
export const GitHubActivity: React.FC<{ | ||
starredRepos: Repo[]; | ||
contributedRepos: Repo[]; | ||
}> = ({ starredRepos, contributedRepos }) => ( | ||
<div className="container"> | ||
<h1 className="text-4xl font-bold">GitHub Activity</h1> | ||
<div className="grid grid-cols-1 md:grid-cols-2 gap-16"> | ||
<RepoList | ||
title="Repos I Contributed to" | ||
url={`https://github.com/${config.githubUsername}`} | ||
repos={contributedRepos} | ||
/> | ||
<RepoList | ||
title="Repos I Like" | ||
repos={starredRepos} | ||
url={`https://github.com/${config.githubUsername}?tab=stars`} | ||
/> | ||
</div> | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,106 @@ | ||
import React from "react"; | ||
import { Project as ProjectData, ProjectType } from "../../types/project"; | ||
import { toNotionImageUrl } from "../../core/notion"; | ||
import Link from "next/link"; | ||
|
||
export const Work = () => ( | ||
<div className="container"> | ||
const TypeBadge: React.FC<{ type: ProjectType }> = ({ type }) => { | ||
const className = "rounded-full px-3 flex items-center text-sm mr-1"; | ||
switch (type) { | ||
case "code": | ||
return ( | ||
<div className={`${className} bg-green-200 text-green-800`}>Code</div> | ||
); | ||
case "design": | ||
return ( | ||
<div className={`${className} bg-orange-200 text-red-700`}>Design</div> | ||
); | ||
case "video": | ||
return ( | ||
<div className={`${className} bg-blue-200 text-blue-700`}>Video</div> | ||
); | ||
} | ||
}; | ||
|
||
const Project: React.FC< | ||
ProjectData & { | ||
featured?: boolean; | ||
} | ||
> = ({ title, preview, images, featured, slug, types }) => ( | ||
<div | ||
className={`border rounded-md overflow-hidden flex flex-col ${ | ||
featured ? "shadow-sm" : "" | ||
}`} | ||
> | ||
{featured && ( | ||
<div className="pb-2/3 bg-gray-100 relative border-b"> | ||
{images && images[0] && ( | ||
<img | ||
className="absolute w-full h-full object-cover" | ||
src={toNotionImageUrl(images[0].url)} | ||
alt={title} | ||
/> | ||
)} | ||
</div> | ||
)} | ||
<div className="flex flex-1 flex-col justify-between"> | ||
<div className="p-4"> | ||
<div className="text-xl font-semibold text-gray-800">{title}</div> | ||
<div className="text-gray-600">{preview}</div> | ||
</div> | ||
<div className="flex justify-between p-4"> | ||
<div className="flex items-center"> | ||
{types.map(type => ( | ||
<TypeBadge type={type} /> | ||
))} | ||
</div> | ||
<Link href={`/work/${slug}`}> | ||
<a className="border group hover:bg-gray-100 text-blue-900 border-gray-300 py-1 px-3 rounded-md shadow-xs text"> | ||
{featured ? "Read more" : "Read"}{" "} | ||
<span className="transform transition-transform duration-300 ease-in-out inline-block text-gray-600 group-hover:translate-x-1"> | ||
→ | ||
</span> | ||
</a> | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
|
||
export const Work: React.FC<{ | ||
projects: ProjectData[]; | ||
preview?: boolean; | ||
}> = ({ projects, preview }) => ( | ||
<div className="container my-8"> | ||
<h1 className="text-4xl font-bold">Work</h1> | ||
<div className="text-2xl text-gray-600">Things I Have Made in the Past</div> | ||
<div className="grid grid-cols-3 gap-4"> | ||
{projects.slice(0, 3).map(p => ( | ||
<Project featured {...p} /> | ||
))} | ||
</div> | ||
<div className="grid mt-4 grid-cols-4 gap-4"> | ||
{!preview ? ( | ||
projects.slice(3).map(p => <Project {...p} />) | ||
) : ( | ||
<> | ||
{projects.slice(3, 6).map(p => ( | ||
<Project {...p} /> | ||
))} | ||
<div className="flex flex-col items-center justify-center text-center"> | ||
<div className="text-lg font-bold text-gray-700"> | ||
Want to see more? | ||
</div> | ||
<div className="text-gray-600"> | ||
Visit the project page to see more. | ||
</div> | ||
<Link href="/work"> | ||
<a className="mt-3 bg-gray-800 hover:bg-gray-700 text-gray-100 py-1 px-6 rounded-md"> | ||
Explore all | ||
</a> | ||
</Link> | ||
</div> | ||
</> | ||
)} | ||
</div> | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
const githubToken = process.env.GITHUB_TOKEN; | ||
|
||
if (!githubToken) { | ||
throw new Error("Missing environment variable GITHUB_TOKEN."); | ||
} | ||
|
||
export const config = { | ||
name: "Timo Lins", | ||
subtitle: "Code · Design · Film", | ||
birthday: "1997-09-07", | ||
githubUsername: "timolins", | ||
notionBlogTableId: "3a1f675cc61e47a3b77c858dc66b752a", | ||
notionAchievementTableId: "3e46de9f7eb847e596170b59c16c6fec", | ||
notionProjectTableId: "5e74829f397e430ebf7c18dfacbb7ac0", | ||
githubToken, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.