feat: complete editorial overhaul with CMS dynamic labels

Centralized UI labels in Directus, integrated AI Chat and Status into Bento grid, created standalone Books page, and redesigned project sub-pages for consistent high-end aesthetic.
This commit is contained in:
2026-02-16 01:11:06 +01:00
parent 9fd8c25dc6
commit b6eb24f2e8
6 changed files with 324 additions and 379 deletions

View File

@@ -0,0 +1,90 @@
import { getBookReviews } from "@/lib/directus";
import { getLanguageAlternates, toAbsoluteUrl } from "@/lib/seo";
import type { Metadata } from "next";
import { BookOpen, ArrowLeft, Star } from "lucide-react";
import Link from "next/link";
import Image from "next/image";
export const revalidate = 300;
export async function generateMetadata({
params,
}: {
params: Promise<{ locale: string }>;
}): Promise<Metadata> {
const { locale } = await params;
return {
title: locale === "de" ? "Meine Bibliothek" : "My Library",
alternates: {
canonical: toAbsoluteUrl(`/${locale}/books`),
languages: getLanguageAlternates({ pathWithoutLocale: "books" }),
},
};
}
export default async function BooksPage({
params,
}: {
params: Promise<{ locale: string }>;
}) {
const { locale } = await params;
const reviews = await getBookReviews(locale);
return (
<div className="min-h-screen bg-[#fdfcf8] dark:bg-stone-950 pt-32 pb-20 px-6 transition-colors duration-500">
<div className="max-w-7xl mx-auto">
<div className="mb-20">
<Link
href={`/${locale}`}
className="inline-flex items-center gap-2 text-stone-500 hover:text-stone-900 dark:hover:text-white transition-colors mb-10 group"
>
<ArrowLeft size={20} className="group-hover:-translate-x-1 transition-transform" />
<span className="font-bold uppercase tracking-widest text-xs">{locale === 'de' ? 'Zurück' : 'Back Home'}</span>
</Link>
<h1 className="text-6xl md:text-[10rem] font-black tracking-tighter text-stone-900 dark:text-stone-50 leading-[0.85] uppercase">
Library<span className="text-liquid-purple">.</span>
</h1>
<p className="mt-8 text-xl md:text-3xl font-light text-stone-500 dark:text-stone-400 max-w-2xl leading-snug tracking-tight">
{locale === "de"
? "Bücher, die meine Denkweise verändert und mein Wissen erweitert haben."
: "Books that shaped my mindset and expanded my horizons."}
</p>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
{reviews?.map((review) => (
<div
key={review.id}
className="bg-white dark:bg-stone-900 rounded-[2.5rem] p-10 border border-stone-200/60 dark:border-stone-800/60 shadow-sm flex flex-col h-full hover:shadow-xl transition-all"
>
{review.book_image && (
<div className="relative aspect-[3/4] rounded-2xl overflow-hidden mb-8 shadow-xl border-4 border-stone-50 dark:border-stone-800">
<Image src={review.book_image} alt={review.book_title} fill className="object-cover" />
</div>
)}
<div className="flex-1 flex flex-col">
<div className="flex justify-between items-start gap-4 mb-4">
<h3 className="text-2xl font-black text-stone-900 dark:text-white leading-tight">{review.book_title}</h3>
{review.rating && (
<div className="flex items-center gap-1 bg-stone-50 dark:bg-stone-800 px-3 py-1 rounded-full border border-stone-100 dark:border-stone-700">
<Star size={12} className="fill-amber-400 text-amber-400" />
<span className="text-xs font-black">{review.rating}</span>
</div>
)}
</div>
<p className="text-stone-500 dark:text-stone-400 font-bold text-sm mb-6">{review.book_author}</p>
{review.review && (
<div className="mt-auto pt-6 border-t border-stone-50 dark:border-stone-800">
<p className="text-stone-600 dark:text-stone-300 italic font-light leading-relaxed">
&ldquo;{review.review.replace(/<[^>]*>/g, '')}&rdquo;
</p>
</div>
)}
</div>
</div>
))}
</div>
</div>
</div>
);
}

View File

