import React from 'react'; import { useParams, Link } from 'react-router-dom'; import { motion, useScroll, useTransform } from 'framer-motion'; import { useProjects } from '../utils/projectParser'; import { useProjectContent } from '../hooks/useProjectContent'; import Seo from '../components/Seo'; import GenerativeArt from '../components/GenerativeArt'; import { ArrowLeftIcon, ArrowUpRightIcon, GithubLogoIcon, CalendarBlankIcon, CpuIcon, CheckCircleIcon, XCircleIcon, } from '@phosphor-icons/react'; import MarkdownContent from '../components/MarkdownContent'; const NOISE_BG = `url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E")`; const ProjectPage = () => { const { slug } = useParams(); const { scrollY } = useScroll(); // Parallax effect for hero const heroY = useTransform(scrollY, [0, 500], [0, 150]); const heroOpacity = useTransform(scrollY, [0, 500], [1, 0.5]); const { projects, loading: loadingProjects, error: errorProjects, } = useProjects(); const { content, loading: loadingContent, error: errorContent, } = useProjectContent(slug); const project = projects.find((p) => p.slug === slug); const fullProject = project && content ? { ...project, ...content } : null; if (loadingProjects || loadingContent) { return (
Loading project data...
); } if (errorProjects || errorContent) { return (
Error: {errorProjects?.message || errorContent?.message}
); } if (!fullProject) { return (
Project not found.
); } const year = new Date(fullProject.date).getFullYear(); const isDefaultImage = fullProject.image?.includes('defaults/'); return (
{/* Hero Section */}
{isDefaultImage ? ( ) : (
{fullProject.title}
)}
Back to Projects
{year} {fullProject.isActive ? : } {fullProject.isActive ? 'Active Development' : 'Archived'}

{fullProject.title}

{fullProject.technologies?.map((tech, index) => ( {tech} ))}
{/* Main Content */}
{/* Content Column */}

{fullProject.shortDescription}

{/* Sidebar Column */}
); }; export default ProjectPage;