diff --git a/app/Projects/[id]/page.tsx b/app/Projects/[slug]/page.tsx
similarity index 50%
rename from app/Projects/[id]/page.tsx
rename to app/Projects/[slug]/page.tsx
index 9774b62..0860261 100644
--- a/app/Projects/[id]/page.tsx
+++ b/app/Projects/[slug]/page.tsx
@@ -1,41 +1,51 @@
-// app/Projects/[id]/page.tsx
"use client";
-import { useParams } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useEffect, useState } from "react";
import Link from "next/link";
interface Project {
id: string;
title: string;
+ slug: string;
description: string;
link: string;
+ image: string;
}
export default function ProjectDetail() {
const params = useParams();
- const { id } = params as { id: string };
+ const router = useRouter();
+ const { slug } = params as { slug: string };
const [project, setProject] = useState(null);
useEffect(() => {
- if (id) {
+ if (slug) {
fetch("/data/projects.json")
.then((res) => res.json())
.then((data: Project[]) => {
- const found = data.find((proj) => proj.id === id);
- setProject(found || null);
+ const found = data.find((proj) => proj.slug === slug);
+ if (found) {
+ setProject(found);
- // Log the project view
- fetch("/api/stats", {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify({ type: "project_view", projectId: id }),
- }).catch((err) => console.error("Failed to log project view", err));
+ // Log the project view
+ fetch("/api/stats", {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({
+ type: "project_view",
+ projectId: found.id,
+ }),
+ }).catch((err) => console.error("Failed to log project view", err));
+ } else {
+ // Redirect to 404 if project not found
+ router.replace("/not-found");
+ }
});
}
- }, [id]);
+ }, [slug, router]);
if (!project) {
return Loading...
;
@@ -46,6 +56,11 @@ export default function ProjectDetail() {
{project.title}
+
{project.description}
diff --git a/app/components/Contact.tsx b/app/components/Contact.tsx
index 16c8b8d..be728b3 100644
--- a/app/components/Contact.tsx
+++ b/app/components/Contact.tsx
@@ -1,34 +1,73 @@
-// app/components/Contact.tsx
"use client";
+import { useState } from "react";
+
export default function Contact() {
+ const [form, setForm] = useState({ name: "", email: "", message: "" });
+ const [success, setSuccess] = useState(false);
+ const [error, setError] = useState("");
+
+ const handleChange = (
+ e: React.ChangeEvent,
+ ) => {
+ setForm({ ...form, [e.target.name]: e.target.value });
+ };
+
+ const handleSubmit = async (e: React.FormEvent) => {
+ e.preventDefault();
+ // Replace this with actual form submission logic (e.g., API call)
+ try {
+ // Simulate a successful submission
+ await new Promise((resolve) => setTimeout(resolve, 1000));
+ setSuccess(true);
+ setForm({ name: "", email: "", message: "" });
+ } catch (err) {
+ setError("Failed to send message. Please try again.");
+ }
+ };
+
return (
View Project
diff --git a/app/globals.css b/app/globals.css
index fbe1105..600f6e4 100644
--- a/app/globals.css
+++ b/app/globals.css
@@ -1,11 +1,8 @@
-/* app/globals.css */
@tailwind base;
@tailwind components;
@tailwind utilities;
-/* Global Dark Mode Styles */
+/* Custom Global Styles */
body {
- color: #ededed; /* Foreground color */
- background: #0a0a0a; /* Background color */
- font-family: Arial, Helvetica, sans-serif;
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
diff --git a/app/not-found.tsx b/app/not-found.tsx
new file mode 100644
index 0000000..450624c
--- /dev/null
+++ b/app/not-found.tsx
@@ -0,0 +1,22 @@
+import Link from "next/link";
+
+export default function NotFound() {
+ return (
+
+
+
+ 404
+
+
+ Oops! The page you're looking for doesn't exist.
+
+
+ Go Back Home
+
+
+
+ );
+}
diff --git a/public/data/projects.json b/public/data/projects.json
index 28ee002..9442c7f 100644
--- a/public/data/projects.json
+++ b/public/data/projects.json
@@ -2,25 +2,33 @@
{
"id": "1",
"title": "Project One",
+ "slug": "project-one",
"description": "A brief description of Project One.",
- "link": "/Projects/1"
+ "link": "/Projects/project-one",
+ "image": "/images/project-one.jpg"
},
{
"id": "2",
"title": "Project Two",
+ "slug": "project-two",
"description": "A brief description of Project Two.",
- "link": "/Projects/2"
+ "link": "/Projects/project-two",
+ "image": "/images/project-two.jpg"
},
{
"id": "3",
"title": "Project Three",
+ "slug": "project-three",
"description": "A brief description of Project Three.",
- "link": "/Projects/3"
+ "link": "/Projects/project-three",
+ "image": "/images/project-three.jpg"
},
{
"id": "4",
"title": "Project Marie/Dennis",
+ "slug": "project-marie-dennis",
"description": "Ich liebe Marie",
- "link": "/Projects/4"
+ "link": "/Projects/project-marie-dennis",
+ "image": "/images/project-marie-dennis.jpg"
}
]
diff --git a/public/images/project-marie-dennis.jpg b/public/images/project-marie-dennis.jpg
new file mode 100644
index 0000000..54d4ab4
Binary files /dev/null and b/public/images/project-marie-dennis.jpg differ
diff --git a/public/images/project-one.jpg b/public/images/project-one.jpg
new file mode 100644
index 0000000..12ddc89
Binary files /dev/null and b/public/images/project-one.jpg differ
diff --git a/public/images/project-three.jpg b/public/images/project-three.jpg
new file mode 100644
index 0000000..beff039
Binary files /dev/null and b/public/images/project-three.jpg differ
diff --git a/public/images/project-two.jpg b/public/images/project-two.jpg
new file mode 100644
index 0000000..d4035f9
Binary files /dev/null and b/public/images/project-two.jpg differ