Improve layout

This commit is contained in:
Markus Thielker 2024-12-21 22:10:18 +01:00
parent 42a5fc9c6a
commit 8ce56cf7cf
No known key found for this signature in database
4 changed files with 318 additions and 173 deletions

View file

@ -3,44 +3,45 @@
@tailwind utilities; @tailwind utilities;
body { body {
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
} }
@layer base { @layer base {
:root { :root {
--background: 20 14.3% 4.1%; --background: 0 0% 12%;
--foreground: 60 9.1% 97.8%; --foreground: 60 9.1% 97.8%;
--card: 20 14.3% 4.1%; --card: 0 0% 18%;
--card-foreground: 60 9.1% 97.8%; --card-foreground: 60 9.1% 97.8%;
--popover: 20 14.3% 4.1%; --popover: 20 14.3% 4.1%;
--popover-foreground: 60 9.1% 97.8%; --popover-foreground: 60 9.1% 97.8%;
--primary: 20.5 90.2% 48.2%; --primary: 20.5 90.2% 48.2%;
--primary-foreground: 60 9.1% 97.8%; --primary-foreground: 60 9.1% 97.8%;
--secondary: 12 6.5% 15.1%; --secondary: 12 6.5% 15.1%;
--secondary-foreground: 60 9.1% 97.8%; --secondary-foreground: 60 9.1% 97.8%;
--muted: 12 6.5% 15.1%; --muted: 12 6.5% 15.1%;
--muted-foreground: 24 5.4% 63.9%; --muted-foreground: 24 5.4% 63.9%;
--accent: 12 6.5% 15.1%; --accent: 12 6.5% 15.1%;
--accent-foreground: 60 9.1% 97.8%; --accent-foreground: 60 9.1% 97.8%;
--destructive: 0 72.2% 50.6%; --destructive: 0 72.2% 50.6%;
--destructive-foreground: 60 9.1% 97.8%; --destructive-foreground: 60 9.1% 97.8%;
--border: 12 6.5% 15.1%; --border: 12 6.5% 15.1%;
--input: 12 6.5% 15.1%; --input: 12 6.5% 15.1%;
--ring: 20.5 90.2% 48.2%; --ring: 20.5 90.2% 48.2%;
--chart-1: 220 70% 50%; --chart-1: 220 70% 50%;
--chart-2: 160 60% 45%; --chart-2: 160 60% 45%;
--chart-3: 30 80% 55%; --chart-3: 30 80% 55%;
--chart-4: 280 65% 60%; --chart-4: 280 65% 60%;
--chart-5: 340 75% 55%; --chart-5: 340 75% 55%;
--radius: 1.5rem --radius: 1.5rem
} }
} }
@layer base { @layer base {
* { * {
@apply border-border; @apply border-border;
} }
body {
@apply bg-background text-foreground; body {
} @apply bg-background text-foreground;
}
} }

View file

