From 027290b571c84e5e5df44d807dc6614b9ceffac4 Mon Sep 17 00:00:00 2001 From: manishcoder92 Date: Sun, 31 May 2026 12:39:26 +0530 Subject: [PATCH] feat: add playful custom 404 Page Not Found component - Created a new NotFound component in src/pages/NotFound/NotFound.tsx - Used framer-motion to add animated ghost illustration and pulsating shadow - Designed the page using Tailwind CSS for a playful and modern aesthetic - Imported and configured the NotFound component as a wildcard catch-all route (*) in Router.tsx to handle all invalid URLs --- src/Routes/Router.tsx | 4 +++ src/pages/NotFound/NotFound.tsx | 58 +++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 src/pages/NotFound/NotFound.tsx diff --git a/src/Routes/Router.tsx b/src/Routes/Router.tsx index 874ef7e7..bb05c4a2 100644 --- a/src/Routes/Router.tsx +++ b/src/Routes/Router.tsx @@ -9,6 +9,7 @@ import ContributorProfile from "../pages/ContributorProfile/ContributorProfile.t import Home from "../pages/Home/Home.tsx"; import Activity from "../pages/Activity.tsx"; import PrivacyPolicy from "../pages/Privacy/PrivacyPolicy.tsx"; // ✅ Updated import path to match your new folder structure +import NotFound from "../pages/NotFound/NotFound.tsx"; const Router = () => { return ( @@ -25,6 +26,9 @@ const Router = () => { {/* Privacy Policy page route */} } /> + + {/* 404 Not Found Catch-All Route */} + } /> ); }; diff --git a/src/pages/NotFound/NotFound.tsx b/src/pages/NotFound/NotFound.tsx new file mode 100644 index 00000000..8ce1025a --- /dev/null +++ b/src/pages/NotFound/NotFound.tsx @@ -0,0 +1,58 @@ +import { Link } from "react-router-dom"; +import { Home, Ghost } from "lucide-react"; +import { motion } from "framer-motion"; + +const NotFound = () => { + return ( +
+ + {/* Animated Ghost Illustration */} +
+ + + + + {/* Floating Shadow */} + +
+ +

+ 404 +

+

+ Spooky... This page is a ghost town. +

+ +

+ The link you followed has vanished into the digital void, or maybe it never existed at all! +

+ + + + Teleport Back Home + +
+ + {/* Background decorative blobs */} +
+
+ ); +}; + +export default NotFound;