"use client"; import { motion } from "framer-motion"; import { ArrowDown, Code, Zap, Rocket } from "lucide-react"; import { useEffect, useState } from "react"; import { useLocale, useTranslations } from "next-intl"; import type { JSONContent } from "@tiptap/react"; import RichTextClient from "./RichTextClient"; const Hero = () => { const locale = useLocale(); const t = useTranslations("home.hero"); const [cmsDoc, setCmsDoc] = useState(null); useEffect(() => { (async () => { try { const res = await fetch( `/api/content/page?key=${encodeURIComponent("home-hero")}&locale=${encodeURIComponent(locale)}`, ); const data = await res.json(); // Only use CMS content if it exists for the active locale. // If the API falls back to another locale, keep showing next-intl strings // so the locale switch visibly changes the page. if (data?.content?.content && data?.content?.locale === locale) { setCmsDoc(data.content.content as JSONContent); } else { setCmsDoc(null); } } catch { // ignore; fallback to static setCmsDoc(null); } })(); }, [locale]); const features = [ { icon: Code, text: t("features.f1") }, { icon: Zap, text: t("features.f2") }, { icon: Rocket, text: t("features.f3") }, ]; return (
{/* Profile Image with Organic Blob Mask */}
{/* Large Rotating Liquid Blobs behind image - Very slow and smooth */} {/* The Image Container with Organic Border Radius */} {/* Use a plain to fully bypass Next.js image optimizer (dev 400 issue). */} Dennis Konkol {/* Glossy Overlay for Liquid Feel */}
{/* Inner Border/Highlight */}
{/* Domain Badge - repositioned below image */}
dk0.dev
{/* Floating Badges - subtle animations */}
{/* Main Title */}

Dennis Konkol

Software Engineer

{/* Description */} {cmsDoc ? ( ) : (

{t("description")}

)}
{/* Features */} {features.map((feature, index) => ( {feature.text} ))} {/* CTA Buttons */} {t("ctaWork")} {t("ctaContact")}
); }; export default Hero;