@ -14,8 +14,8 @@ const geistMono = Geist_Mono({
}); });
export const metadata: Metadata = { export const metadata: Metadata = {
title: "Create Next App", title: "Markus Thielker",
description: "Generated by create next app", description: "Full stack developer of Kotlin and Java backends with experience in Android, React and Angular frontend development",
}; };
export default function RootLayout({ export default function RootLayout({

View file

@ -7,166 +7,310 @@ import Link from 'next/link';
import { SearchResult } from '@/components/search-result'; import { SearchResult } from '@/components/search-result';
import { PublicUser } from '@/lib/github-user'; import { PublicUser } from '@/lib/github-user';
const calculateAge = (birthdate: Date): number => {
const today = new Date();
let age = today.getFullYear() - birthdate.getFullYear();
const monthDiff = today.getMonth() - birthdate.getMonth();
// Adjust age if the birthday hasn't occurred yet this year
if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthdate.getDate())) {
age--;
}
return age;
};
const getRepos = async (username: string) => {
let repos: any[] = [];
let page = 1;
let hasNextPage = true;
while (hasNextPage) {
const response = await fetch(`https://api.github.com/users/${username}/repos?page=${page}&per_page=100`, {
headers: {
Accept: 'application/vnd.github+json',
},
});
const data = await response.json();
if (Array.isArray(data)) {
repos = repos.concat(data);
hasNextPage = data.length === 100; // Check if there are more pages
page++;
} else {
hasNextPage = false; // Stop if the response is not an array (likely an error)
}
}
return repos;
};
const getLanguages = async (repo: any) => {
const response = await fetch(repo.languages_url, {
headers: {
Accept: 'application/vnd.github+json',
},
});
return await response.json();
};
const accumulateLanguages = async (repos: any[]) => {
const languages: { [key: string]: number } = {};
for (const repo of repos) {
const repoLanguages = await getLanguages(repo);
for (const lang in repoLanguages) {
languages[lang] = (languages[lang] || 0) + repoLanguages[lang];
}
}
return languages;
};
export default async function Home() { export default async function Home() {
const response = await fetch("https://api.github.com/users/markusthielker") const profileResponse = await fetch('https://api.github.com/users/markusthielker');
const profile = await response.json() as PublicUser const profile = await profileResponse.json() as PublicUser;
const username = 'markusthielker';
const repos = await getRepos(username);
const languages = await accumulateLanguages(repos);
const totalBytes = Object.values(languages).reduce((sum, bytes) => sum + bytes, 0);
const languagePercentages = Object.entries(languages)
.map(([lang, bytes]) => ({
lang,
percent: (bytes / totalBytes) * 100,
}))
.sort((a, b) => b.percent - a.percent)
.slice(0, 5);
const age = calculateAge(new Date('2001-03-04'));
return ( return (
<div className="flex flex-col w-full min-h-screen"> <div className="flex flex-col min-h-screen">
{ /* search header */} { /* search header */}
<header className="pt-8 px-8 pb-2"> <header className="relative p-4 pb-0 lg:p-8 lg:pb-0">
{ /* input */} <Image
<div className="flex items-center space-x-2 sm:space-x-4 md:space-x-8"> height="35"
<Image width="35"
height="50" src="/portrait.png"
width="50" className="hidden lg:block absolute rounded cursor-pointer"
src="/portrait.png" alt="Portrait of Markus Thielker"/>
className="rounded"
alt="Portrait of Markus Thielker"/> { /* header content (centered) */}
<Input value="Who the fuck is Markus Thielker?" readOnly/> <div className="flex items-center justify-center">
<div className="flex flex-col items-center w-full justify-start max-w-6xl">
{ /* input */}
<Input
className="w-full"
value="Who the fuck is Markus Thielker?"
readOnly/>
{ /* tab navigation */}
<div className="flex flex-row w-full mt-8 text-sm text-white/50 cursor-pointer">
<span className="font-semibold text-white/90 border-white border-b-2 px-3 pb-2">All</span>
<span className="px-3 pb-2">News</span>
<span className="px-3 pb-2">Images</span>
<span className="px-3 pb-2">Videos</span>
<span className="px-3 pb-2">Books</span>
<span className="px-3 pb-2">Web</span>
<span className="px-3 pb-2">Finances</span>
</div>
</div>
</div> </div>
</header> </header>
<Separator/> <Separator/>
<main className="flex flex-col w-full justify-center max-w-6xl"> { /* personalised content (centered) */}
<main className="flex flex-col w-full items-center justify-center">
<div className="max-w-6xl mt-8 mx-4 lg:mx-8 space-y-8">
{ /* heading */} { /* heading */}
<section className="p-4 w-full overflow-y-scroll"> <section className="w-full overflow-y-scroll">
<p className="text-3xl font-semibold">Markus Thielker</p> <p className="text-3xl font-regular">Markus Thielker</p>
<p className="text-lg font-light text-neutral-500">Software Engineer</p> <p className="text-lg font-light text-neutral-500">Software Engineer</p>
</section> </section>
{ /* card grid */} { /* card grid */}
<section className="p-4 w-full overflow-y-scroll"> <section className="w-full overflow-y-scroll">
<div className="grid grid-cols-8 grid-rows-2 gap-4 h-64"> <div
className="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-8 grid-rows-3 lg:grid-rows-2 gap-4 max-h-92 lg:max-h-72">
{ /* images */} { /* images */}
<Card className="col-span-4 row-span-2 grid grid-cols-5 grid-rows-2 overflow-hidden"> <Card className="col-span-4 row-span-2 grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 grid-rows-1 lg:grid-rows-2 overflow-hidden">
<div className="flex col-span-3 row-span-2 items-center overflow-hidden"> <div className="flex col-span-1 lg:col-span-3 row-span-1 lg:row-span-2 items-center overflow-hidden">
<Image <Image
height="350" height="500"
width="350" width="500"
src="/portrait.png" src="/portrait.png"
className="aspect-square overflow-hidden" className="aspect-square overflow-hidden"
alt="Portrait of Markus Thielker"/> alt="Portrait of Markus Thielker"/>
</div> </div>
<div className="flex col-span-2 row-span-1 items-center overflow-hidden"> <div className="flex col-span-1 lg:col-span-2 row-span-1 items-center overflow-hidden">
<Image <Image
height="225" height="500"
width="225" width="500"
src="/portrait.png" src="/portrait.png"
className="aspect-square overflow-hidden" className="aspect-square overflow-hidden"
alt="Portrait of Markus Thielker"/> alt="Portrait of Markus Thielker"/>
</div> </div>
<div className="flex col-span-2 row-span-1 items-center overflow-hidden"> <div className="hidden md:flex col-span-1 lg:col-span-2 row-span-1 items-center overflow-hidden">
<Image <Image
height="225" height="500"
width="225" width="500"
src="/portrait.png" src="/portrait.png"
className="aspect-square overflow-hidden" className="aspect-square overflow-hidden"
alt="Portrait of Markus Thielker"/> alt="Portrait of Markus Thielker"/>
</div> </div>
</Card> </Card>
{ /* GitHub */} { /* GitHub */}
<Link href="https://github.com/markusthielker" className="col-span-2 row-span-2 h-full"> <Link href="https://github.com/markusthielker"
<Card className="h-full"> className="col-span-2 row-span-1 lg:row-span-2 h-full">
<CardContent className="pt-4"> <Card className="h-full">
<div className="flex flex-row items-center space-x-2"> <CardContent className="pt-4">
<Image <div className="flex flex-row items-center space-x-2">
height="50" <Image
width="50" height="50"
className="rounded-full h-4 w-4" width="50"
src="/github-logo.png" className="rounded-full h-4 w-4"
alt="GitHub"/> src="/github-logo.png"
<span>GitHub</span> alt="GitHub"/>
</div> <span>GitHub</span>
<div className="flex flex-col mt-2 space-y-4">
<div className="flex flex-col text-white/80 -space-y-1">
<span className="text-lg">{profile.name}</span>
<span className="text-md">{profile.followers} Followers</span>
</div> </div>
<span className="text-sm text-white/50">{profile.bio}</span> <div className="flex flex-col mt-2 space-y-4">
</div> <div className="flex flex-col text-white/80 -space-y-1">
<span className="text-lg">{profile.name}</span>
<span className="text-lg">{profile.followers} Followers</span>
</div>
<span className="text-sm text-white/50">{profile.bio}</span>
</div>
</CardContent>
</Card>
</Link>
{ /* age */}
<Card className="col-span-1 row-span-1">
<CardHeader>
<CardDescription>
Age
</CardDescription>
</CardHeader>
<CardContent className="flex flex-col">
<span className="text-lg text-white/80">23 Jahre</span>
<span className="text-sm text-white/80">04. März 2001</span>
</CardContent> </CardContent>
</Card> </Card>
</Link>
{ /* age */} { /* employer */}
<Card className="col-span-1 row-span-1"> <Card className="col-span-1 row-span-1">
<CardHeader> <CardHeader>
<CardDescription> <CardDescription>
Age Employer
</CardDescription> </CardDescription>
</CardHeader> </CardHeader>
<CardContent className="flex flex-col"> <CardContent className="flex flex-col">
<span className="text-md text-white/80">23 Jahre</span> <span className="text-lg text-white/80">None</span>
<span className="text-sm text-white/80">04. März 2001</span> <span className="text-sm text-white/80">Open for work</span>
</CardContent> </CardContent>
</Card> </Card>
{ /* employer */} { /* TODO */}
<Card className="col-span-1 row-span-1"> <Card className="hidden lg:block col-span-2 row-span-1">
<CardHeader> <CardHeader>
<CardDescription> <CardDescription>
Employer Employer
</CardDescription> </CardDescription>
</CardHeader> </CardHeader>
<CardContent className="flex flex-col"> <CardContent>
<span className="text-md text-white/80">Looking for employment</span> {
</CardContent> languagePercentages &&
</Card> <ul>
{Object.entries(languagePercentages).map(([lang, percent]) => (
<li key={lang}>
{lang}: {percent as unknown as string} %
</li>
))}
</ul>
}
</CardContent>
</Card>
</div>
</section>
{ /* TODO */} { /* default content (centered) */}
<Card className="col-span-2 row-span-1"> <section className="h-full grid grid-cols-1 lg:grid-cols-3 gap-4">
</Card> { /* search results column */}
</div> <div className="h-full col-span-1 lg:col-span-2 space-y-8">
</section>
{ /* search results */} <SearchResult
<section className="h-full p-4 grid grid-cols-3"> website="LinkedIn"
<div className="h-full col-span-2 space-y-8"> website_icon_uri="/linkedin-logo.png"
<SearchResult href="https://linkedin.com/in/markusthielker"
website="LinkedIn" title="LinkedIn"
website_icon_uri="/linkedin-logo.png" description="Als erfahrener Softwareentwickler bin ich stolz darauf, innovative Software Lösungen zu schaffen. Neben meiner beruflichen Tätigkeit engagiere ich mich auch in persönlichen Projekten, insbesondere in den Bereichen Web- und Android Full Stack Entwicklung."/>
href="https://linkedin.com/in/markusthielker"
title="LinkedIn" <SearchResult
description="Als erfahrener Softwareentwickler bin ich stolz darauf, innovative Software Lösungen zu schaffen. Neben meiner beruflichen Tätigkeit engagiere ich mich auch in persönlichen Projekten, insbesondere in den Bereichen Web- und Android Full Stack Entwicklung."/> website="GitHub"
<SearchResult website_icon_uri="/github-logo.png"
website="GitHub" href="https://github.com/markusthielker"
website_icon_uri="/github-logo.png" title="Markus Thielker"
href="https://github.com/markusthielker" description="Full stack developer of Kotlin and Java backends with experience in Android, React and Angular frontend development."/>
title="Markus Thielker"
description="Full stack developer of Kotlin and Java backends with experience in Android, React and Angular frontend development."/> <SearchResult
<SearchResult website="Bluesky"
website="Bluesky" website_icon_uri="/bluesky-logo.svg"
website_icon_uri="/bluesky-logo.svg" href="https://bsky.app/profile/thielker.dev"
href="https://bsky.app/profile/thielker.dev" title="Markus Thielker @thielker.dev"
title="Markus Thielker @thielker.dev" description="23 | Software Engineer | links-grün versiffter Veganer"/>
description="23 | Software Engineer | links-grün versiffter Veganer"/>
<SearchResult <SearchResult
website="GitHub" website="GitHub"
website_icon_uri="/github-logo.png" website_icon_uri="/github-logo.png"
href="https://github.com/markusthielker/next-ory" href="https://github.com/markusthielker/next-ory"
title="MarkusThielker/next-ory" title="MarkusThielker/next-ory"
description="☄️ An easy-to-use starting point to self-host Ory Kratos with OAuth2 and OIDC, NextJS authentication UI and admin dashboard (work in progress) styled with TailwindCSS and shadcn/ui" description="An easy-to-use starting point to self-host Ory Kratos with OAuth2 and
links={[ OIDC, NextJS authentication UI and admin dashboard (work in progress) styled with
{ TailwindCSS and shadcn/ui"
text: 'README.md', links={[
href: 'https://github.com/MarkusThielker/next-ory/blob/development/README.md', {
}, text: 'README.md',
{ href: 'https://github.com/MarkusThielker/next-ory/blob/development/README.md',
text: 'Releases', },
href: 'https://github.com/MarkusThielker/next-ory/releases', {
}, text: 'Releases',
]}/> href: 'https://github.com/MarkusThielker/next-ory/releases',
</div> },
</section> ]}/>
</div>
{ /* person info column */}
<div
className="hidden lg:flex flex-col p-4 col-span-1 text-sm space-y-2 border-l border-white/15">
<span className="text-xl">Info</span>
<span className="text-md text-white/60 leading-5">
Markus Thielker ist ein {age} Jahre alter Software Engineer aus Neu-Ulm, Deutschland.
Er entwickelt, nach einiger Jahre Android App Entwicklung, webbasierte Sofwtare. Dabei
verwendet er vorranig Next.js und Angular.
</span>
<div className="flex flex-col">
<span><strong>Degree:</strong> None</span>
<span><strong>Experience:</strong> 2.5 years</span>
<span><strong>Pets:</strong> One dog</span>
<span><strong>Favorite Tech:</strong> Next.js & Kotlin</span>
</div>
</div>
</section>
</div>
</main> </main>
</div> </div>

View file

@ -43,7 +43,7 @@ export function SearchResult(
</Link> </Link>
<div className="flex flex-col"> <div className="flex flex-col">
<Link href={href} className="text-xl text-blue-300">{title}</Link> <Link href={href} className="text-xl text-blue-300">{title}</Link>
<span className="test-sm text-white/80">{description}</span> <span className="text-sm text-white/80 leading-5">{description}</span>
</div> </div>
{ {
links && links.length > 0 && links && links.length > 0 &&