@@ -1,7 +1,7 @@
"use client";
import { motion } from "framer-motion";
import { ExternalLink, Calendar, ArrowLeft, Github as GithubIcon, Share2 } from "lucide-react";
import { ExternalLink, Calendar, ArrowLeft, Github as GithubIcon, Share2, Code } from "lucide-react";
import Link from "next/link";
import { useEffect } from "react";
import ReactMarkdown from "react-markdown";
@@ -23,6 +23,7 @@ export type ProjectDetailData = {
button_live_label?: string | null;
button_github_label?: string | null;
imageUrl?: string | null;
technologies?: string[];
};
export default function ProjectDetailClient({
@@ -36,217 +37,120 @@ export default function ProjectDetailClient({
const tDetail = useTranslations("projects.detail");
const tShared = useTranslations("projects.shared");
// Track page view (non-blocking)
useEffect(() => {
try {
navigator.sendBeacon?.(
"/api/analytics/track",
new Blob(
[
JSON.stringify({
type: "pageview",
projectId: project.id.toString(),
page: `/${locale}/projects/${project.slug}`,
}),
],
{ type: "application/json" },
),
new Blob([JSON.stringify({ type: "pageview", projectId: project.id.toString(), page: `/${locale}/projects/${project.slug}` })], { type: "application/json" }),
);
} catch {
// ignore
}
} catch {}
}, [project.id, project.slug, locale]);
return (
<div className="min-h-screen bg-[#fdfcf8] pt-32 pb-20">
<div className="max-w-4xl mx-auto px-4">
<div className="min-h-screen bg-[#fdfcf8] dark:bg-stone-950 pt-32 pb-20 px-6 transition-colors duration-500">
<div className="max-w-7xl mx-auto">
{/* Navigation */}
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.6 }}
className="mb-8"
<Link
href={`/${locale}/projects`}
className="inline-flex items-center gap-2 text-stone-500 hover:text-stone-900 dark:hover:text-white transition-colors mb-12 group"
>
<Link
href={`/${locale}/projects`}
className="inline-flex items-center space-x-2 text-stone-500 hover:text-stone-900 transition-colors group"
>
<ArrowLeft size={20} className="group-hover:-translate-x-1 transition-transform" />
<span className="font-medium">{tCommon("backToProjects")}</span>
</Link>
</motion.div>
<ArrowLeft size={20} className="group-hover:-translate-x-1 transition-transform" />
<span className="font-bold uppercase tracking-widest text-xs">{tCommon("backToProjects")}</span>
</Link>
{/* Header & Meta */}
<motion.div
initial={{ opacity: 0, y: 30 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.8, delay: 0.1 }}
className="mb-12"
>
<div className="flex flex-col md:flex-row md:items-start md:justify-between gap-4 mb-6">
<h1 className="text-4xl md:text-6xl font-black font-sans text-stone-900 tracking-tight leading-tight">
{project.title}
</h1>
<div className="flex gap-2 shrink-0 pt-2">
{project.featured && (
<span className="px-4 py-1.5 bg-stone-900 text-stone-50 text-xs font-bold rounded-full shadow-sm">
{tShared("featured")}
</span>
)}
<span className="px-4 py-1.5 bg-white border border-stone-200 text-stone-600 text-xs font-medium rounded-full shadow-sm">
{project.category}
</span>
</div>
</div>
<p className="text-xl md:text-2xl text-stone-600 font-light leading-relaxed max-w-3xl mb-8">
{/* Title Section */}
<div className="mb-20">
<h1 className="text-6xl md:text-[10rem] font-black tracking-tighter text-stone-900 dark:text-stone-50 leading-[0.85] uppercase mb-8">
{project.title}<span className="text-liquid-mint">.</span>
</h1>
<p className="text-xl md:text-3xl font-light text-stone-500 dark:text-stone-400 max-w-4xl leading-snug tracking-tight">
{project.description}
</p>
</div>
<div className="flex flex-wrap items-center gap-6 text-stone-500 text-sm border-y border-stone-200 py-6">
<div className="flex items-center space-x-2">
<Calendar size={18} />
<span className="font-mono">
{new Date(project.date).toLocaleDateString(locale || undefined, {
year: "numeric",
month: "long",
day: "numeric",
})}
</span>
</div>
<div className="h-4 w-px bg-stone-300 hidden sm:block"></div>
<div className="flex flex-wrap gap-2">
{project.tags.map((tag) => (
<span key={tag} className="text-stone-700 font-medium">
#{tag}
</span>
))}
{/* Feature Image Box */}
<div className="bg-white dark:bg-stone-900 rounded-[3rem] p-4 md:p-8 border border-stone-200/60 dark:border-stone-800/60 shadow-sm mb-12 overflow-hidden">
<div className="relative aspect-video rounded-[2rem] overflow-hidden border-4 border-stone-50 dark:border-stone-800 shadow-2xl">
{project.imageUrl ? (
<Image src={project.imageUrl} alt={project.title} fill className="object-cover" priority sizes="100vw" />
) : (
<div className="absolute inset-0 bg-stone-100 dark:bg-stone-800 flex items-center justify-center">
<span className="text-[15rem] font-black text-stone-200 dark:text-stone-700">{project.title.charAt(0)}</span>
</div>
)}
</div>
</div>
{/* Bento Details Grid */}
<div className="grid grid-cols-1 lg:grid-cols-12 gap-8">
{/* Main Content */}
<div className="lg:col-span-8 space-y-8">
<div className="bg-white dark:bg-stone-900 rounded-[3rem] p-10 md:p-16 border border-stone-200/60 dark:border-stone-800/60 shadow-sm">
<div className="prose prose-stone dark:prose-invert max-w-none text-lg md:text-xl font-light leading-relaxed">
<ReactMarkdown>{project.content}</ReactMarkdown>
</div>
</div>
</div>
</motion.div>
{/* Featured Image / Fallback */}
<motion.div
initial={{ opacity: 0, scale: 0.95 }}
animate={{ opacity: 1, scale: 1 }}
transition={{ duration: 0.8, delay: 0.2 }}
className="mb-16 rounded-2xl overflow-hidden shadow-2xl bg-stone-100 aspect-video relative"
>
{project.imageUrl ? (
<Image
src={project.imageUrl}
alt={project.title}
fill
className="object-cover"
priority
sizes="(max-width: 896px) 100vw, 896px"
/>
) : (
<div className="absolute inset-0 bg-gradient-to-br from-stone-200 to-stone-300 flex items-center justify-center">
<span className="text-9xl font-serif font-bold text-stone-500/20 select-none">
{project.title.charAt(0)}
</span>
</div>
)}
</motion.div>
{/* Sidebar Boxes */}
<div className="lg:col-span-4 space-y-8">
{/* Content & Sidebar Layout */}
<div className="grid grid-cols-1 lg:grid-cols-3 gap-12">
{/* Main Content */}
<motion.div
initial={{ opacity: 0, y: 30 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.8, delay: 0.3 }}
className="lg:col-span-2"
>
<div className="markdown prose prose-stone max-w-none prose-lg prose-headings:font-bold prose-headings:tracking-tight prose-a:text-stone-900 prose-a:decoration-stone-300 hover:prose-a:decoration-stone-900 prose-img:rounded-xl prose-img:shadow-lg">
<ReactMarkdown
components={{
h1: ({ children }) => (
<h1 className="text-3xl font-bold text-stone-900 mt-8 mb-4">{children}</h1>
),
h2: ({ children }) => (
<h2 className="text-2xl font-bold text-stone-900 mt-8 mb-4">{children}</h2>
),
p: ({ children }) => <p className="text-stone-700 leading-relaxed mb-6">{children}</p>,
li: ({ children }) => <li className="text-stone-700">{children}</li>,
code: ({ children }) => (
<code className="bg-stone-100 text-stone-800 px-1.5 py-0.5 rounded text-sm font-mono font-medium">
{children}
</code>
),
pre: ({ children }) => (
<pre className="bg-stone-900 text-stone-50 p-6 rounded-xl overflow-x-auto my-6 shadow-lg">
{children}
</pre>
),
}}
>
{project.content}
</ReactMarkdown>
</div>
</motion.div>
{/* Sidebar / Actions */}
<motion.div
initial={{ opacity: 0, x: 20 }}
animate={{ opacity: 1, x: 0 }}
transition={{ duration: 0.8, delay: 0.4 }}
className="lg:col-span-1 space-y-8"
>
<div className="bg-white/50 backdrop-blur-xl border border-white/60 p-6 rounded-2xl shadow-sm sticky top-32">
<h3 className="font-bold text-stone-900 mb-4 flex items-center gap-2">
<Share2 size={18} />
{tDetail("links")}
</h3>
<div className="space-y-3">
{project.live && project.live.trim() && project.live !== "#" ? (
<a
href={project.live}
target="_blank"
rel="noopener noreferrer"
className="flex items-center justify-between w-full px-4 py-3 bg-stone-900 text-stone-50 rounded-xl font-medium hover:bg-stone-800 hover:scale-[1.02] transition-all shadow-md group"
>
{/* Quick Links Box */}
<div className="bg-stone-900 dark:bg-stone-800 rounded-[3rem] p-10 border border-stone-800 dark:border-stone-700 shadow-2xl text-white">
<h3 className="text-xl font-black mb-8 flex items-center gap-2 uppercase tracking-widest text-liquid-mint">Links</h3>
<div className="space-y-4">
{project.live && (
<a href={project.live} target="_blank" rel="noopener noreferrer" className="flex items-center justify-between w-full p-5 bg-white text-stone-900 rounded-2xl font-black hover:scale-105 transition-transform group">
<span>{project.button_live_label || tDetail("liveDemo")}</span>
<ExternalLink size={18} className="group-hover:translate-x-1 transition-transform" />
<ExternalLink size={20} className="group-hover:translate-x-1 transition-transform" />
</a>
) : (
<div className="px-4 py-3 bg-stone-100 text-stone-400 rounded-xl font-medium text-sm text-center border border-stone-200 cursor-not-allowed">
{tDetail("liveNotAvailable")}
</div>
)}
{project.github && project.github.trim() && project.github !== "#" ? (
<a
href={project.github}
target="_blank"
rel="noopener noreferrer"
className="flex items-center justify-between w-full px-4 py-3 bg-white border border-stone-200 text-stone-700 rounded-xl font-medium hover:bg-stone-50 hover:text-stone-900 hover:border-stone-300 transition-all shadow-sm group"
>
{project.github && (
<a href={project.github} target="_blank" rel="noopener noreferrer" className="flex items-center justify-between w-full p-5 bg-stone-800 text-white border border-stone-700 rounded-2xl font-black hover:bg-stone-700 transition-colors group">
<span>{project.button_github_label || tDetail("viewSource")}</span>
<GithubIcon size={18} className="group-hover:rotate-12 transition-transform" />
<GithubIcon size={20} className="group-hover:rotate-12 transition-transform" />
</a>
) : null}
)}
</div>
</div>
<div className="mt-8 pt-6 border-t border-stone-100">
<h4 className="text-xs font-bold text-stone-400 uppercase tracking-wider mb-3">{tDetail("techStack")}</h4>
<div className="flex flex-wrap gap-2">
{project.tags.map((tag) => (
<span
key={tag}
className="px-2.5 py-1 bg-stone-100 text-stone-600 text-xs font-medium rounded-md border border-stone-200"
>
{tag}
</span>
))}
{/* Tech Stack Box */}
<div className="bg-white dark:bg-stone-900 rounded-[3rem] p-10 border border-stone-200/60 dark:border-stone-800/60 shadow-sm">
<h3 className="text-xl font-black mb-8 flex items-center gap-2 uppercase tracking-widest text-stone-400">Stack</h3>
<div className="flex flex-wrap gap-2">
{project.tags.map((tag) => (
<span key={tag} className="px-4 py-2 bg-stone-50 dark:bg-stone-800 rounded-xl text-xs font-bold border border-stone-100 dark:border-stone-700">
{tag}
</span>
))}
</div>
</div>
{/* Meta Stats */}
<div className="bg-liquid-mint/5 dark:bg-stone-900 rounded-[3rem] p-10 border border-liquid-mint/20 dark:border-stone-800/60">
<div className="flex flex-col gap-6">
<div className="flex items-center gap-4">
<div className="w-10 h-10 rounded-full bg-white dark:bg-stone-800 flex items-center justify-center shadow-sm"><Calendar size={18} className="text-liquid-mint" /></div>
<div>
<p className="text-[10px] font-black uppercase tracking-widest text-stone-400">Release Date</p>
<p className="font-bold text-stone-900 dark:text-stone-100">{new Date(project.date).toLocaleDateString(locale, { year: 'numeric', month: 'long' })}</p>
</div>
</div>
<div className="flex items-center gap-4">
<div className="w-10 h-10 rounded-full bg-white dark:bg-stone-800 flex items-center justify-center shadow-sm"><Code size={18} className="text-liquid-sky" /></div>
<div>
<p className="text-[10px] font-black uppercase tracking-widest text-stone-400">Category</p>
<p className="font-bold text-stone-900 dark:text-stone-100">{project.category}</p>
</div>
</div>
</div>
</div>
</motion.div>
</div>
</div>
</div>
</div>
);
}

View File

@@ -1,94 +1,14 @@
import { NextRequest, NextResponse } from 'next/server';
import { getLocalizedMessage } from '@/lib/i18n-loader';
import enMessages from '@/messages/en.json';
import deMessages from '@/messages/de.json';
import { NextRequest, NextResponse } from "next/server";
import { getMessages } from "@/lib/directus";
// Cache für 5 Minuten
export const revalidate = 300;
const messagesMap = { en: enMessages, de: deMessages };
/**
* GET /api/messages?locale=en
* Lädt ALLE Messages aus Directus + JSON Fallback
* Wird von next-intl als messages source verwendet
*/
export async function GET(req: NextRequest) {
const locale = req.nextUrl.searchParams.get('locale') || 'en';
// Normalize locale (de-DE -> de)
const normalizedLocale = locale.startsWith('de') ? 'de' : 'en';
export async function GET(request: NextRequest) {
const { searchParams } = new URL(request.url);
const locale = searchParams.get("locale") || "en";
try {
// Starte mit JSON als Basis
const jsonMessages = messagesMap[normalizedLocale as 'en' | 'de'];
// Clone das Objekt
const messages = JSON.parse(JSON.stringify(jsonMessages));
// Flatten alle Keys
const allKeys = getAllKeys(messages);
// Lade jeden Key aus Directus (überschreibt JSON wenn vorhanden)
await Promise.all(
allKeys.map(async (key) => {
try {
const value = await getLocalizedMessage(key, locale);
if (value && value !== key) {
// Überschreibe den Wert im messages Objekt
setNestedValue(messages, key, value);
}
} catch (error) {
// Fallback auf JSON Wert (schon vorhanden)
}
})
);
return NextResponse.json(messages, {
headers: {
'Cache-Control': 'public, s-maxage=300, stale-while-revalidate=600',
},
});
const messages = await getMessages(locale);
return NextResponse.json({ messages });
} catch (error) {
console.error('Messages API error:', error);
// Fallback: Return nur JSON messages
return NextResponse.json(messagesMap[normalizedLocale as 'en' | 'de'], {
headers: {
'Cache-Control': 'public, s-maxage=60',
},
});
return NextResponse.json({ messages: {} }, { status: 500 });
}
}
// Helper: Sammle alle Keys aus verschachteltem Objekt
function getAllKeys(obj: any, prefix = ''): string[] {
const keys: string[] = [];
for (const [key, value] of Object.entries(obj)) {
const fullKey = prefix ? `${prefix}.${key}` : key;
if (value && typeof value === 'object' && !Array.isArray(value)) {
keys.push(...getAllKeys(value, fullKey));
} else {
keys.push(fullKey);
}
}
return keys;
}
// Helper: Setze Wert in verschachteltem Objekt
function setNestedValue(obj: any, path: string, value: any) {
const keys = path.split('.');
const lastKey = keys.pop()!;
let current = obj;
for (const key of keys) {
if (!(key in current)) {
current[key] = {};
}
current = current[key];
}
current[lastKey] = value;
}

View File

@@ -1,7 +1,7 @@
"use client";
import { useState, useEffect } from "react";
import { Globe, Server, Wrench, Shield, Gamepad2, Code, Activity, Lightbulb, User, BookOpen } from "lucide-react";
import { Globe, Server, Wrench, Shield, Gamepad2, Code, Activity, Lightbulb, User, BookOpen, MessageSquare, ExternalLink, ArrowRight } from "lucide-react";
import { useLocale, useTranslations } from "next-intl";
import type { JSONContent } from "@tiptap/react";
import RichTextClient from "./RichTextClient";
@@ -9,6 +9,8 @@ import CurrentlyReading from "./CurrentlyReading";
import ReadBooks from "./ReadBooks";
import { motion } from "framer-motion";
import { TechStackCategory, Hobby } from "@/lib/directus";
import Link from "next/link";
import ActivityFeed from "./ActivityFeed";
const iconMap: Record<string, any> = {
Globe, Server, Code, Wrench, Shield, Activity, Lightbulb, Gamepad2
@@ -20,7 +22,6 @@ const About = () => {
const [cmsDoc, setCmsDoc] = useState<JSONContent | null>(null);
const [techStack, setTechStack] = useState<TechStackCategory[]>([]);
const [hobbies, setHobbies] = useState<Hobby[]>([]);
const [loading, setLoading] = useState(true);
useEffect(() => {
const fetchData = async () => {
@@ -36,61 +37,58 @@ const About = () => {
if (techData?.techStack) setTechStack(techData.techStack);
const hobbiesData = await hobbiesRes.json();
if (hobbiesData?.hobbies) setHobbies(hobbiesData.hobbies);
} catch (error) {
console.error(error);
} finally {
setLoading(false);
}
} catch (error) {}
};
fetchData();
}, [locale]);
return (
<section id="about" className="py-32 px-6 bg-[#fdfcf8] dark:bg-stone-950 transition-colors duration-500 overflow-hidden">
<section id="about" className="py-32 px-6 bg-[#fdfcf8] dark:bg-stone-950 transition-colors duration-500">
<div className="max-w-7xl mx-auto">
<div className="grid grid-cols-1 md:grid-cols-12 gap-8">
<div className="grid grid-cols-1 md:grid-cols-12 gap-6 md:gap-8">
{/* 1. Large Bio Text */}
<motion.div
initial={{ opacity: 0, y: 30 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
className="md:col-span-8 bg-white dark:bg-stone-900 rounded-[3rem] p-12 border border-stone-200/60 dark:border-stone-800/60 shadow-sm"
className="md:col-span-8 bg-white dark:bg-stone-900 rounded-[3rem] p-10 md:p-16 border border-stone-200/60 dark:border-stone-800/60 shadow-sm"
>
<div className="space-y-8">
<h2 className="text-4xl md:text-6xl font-black text-stone-900 dark:text-stone-50 tracking-tighter">
<h2 className="text-4xl md:text-7xl font-black text-stone-900 dark:text-stone-50 tracking-tighter">
{t("title")}
</h2>
<div className="prose prose-stone dark:prose-invert max-w-none text-xl font-light leading-relaxed text-stone-600 dark:text-stone-400">
<div className="prose prose-stone dark:prose-invert max-w-none text-xl md:text-2xl font-light leading-relaxed text-stone-600 dark:text-stone-400">
{cmsDoc ? <RichTextClient doc={cmsDoc} /> : <p>{t("p1")} {t("p2")}</p>}
</div>
<div className="pt-6 flex flex-wrap gap-4">
<div className="bg-liquid-mint/10 px-6 py-3 rounded-2xl border border-liquid-mint/20">
<p className="text-[10px] font-black uppercase tracking-widest text-liquid-mint mb-1">{t("funFactTitle")}</p>
<p className="text-sm font-bold opacity-80">{t("funFactBody")}</p>
<div className="pt-8">
<div className="inline-block bg-liquid-mint/10 px-8 py-4 rounded-[2rem] border border-liquid-mint/20">
<p className="text-[10px] font-black uppercase tracking-[0.2em] text-liquid-mint mb-2">{t("funFactTitle")}</p>
<p className="text-base font-bold opacity-90">{t("funFactBody")}</p>
</div>
</div>
</div>
</motion.div>
{/* 2. Reading Log */}
{/* 2. Doing Right Now (Status) */}
<motion.div
initial={{ opacity: 0, y: 30 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ delay: 0.1 }}
className="md:col-span-4 bg-white dark:bg-stone-900 rounded-[3rem] p-12 border border-stone-200/60 dark:border-stone-800/60 shadow-sm flex flex-col"
className="md:col-span-4 bg-stone-900 dark:bg-stone-800 rounded-[3rem] p-10 border border-stone-800 dark:border-stone-700 shadow-2xl text-white overflow-hidden relative"
>
<h3 className="text-2xl font-black text-stone-900 dark:text-stone-50 mb-8 flex items-center gap-3 uppercase tracking-tighter">
<BookOpen className="text-liquid-purple" size={24} /> Reading
</h3>
<div className="space-y-10 overflow-y-auto pr-2 scrollbar-hide">
<CurrentlyReading />
<div className="pt-10 border-t border-stone-100 dark:border-stone-800">
<ReadBooks />
<div className="relative z-10 h-full flex flex-col">
<h3 className="text-xl font-black mb-6 flex items-center gap-2 uppercase tracking-widest text-liquid-mint">
<Activity size={20} /> Doing Now
</h3>
<div className="flex-1">
<ActivityFeed />
</div>
</div>
{/* Ambient Background for Status */}
<div className="absolute top-0 right-0 w-32 h-32 bg-liquid-mint/20 blur-3xl rounded-full" />
</motion.div>
{/* 3. Tech Stack */}
@@ -99,7 +97,7 @@ const About = () => {
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ delay: 0.2 }}
className="md:col-span-12 bg-white dark:bg-stone-900 rounded-[3rem] p-12 border border-stone-200/60 dark:border-stone-800/60 shadow-sm"
className="md:col-span-12 lg:col-span-9 bg-white dark:bg-stone-900 rounded-[3rem] p-10 md:p-16 border border-stone-200/60 dark:border-stone-800/60 shadow-sm"
>
<div className="grid grid-cols-1 md:grid-cols-4 gap-12">
{techStack.map((cat) => (
@@ -117,27 +115,70 @@ const About = () => {
</div>
</motion.div>
{/* 4. Hobbies */}
{/* 4. AI Chat Box */}
<motion.div
initial={{ opacity: 0, y: 30 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ delay: 0.3 }}
className="md:col-span-12 bg-liquid-purple/5 dark:bg-stone-900 rounded-[3rem] p-12 border border-liquid-purple/20 dark:border-stone-800/60 flex flex-col md:flex-row justify-between items-center gap-8"
className="md:col-span-12 lg:col-span-3 bg-gradient-to-br from-liquid-purple/20 to-liquid-sky/20 dark:from-liquid-purple/10 dark:to-liquid-sky/10 rounded-[3rem] p-10 border border-liquid-purple/30 dark:border-stone-800/60 flex flex-col justify-between group cursor-pointer shadow-sm hover:shadow-xl transition-all"
onClick={() => {
const chatBtn = document.querySelector('[aria-label="Open chat"]') as HTMLElement;
if (chatBtn) chatBtn.click();
}}
>
<h3 className="text-2xl font-black text-stone-900 dark:text-stone-50 flex items-center gap-3">
<Gamepad2 className="text-liquid-purple" size={28} /> {t("hobbiesTitle")}
</h3>
<div className="flex flex-wrap justify-center gap-4">
{hobbies.map((hobby) => {
const Icon = iconMap[hobby.icon] || Lightbulb;
return (
<div key={hobby.id} className="flex items-center gap-3 px-6 py-3 bg-white dark:bg-stone-800 rounded-2xl shadow-sm border border-stone-100 dark:border-stone-700">
<Icon size={18} className="text-liquid-purple" />
<span className="text-xs font-bold uppercase tracking-wider">{hobby.title}</span>
</div>
)
})}
<div className="w-14 h-14 rounded-2xl bg-white dark:bg-stone-800 flex items-center justify-center shadow-lg mb-6 group-hover:scale-110 transition-transform">
<MessageSquare className="text-liquid-purple" size={28} />
</div>
<div>
<h3 className="text-2xl font-black text-stone-900 dark:text-stone-50 mb-2">AI Assistant</h3>
<p className="text-sm text-stone-600 dark:text-stone-400 leading-relaxed">Have questions about my projects or experience? Ask my digital twin.</p>
</div>
<div className="mt-8 flex items-center gap-2 font-bold text-xs uppercase tracking-widest text-liquid-purple">
Start Chat <ArrowRight size={16} className="group-hover:translate-x-2 transition-transform" />
</div>
</motion.div>
{/* 5. Reading & Hobbies Archive Row */}
<motion.div
initial={{ opacity: 0, y: 30 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ delay: 0.4 }}
className="md:col-span-12 grid grid-cols-1 md:grid-cols-2 gap-8"
>
{/* Reading Mini-Box */}
<div className="bg-white dark:bg-stone-900 rounded-[3rem] p-10 border border-stone-200/60 dark:border-stone-800/60 shadow-sm flex flex-col h-full">
<div className="flex justify-between items-center mb-10">
<h3 className="text-2xl font-black text-stone-900 dark:text-stone-50 flex items-center gap-3 uppercase tracking-tighter">
<BookOpen className="text-liquid-purple" size={24} /> Reading
</h3>
<Link href={`/${locale}/books`} className="text-xs font-bold uppercase tracking-widest text-stone-400 hover:text-stone-900 dark:hover:text-stone-100 flex items-center gap-2 transition-colors">
View Library <ArrowRight size={14} />
</Link>
</div>
<div className="space-y-8">
<CurrentlyReading />
</div>
</div>
{/* Hobbies Mini-Box */}
<div className="bg-white dark:bg-stone-900 rounded-[3rem] p-10 border border-stone-200/60 dark:border-stone-800/60 shadow-sm flex flex-col justify-between">
<div className="flex flex-wrap gap-4 mb-8">
{hobbies.map((hobby) => {
const Icon = iconMap[hobby.icon] || Lightbulb;
return (
<div key={hobby.id} className="flex items-center gap-3 px-6 py-3 bg-stone-50 dark:bg-stone-800/50 rounded-2xl border border-stone-100 dark:border-stone-700/50 shadow-sm">
<Icon size={18} className="text-liquid-mint" />
<span className="text-xs font-black uppercase tracking-wider">{hobby.title}</span>
</div>
)
})}
</div>
<div className="space-y-2">
<h3 className="text-2xl font-black text-stone-900 dark:text-stone-50">{t("hobbiesTitle")}</h3>
<p className="text-stone-500 font-light">Things that spark my curiosity outside of software engineering.</p>
</div>
</div>
</motion.div>

View File

@@ -1,17 +1,34 @@
"use client";
import { motion } from "framer-motion";
import { ArrowDown, Github, Linkedin, Mail, Code, Zap, Globe } from "lucide-react";
import { ArrowDown, Github, Linkedin, Mail, Code, Zap } from "lucide-react";
import { useLocale, useTranslations } from "next-intl";
import Image from "next/image";
import { useEffect, useState } from "react";
const Hero = () => {
const locale = useLocale();
const t = useTranslations("home.hero");
const [cmsMessages, setCmsMessages] = useState<Record<string, string>>({});
useEffect(() => {
(async () => {
try {
const res = await fetch(`/api/messages?locale=${locale}`);
if (res.ok) {
const data = await res.json();
setCmsMessages(data.messages || {});
}
} catch {}
})();
}, [locale]);
// Helper to get CMS text or fallback
const getLabel = (key: string, fallback: string) => cmsMessages[key] || fallback;
return (
<section className="relative min-h-screen flex flex-col items-center justify-center overflow-hidden bg-stone-50 dark:bg-stone-950 px-6 transition-colors duration-500">
{/* Background Decor */}
{/* Liquid Ambient Background */}
<div className="absolute inset-0 pointer-events-none">
<motion.div
animate={{ scale: [1, 1.1, 1], opacity: [0.15, 0.25, 0.15] }}
@@ -29,33 +46,33 @@ const Hero = () => {
<div className="flex flex-col lg:flex-row items-center gap-12 lg:gap-24">
{/* Left: Text Content */}
<div className="flex-1 text-center lg:text-left space-y-8">
<div className="flex-1 text-center lg:text-left space-y-10">
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5 }}
className="inline-flex items-center gap-3 px-4 py-2 rounded-full bg-white dark:bg-stone-900 border border-stone-200 dark:border-stone-800 shadow-sm"
className="inline-flex items-center gap-3 px-5 py-2.5 rounded-full bg-white dark:bg-stone-900 border border-stone-200 dark:border-stone-800 shadow-sm"
>
<span className="w-2 h-2 bg-green-500 rounded-full animate-pulse" />
<span className="font-mono text-[10px] font-bold uppercase tracking-[0.2em] text-stone-500">Student & Self-Hoster</span>
<span className="w-2.5 h-2.5 bg-green-500 rounded-full animate-pulse" />
<span className="font-mono text-[10px] font-black uppercase tracking-[0.3em] text-stone-500">{getLabel("hero.badge", "Student & Self-Hoster")}</span>
</motion.div>
<h1 className="text-5xl md:text-8xl font-black tracking-tighter leading-[0.85] text-stone-900 dark:text-stone-50">
<h1 className="text-6xl md:text-[9.5rem] font-black tracking-tighter leading-[0.8] text-stone-900 dark:text-stone-50 uppercase">
<motion.span
initial={{ opacity: 0, x: -50 }}
animate={{ opacity: 1, x: 0 }}
transition={{ duration: 0.8, delay: 0.1 }}
className="block"
>
Building Stuff.
{getLabel("hero.line1", "Building")}
</motion.span>
<motion.span
initial={{ opacity: 0, x: -50 }}
animate={{ opacity: 1, x: 0 }}
transition={{ duration: 0.8, delay: 0.2 }}
className="block text-transparent bg-clip-text bg-gradient-to-r from-liquid-mint via-liquid-sky to-liquid-purple"
className="block text-transparent bg-clip-text bg-gradient-to-r from-liquid-mint via-liquid-sky to-liquid-purple pb-4"
>
Running Servers.
{getLabel("hero.line2", "Stuff.")}
</motion.span>
</h1>
@@ -63,7 +80,7 @@ const Hero = () => {
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ duration: 1, delay: 0.4 }}
className="text-lg md:text-xl text-stone-600 dark:text-stone-400 max-w-xl mx-auto lg:mx-0 font-light leading-relaxed"
className="text-xl md:text-2xl text-stone-600 dark:text-stone-400 max-w-xl mx-auto lg:mx-0 font-light leading-relaxed tracking-tight"
>
{t("description")}
</motion.p>
@@ -72,10 +89,11 @@ const Hero = () => {
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.6, delay: 0.6 }}
className="flex flex-col sm:flex-row items-center gap-6 justify-center lg:justify-start pt-4"
className="flex flex-col sm:flex-row items-center gap-8 justify-center lg:justify-start pt-4"
>
<a href="#projects" className="px-10 py-4 bg-stone-900 dark:bg-stone-50 text-white dark:text-stone-900 rounded-2xl font-black text-sm tracking-widest hover:scale-105 active:scale-95 transition-all shadow-xl">
{t("ctaWork").toUpperCase()}
<a href="#projects" className="group relative px-12 py-5 bg-stone-900 dark:bg-stone-50 text-white dark:text-stone-900 rounded-3xl font-black text-xs uppercase tracking-[0.2em] hover:scale-105 active:scale-95 transition-all shadow-2xl">
<div className="absolute inset-0 bg-white/10 -translate-x-full group-hover:translate-x-full transition-transform duration-1000" />
{t("ctaWork")}
</a>
<div className="flex gap-4">
{[
@@ -83,48 +101,40 @@ const Hero = () => {
{ icon: Linkedin, href: "https://linkedin.com/in/dkonkol" },
{ icon: Mail, href: "mailto:contact@dk0.dev" }
].map((social, i) => (
<a key={i} href={social.href} className="p-4 bg-white dark:bg-stone-900 border border-stone-200 dark:border-stone-800 rounded-2xl text-stone-400 hover:text-stone-900 dark:hover:text-stone-100 transition-all shadow-sm">
<social.icon size={20} />
<a key={i} href={social.href} target="_blank" rel="noopener noreferrer" className="p-5 bg-white dark:bg-stone-900 border border-stone-200 dark:border-stone-800 rounded-[1.5rem] text-stone-400 hover:text-stone-900 dark:hover:text-white transition-all shadow-sm hover:shadow-xl">
<social.icon size={22} />
</a>
))}
</div>
</motion.div>
</div>
{/* Right: The Photo (Visible Immediately) */}
{/* Right: The Photo */}
<motion.div
initial={{ opacity: 0, scale: 0.8, rotate: 5 }}
animate={{ opacity: 1, scale: 1, rotate: 0 }}
transition={{ duration: 1, ease: [0.25, 0.1, 0.25, 1] }}
className="relative w-72 h-72 md:w-[450px] md:h-[450px] shrink-0"
className="relative w-72 h-72 md:w-[500px] md:h-[500px] shrink-0 mt-12 lg:mt-0"
>
<div className="absolute inset-0 bg-gradient-to-tr from-liquid-mint to-liquid-purple rounded-[4rem] rotate-6 scale-95 opacity-20 blur-2xl animate-pulse" />
<div className="relative w-full h-full rounded-[3.5rem] overflow-hidden border-[12px] border-white dark:border-stone-900 shadow-[0_40px_80px_-15px_rgba(0,0,0,0.3)]">
<Image
src="/images/me.jpg"
alt="Dennis Konkol"
fill
className="object-cover"
priority
/>
<div className="absolute inset-0 bg-gradient-to-tr from-liquid-mint to-liquid-purple rounded-[5rem] rotate-12 scale-90 opacity-20 blur-3xl animate-pulse" />
<div className="relative w-full h-full rounded-[4rem] overflow-hidden border-[16px] border-white dark:border-stone-900 shadow-[0_50px_100px_-20px_rgba(0,0,0,0.4)]">
<Image src="/images/me.jpg" alt="Dennis Konkol" fill className="object-cover" priority />
</div>
{/* Minimal Badge */}
<div className="absolute -bottom-4 -left-4 bg-white dark:bg-stone-800 px-6 py-3 rounded-2xl shadow-2xl border border-stone-100 dark:border-stone-700">
<span className="font-mono text-xs font-black tracking-tighter">dk<span className="text-red-500">0</span>.dev</span>
<div className="absolute -bottom-6 -left-6 bg-white dark:bg-stone-800 px-8 py-4 rounded-[2rem] shadow-2xl border border-stone-100 dark:border-stone-700">
<span className="font-mono text-sm font-black tracking-tighter uppercase">dk<span className="text-red-500">0</span>.dev</span>
</div>
</motion.div>
</div>
</div>
{/* Scroll Down */}
<motion.div
animate={{ y: [0, 10, 0] }}
animate={{ y: [0, 15, 0] }}
transition={{ duration: 2, repeat: Infinity }}
className="absolute bottom-10 left-1/2 -translate-x-1/2 hidden md:block"
className="absolute bottom-10 left-1/2 -translate-x-1/2 hidden md:flex flex-col items-center gap-4"
>
<ArrowDown size={20} className="text-stone-300" />
<div className="w-px h-16 bg-gradient-to-b from-stone-300 dark:from-stone-700 to-transparent" />
</motion.div>
</section>
);

View File

@@ -91,54 +91,34 @@ async function directusRequest<T>(
}
}
export async function getMessage(key: string, locale: string): Promise<string | null> {
// Note: messages collection doesn't exist in Directus yet
// The app uses JSON files as fallback via i18n-loader
// Return null to skip Directus and use JSON fallback directly
return null;
/* Commented out until messages collection is created in Directus
export async function getMessages(locale: string): Promise<Record<string, string>> {
const directusLocale = toDirectusLocale(locale);
// GraphQL Query für Directus Native Translations
// Hole alle translations, filter client-side da GraphQL filter komplex ist
const query = `
query {
messages(filter: {key: {_eq: "${key}"}}, limit: 1) {
messages {
key
translations {
value
languages_code {
code
}
languages_code { code }
}
}
}
`;
try {
const result = await directusRequest(
'',
{ body: { query } }
);
const result = await directusRequest('', { body: { query } });
const messages = (result as any)?.messages || [];
const dictionary: Record<string, string> = {};
const messages = (result as any)?.messages;
if (!messages || messages.length === 0) {
return null;
}
messages.forEach((m: any) => {
const trans = m.translations?.find((t: any) => t.languages_code?.code === directusLocale);
if (trans?.value) dictionary[m.key] = trans.value;
});
// Hole die Translation für die gewünschte Locale (client-side filter)
const translations = messages[0]?.translations || [];
const translation = translations.find((t: any) =>
t.languages_code?.code === directusLocale
);
return translation?.value || null;
return dictionary;
} catch (error) {
console.error(`Failed to fetch message ${key} (${locale}):`, error);
return null;
return {};
}
*/
}
export async function getContentPage(