import Image, { type StaticImageData } from "next/image"; import { ArrowUpRight } from "./ui"; import type { Project } from "@/config/site"; import type { Locale } from "@/lib/i18n"; import { cn } from "@/lib/utils"; import { getMessages } from "@/messages"; /* * Each composition keeps the original, hand-tuned placement: a pastel card * (a deep tint of it in dark mode), a soft pink blob, and the screenshot * tilted -30°. On top of that the * screenshot leans toward the cursor (the grid feeds --tx/--ty), lifts on * hover, and gets a liquid-glass loupe. */ const LOOKS = { secondself: { bg: "bg-stage-sky", blob: "-bottom-32 left-1/2 h-56 w-64 -translate-x-1/2 md:-bottom-52 md:h-96 md:w-96", shot: "top-16 left-20 w-[80%] -translate-y-1/2 md:top-36 md:left-44", img: "h-full w-full object-contain", sizes: "(max-width: 768px) 300px, 500px", }, webagent: { bg: "bg-stage-mint", blob: "-bottom-96 left-16 h-full w-[145%]", shot: "top-1/2 left-24 w-[80%] -translate-y-1/2 md:left-32", img: "h-full w-full object-contain", sizes: "(max-width: 768px) 300px, 500px", }, chatbot: { bg: "bg-stage-butter", blob: "-top-40 left-40 h-full w-[135%]", shot: "top-1/2 left-20 w-[400px] -translate-y-1/2 md:left-44 md:w-[800px]", img: "h-48 object-cover md:h-96", sizes: "(max-width: 768px) 400px, 800px", }, paper: { bg: "bg-stage-lilac", blob: "-top-40 left-40 h-full w-[135%]", shot: "top-16 left-12 w-full -translate-y-1/2 md:top-1/2 md:left-16", img: "h-full w-full object-contain", sizes: "(max-width: 768px) 300px, 500px", }, } as const; export function ProjectCard({ project, look, image, width, height, lang, link = true, }: { project: Project; lang: Locale; look: keyof typeof LOOKS; /** A local import (sized automatically) or a remote URL with its size. */ image?: string | StaticImageData; width?: number; height?: number; /** Show the corner pill that opens the project. Off makes the card purely visual. */ link?: boolean; }) { const l = LOOKS[look]; return (
{/* The lean is 3D only under the cursor (--tx/--ty are 0 elsewhere): a perspective at rest held the screenshot in a GPU layer of its own. */}
{image ? ( {`${project.name}: ) : (
{project.name}
)}
{/* The original expanding link, now in liquid glass. */} {link && ( {project.name} )}
); }