|
| 1 | +"use client"; |
| 2 | + |
| 3 | +import { Button } from "@/components/ui/button"; |
| 4 | +import { motion, Variants } from "framer-motion"; |
| 5 | +import { ArrowLeft, Home, SearchX } from "lucide-react"; |
| 6 | +import Link from "next/link"; |
| 7 | + |
| 8 | +const container: Variants = { |
| 9 | + hidden: { opacity: 0 }, |
| 10 | + show: { |
| 11 | + opacity: 1, |
| 12 | + transition: { |
| 13 | + staggerChildren: 0.1, |
| 14 | + delayChildren: 0.3, |
| 15 | + }, |
| 16 | + }, |
| 17 | +}; |
| 18 | + |
| 19 | +const item: Variants = { |
| 20 | + hidden: { opacity: 0, y: 20 }, |
| 21 | + show: { |
| 22 | + opacity: 1, |
| 23 | + y: 0, |
| 24 | + transition: { |
| 25 | + type: "spring", |
| 26 | + stiffness: 100, |
| 27 | + damping: 15, |
| 28 | + }, |
| 29 | + }, |
| 30 | +}; |
| 31 | + |
| 32 | +const NotFound = () => { |
| 33 | + return ( |
| 34 | + <section className="relative overflow-hidden bg-zinc-50 dark:bg-neutral-900/80 min-h-svh flex items-center justify-center p-6"> |
| 35 | + {/* Accent Corner Lines */} |
| 36 | + <div className="hidden sm:block absolute top-10 left-10 h-16 w-16 border-t-2 border-l-2 border-emerald-400 dark:border-violet-500 opacity-60 rounded-tl-lg" /> |
| 37 | + <div className="hidden sm:block absolute bottom-10 right-10 h-20 w-20 border-b-2 border-r-2 border-emerald-400 dark:border-violet-500 opacity-60 rounded-br-lg" /> |
| 38 | + |
| 39 | + {/* Geometric Shape Decorations */} |
| 40 | + <div className="absolute top-1/3 -left-6 w-24 h-24 border border-emerald-300 dark:border-violet-400/40 rounded-full opacity-30" /> |
| 41 | + <div className="absolute bottom-1/4 -right-8 w-20 h-20 border border-emerald-300 dark:border-violet-400/40 rotate-12 opacity-30" /> |
| 42 | + |
| 43 | + {/* Additional geometric shapes for 404 */} |
| 44 | + <div className="absolute top-1/4 right-1/4 w-16 h-16 border-2 border-emerald-200 dark:border-violet-300/30 rotate-45 opacity-20" /> |
| 45 | + <div className="absolute bottom-1/3 left-1/4 w-12 h-12 bg-emerald-100 dark:bg-violet-500/10 rounded-full opacity-40" /> |
| 46 | + |
| 47 | + <div className="max-w-2xl mx-auto text-center relative z-10"> |
| 48 | + <motion.div initial="hidden" animate="show" variants={container}> |
| 49 | + {/* 404 Number with Icon */} |
| 50 | + <motion.div |
| 51 | + className="flex items-center justify-center gap-4 mb-8" |
| 52 | + variants={item} |
| 53 | + > |
| 54 | + <SearchX className="size-20 text-emerald-500 dark:text-violet-400" /> |
| 55 | + <span className="text-8xl sm:text-9xl font-bold text-emerald-600 dark:text-violet-500 tracking-tight"> |
| 56 | + 404 |
| 57 | + </span> |
| 58 | + </motion.div> |
| 59 | + |
| 60 | + {/* Heading */} |
| 61 | + <motion.h1 |
| 62 | + className="text-3xl sm:text-5xl font-bold tracking-tight mb-6 text-slate-900 dark:text-neutral-100" |
| 63 | + variants={item} |
| 64 | + > |
| 65 | + Oops! Page Not Found |
| 66 | + </motion.h1> |
| 67 | + |
| 68 | + {/* Subtext */} |
| 69 | + <motion.p |
| 70 | + className="text-lg text-slate-600 dark:text-neutral-400 max-w-lg mx-auto mb-10" |
| 71 | + variants={item} |
| 72 | + > |
| 73 | + The page you're looking for seems to have wandered off into the |
| 74 | + digital void. Don't worry, it happens to the best of us! |
| 75 | + </motion.p> |
| 76 | + |
| 77 | + {/* Action Buttons */} |
| 78 | + <motion.div |
| 79 | + className="flex flex-col sm:flex-row gap-4 justify-center" |
| 80 | + variants={{ |
| 81 | + hidden: { opacity: 0, y: 20 }, |
| 82 | + show: { |
| 83 | + opacity: 1, |
| 84 | + y: 0, |
| 85 | + transition: { |
| 86 | + staggerChildren: 0.1, |
| 87 | + delayChildren: 0.4, |
| 88 | + }, |
| 89 | + }, |
| 90 | + }} |
| 91 | + > |
| 92 | + <motion.div |
| 93 | + whileHover={{ scale: 1.05 }} |
| 94 | + whileTap={{ scale: 0.98 }} |
| 95 | + variants={item} |
| 96 | + > |
| 97 | + <Link href="/"> |
| 98 | + <Button |
| 99 | + size="lg" |
| 100 | + className="gap-2 bg-emerald-600 text-white hover:bg-emerald-700 dark:bg-violet-600 dark:hover:bg-violet-700 transition-all duration-200" |
| 101 | + > |
| 102 | + <Home className="h-5 w-5" /> |
| 103 | + Go Home |
| 104 | + </Button> |
| 105 | + </Link> |
| 106 | + </motion.div> |
| 107 | + |
| 108 | + <motion.div |
| 109 | + whileHover={{ scale: 1.05 }} |
| 110 | + whileTap={{ scale: 0.98 }} |
| 111 | + variants={item} |
| 112 | + > |
| 113 | + <Button |
| 114 | + variant="outline" |
| 115 | + size="lg" |
| 116 | + onClick={() => window.history.back()} |
| 117 | + className="gap-2 border-emerald-200 text-slate-700 hover:bg-emerald-50 hover:border-emerald-300 dark:border-violet-400/40 dark:text-neutral-300 dark:hover:bg-violet-500/10 dark:hover:border-violet-400 transition-all duration-200" |
| 118 | + > |
| 119 | + <ArrowLeft className="h-5 w-5" /> |
| 120 | + Go Back |
| 121 | + </Button> |
| 122 | + </motion.div> |
| 123 | + </motion.div> |
| 124 | + |
| 125 | + {/* Additional Help Text */} |
| 126 | + <motion.div className="mt-12 text-center" variants={item}> |
| 127 | + <p className="text-sm text-slate-500 dark:text-neutral-500"> |
| 128 | + Need help? Visit our{" "} |
| 129 | + <Link |
| 130 | + href="/" |
| 131 | + className="text-emerald-600 dark:text-violet-400 hover:text-emerald-700 dark:hover:text-violet-300 underline underline-offset-2 transition-colors" |
| 132 | + > |
| 133 | + homepage |
| 134 | + </Link>{" "} |
| 135 | + or try converting an image to SVG. |
| 136 | + </p> |
| 137 | + </motion.div> |
| 138 | + </motion.div> |
| 139 | + </div> |
| 140 | + </section> |
| 141 | + ); |
| 142 | +}; |
| 143 | + |
| 144 | +export default NotFound; |
0 commit comments