|
| 1 | +import { Link } from "react-router-dom"; |
| 2 | +import { useEffect } from "react"; |
| 3 | + |
| 4 | +export default function NotFound() { |
| 5 | + useEffect(() => { |
| 6 | + // Dynamically add Google Font |
| 7 | + const link = document.createElement("link"); |
| 8 | + link.href = "https://fonts.googleapis.com/css2?family=Rubik+Dirt&display=swap"; |
| 9 | + link.rel = "stylesheet"; |
| 10 | + document.head.appendChild(link); |
| 11 | + }, []); |
| 12 | + const isMobile = window.innerWidth < 768; |
| 13 | + |
| 14 | + return ( |
| 15 | + <div |
| 16 | + className="relative min-h-screen bg-cover bg-center md:flex justify-center items-center text-white text-center px-4" |
| 17 | + style={{ |
| 18 | + backgroundImage: isMobile |
| 19 | + ? "url('/images/pnf-mob.png')" // mobile image |
| 20 | + : "url('/images/notFoundLandscape.png')", // desktop image |
| 21 | + }} |
| 22 | + > |
| 23 | + |
| 24 | + <div className="md:w-1/2 max-w-2xl px-12 pt-30 md:pt-0"> |
| 25 | + {/* 404 text */} |
| 26 | + <h1 |
| 27 | + className="text-9xl md:text-9xl font-extrabold tracking-widest" |
| 28 | + > |
| 29 | + 404 |
| 30 | + </h1> |
| 31 | + |
| 32 | + {/* Subtitle */} |
| 33 | + <h2 |
| 34 | + className="text-4xl md:text-7xl mt-4 " |
| 35 | + style={{ fontFamily: "'Rubik Dirt', cursive" }} |
| 36 | + > |
| 37 | + NOT FOUND |
| 38 | + </h2> |
| 39 | + |
| 40 | + {/* Description */} |
| 41 | + <p className="uppercase mt-6 font-semibold"> |
| 42 | + Oops! This page wandered off the workout plan. |
| 43 | + </p> |
| 44 | + |
| 45 | + <p className="mt-3 text-gray-400 leading-relaxed"> |
| 46 | + Looks like the page you're looking for doesn't exist. But don't worry — |
| 47 | + your fitness journey doesn't stop here. Fuel your goals with CoreX supplements. |
| 48 | + </p> |
| 49 | + |
| 50 | + {/* Buttons */} |
| 51 | + <div className="mt-8 flex flex-col sm:flex-row gap-4 justify-center"> |
| 52 | + <Link |
| 53 | + to="/" |
| 54 | + className="bg-white text-black px-6 py-3 rounded-2xl font-semibold hover:bg-red-600 hover:text-white transition" |
| 55 | + > |
| 56 | + GO TO HOME PAGE |
| 57 | + </Link> |
| 58 | + |
| 59 | + <Link |
| 60 | + to="/products" |
| 61 | + className="border border-white px-6 py-3 rounded-2xl font-semibold hover:bg-red-600 hover:border-red-600 transition" |
| 62 | + > |
| 63 | + CONTINUE SHOPPING |
| 64 | + </Link> |
| 65 | + </div> |
| 66 | + </div> |
| 67 | + <div class="w-1/2 bg-blue-500"></div> |
| 68 | + </div> |
| 69 | + ); |
| 70 | +} |
0 commit comments