Separated bio and photo into a title row, increased padding to p-12 for all items, and reorganized the bento grid for better flow and spacing.
204 lines
9.2 KiB
TypeScript
204 lines
9.2 KiB
TypeScript
"use client";
|
|
|
|
import { useState, useEffect } from "react";
|
|
import { Globe, Server, Wrench, Shield, Gamepad2, Code, Activity, Lightbulb, MapPin, User, BookOpen, ArrowRight } from "lucide-react";
|
|
import { useLocale, useTranslations } from "next-intl";
|
|
import type { JSONContent } from "@tiptap/react";
|
|
import RichTextClient from "./RichTextClient";
|
|
import CurrentlyReading from "./CurrentlyReading";
|
|
import ReadBooks from "./ReadBooks";
|
|
import { motion } from "framer-motion";
|
|
import { TechStackCategory, Hobby } from "@/lib/directus";
|
|
import Image from "next/image";
|
|
|
|
const iconMap: Record<string, any> = {
|
|
Globe, Server, Code, Wrench, Shield, Activity, Lightbulb, Gamepad2
|
|
};
|
|
|
|
const About = () => {
|
|
const locale = useLocale();
|
|
const t = useTranslations("home.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 () => {
|
|
try {
|
|
const [cmsRes, techRes, hobbiesRes] = await Promise.all([
|
|
fetch(`/api/content/page?key=home-about&locale=${locale}`),
|
|
fetch(`/api/tech-stack?locale=${locale}`),
|
|
fetch(`/api/hobbies?locale=${locale}`)
|
|
]);
|
|
const cmsData = await cmsRes.json();
|
|
if (cmsData?.content?.content) setCmsDoc(cmsData.content.content as JSONContent);
|
|
const techData = await techRes.json();
|
|
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);
|
|
}
|
|
};
|
|
fetchData();
|
|
}, [locale]);
|
|
|
|
return (
|
|
<section id="about" className="py-32 px-6 bg-[#fdfcf8] dark:bg-stone-950 transition-colors duration-500 overflow-hidden">
|
|
<div className="max-w-7xl mx-auto">
|
|
|
|
{/* --- STAGE 1: THE TITLE PAGE (BIO & PHOTO) --- */}
|
|
<div className="flex flex-col lg:flex-row gap-16 lg:gap-24 items-center mb-32">
|
|
{/* Large prominent photo */}
|
|
<motion.div
|
|
initial={{ opacity: 0, x: -50 }}
|
|
whileInView={{ opacity: 1, x: 0 }}
|
|
viewport={{ once: true }}
|
|
transition={{ duration: 0.8, ease: [0.25, 0.1, 0.25, 1] }}
|
|
className="relative w-full max-w-[500px] aspect-[4/5] shrink-0"
|
|
>
|
|
<div className="absolute inset-0 bg-liquid-mint/20 rounded-[3rem] -rotate-3 translate-x-4 translate-y-4 blur-2xl"></div>
|
|
<div className="relative w-full h-full rounded-[2.5rem] overflow-hidden border-8 border-white dark:border-stone-900 shadow-2xl">
|
|
<Image
|
|
src="/images/me.jpg"
|
|
alt="Dennis Konkol"
|
|
fill
|
|
className="object-cover scale-105 hover:scale-100 transition-transform duration-1000"
|
|
priority
|
|
/>
|
|
</div>
|
|
{/* Location Tag Floating */}
|
|
<div className="absolute -bottom-6 -right-6 bg-white dark:bg-stone-800 p-6 rounded-3xl shadow-xl border border-stone-100 dark:border-stone-700 hidden md:block">
|
|
<div className="flex items-center gap-3">
|
|
<div className="w-10 h-10 rounded-full bg-liquid-sky/10 flex items-center justify-center">
|
|
<MapPin className="text-liquid-sky" size={20} />
|
|
</div>
|
|
<div>
|
|
<p className="text-[10px] font-bold uppercase tracking-widest text-stone-400">Based in</p>
|
|
<p className="font-black text-stone-900 dark:text-stone-50">Osnabrück, GER</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</motion.div>
|
|
|
|
{/* Large Bio Content */}
|
|
<motion.div
|
|
initial={{ opacity: 0, y: 30 }}
|
|
whileInView={{ opacity: 1, y: 0 }}
|
|
viewport={{ once: true }}
|
|
transition={{ duration: 0.8, delay: 0.2 }}
|
|
className="flex-1 space-y-10"
|
|
>
|
|
<div className="space-y-4">
|
|
<span className="text-liquid-mint font-black uppercase tracking-[0.3em] text-xs">A bit about me</span>
|
|
<h2 className="text-5xl md:text-8xl font-black text-stone-900 dark:text-stone-50 tracking-tighter leading-[0.85]">
|
|
Digital <br /> Architect.
|
|
</h2>
|
|
</div>
|
|
|
|
<div className="prose prose-stone dark:prose-invert max-w-2xl text-xl md:text-2xl font-light leading-relaxed text-stone-600 dark:text-stone-400">
|
|
{cmsDoc ? (
|
|
<RichTextClient doc={cmsDoc} />
|
|
) : (
|
|
<p>
|
|
Hey, I'm Dennis. I build performant web and mobile applications with a focus on clean code and exceptional user experience.
|
|
</p>
|
|
)}
|
|
</div>
|
|
|
|
<div className="pt-6">
|
|
<a href="#contact" className="inline-flex items-center gap-3 text-lg font-black border-b-4 border-liquid-mint pb-2 hover:gap-5 transition-all">
|
|
LET'S WORK TOGETHER <ArrowRight size={24} />
|
|
</a>
|
|
</div>
|
|
</motion.div>
|
|
</div>
|
|
|
|
{/* --- STAGE 2: THE DETAILS GRID (BENTO STYLE) --- */}
|
|
<div className="grid grid-cols-1 md:grid-cols-12 gap-8">
|
|
|
|
{/* Tech Stack Box */}
|
|
<motion.div
|
|
initial={{ opacity: 0, y: 20 }}
|
|
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"
|
|
>
|
|
<h3 className="text-3xl font-black text-stone-900 dark:text-stone-50 mb-8 flex items-center gap-3">
|
|
<Code className="text-liquid-mint" size={32} /> {t("techStackTitle")}
|
|
</h3>
|
|
<div className="grid grid-cols-1 sm:grid-cols-2 gap-8">
|
|
{techStack.map((cat) => (
|
|
<div key={cat.id} className="space-y-4">
|
|
<h4 className="text-xs font-black uppercase tracking-widest text-stone-400">{cat.name}</h4>
|
|
<div className="flex flex-wrap gap-2">
|
|
{cat.items?.map((item: any) => (
|
|
<span key={item.id} className="px-4 py-2 bg-stone-50 dark:bg-stone-800/50 rounded-xl text-sm font-bold border border-stone-100 dark:border-stone-700/50">
|
|
{item.name}
|
|
</span>
|
|
))}
|
|
</div>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</motion.div>
|
|
|
|
{/* Reading Log Box */}
|
|
<motion.div
|
|
initial={{ opacity: 0, y: 20 }}
|
|
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"
|
|
>
|
|
<h3 className="text-3xl 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={32} /> 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>
|
|
</div>
|
|
</motion.div>
|
|
|
|
{/* Hobbies Box */}
|
|
<motion.div
|
|
initial={{ opacity: 0, y: 20 }}
|
|
whileInView={{ opacity: 1, y: 0 }}
|
|
viewport={{ once: true }}
|
|
transition={{ delay: 0.2 }}
|
|
className="md:col-span-12 bg-liquid-mint/5 dark:bg-stone-900 rounded-[3rem] p-12 border border-liquid-mint/20 dark:border-stone-800/60"
|
|
>
|
|
<div className="flex flex-col md:flex-row justify-between items-start md:items-end gap-8">
|
|
<div className="space-y-4">
|
|
<h3 className="text-3xl font-black text-stone-900 dark:text-stone-50 flex items-center gap-3">
|
|
<Gamepad2 className="text-liquid-purple" size={32} /> {t("hobbiesTitle")}
|
|
</h3>
|
|
<p className="text-stone-500 text-lg font-light">The things that inspire me outside of coding.</p>
|
|
</div>
|
|
<div className="grid grid-cols-2 sm:grid-cols-4 gap-4 w-full md:w-auto">
|
|
{hobbies.map((hobby) => {
|
|
const Icon = iconMap[hobby.icon] || Lightbulb;
|
|
return (
|
|
<div key={hobby.id} className="flex items-center gap-3 p-4 bg-white dark:bg-stone-800 rounded-2xl shadow-sm border border-stone-50 dark:border-stone-700">
|
|
<Icon size={20} className="text-liquid-mint" />
|
|
<span className="text-xs font-bold uppercase tracking-wider">{hobby.title}</span>
|
|
</div>
|
|
)
|
|
})}
|
|
</div>
|
|
</div>
|
|
</motion.div>
|
|
|
|
</div>
|
|
</div>
|
|
</section>
|
|
);
|
|
};
|
|
|
|
export default About;
|