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:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user