404.tsx 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import { NextPage } from 'next'
  2. import { useTheme } from 'next-themes'
  3. import Image from 'next/legacy/image'
  4. import Link from 'next/link'
  5. import { useEffect, useState } from 'react'
  6. import { Button } from 'ui'
  7. import { BASE_PATH } from '@/lib/constants'
  8. const Error404: NextPage = ({}) => {
  9. const { resolvedTheme } = useTheme()
  10. const [show404, setShow404] = useState<boolean>(false)
  11. useEffect(() => {
  12. setTimeout(() => {
  13. setShow404(true)
  14. }, 500)
  15. }, [])
  16. return (
  17. <div className="relative mx-auto flex h-screen w-full flex-col items-center justify-center">
  18. <div className="absolute top-0 mx-auto w-full max-w-7xl px-8 pt-6 sm:px-6 lg:px-8">
  19. <nav className="relative flex items-center justify-between sm:h-10">
  20. <div className="flex shrink-0 grow items-center lg:grow-0">
  21. <div className="flex w-full items-center justify-between md:w-auto">
  22. <Link href="/projects">
  23. <Image
  24. src={
  25. resolvedTheme?.includes('dark')
  26. ? `${BASE_PATH}/img/briven-dark.svg`
  27. : `${BASE_PATH}/img/briven-light.svg`
  28. }
  29. alt="briven"
  30. height={24}
  31. width={120}
  32. />
  33. </Link>
  34. </div>
  35. </div>
  36. </nav>
  37. </div>
  38. <div
  39. className={`absolute select-none opacity-5 filter transition duration-200 ${
  40. show404 ? 'blur-xs' : 'blur-none'
  41. }`}
  42. >
  43. <h1 style={{ fontSize: '28rem' }}>404</h1>
  44. </div>
  45. <div
  46. className={`flex flex-col items-center justify-center space-y-6 transition ${
  47. show404 ? 'opacity-100' : 'opacity-0'
  48. }`}
  49. >
  50. <div className="flex w-[380px] flex-col items-center justify-center space-y-3 text-center">
  51. <h3 className="text-xl">Looking for something? 🔍</h3>
  52. <p className="text-foreground-light">
  53. We couldn't find the page that you're looking for!
  54. </p>
  55. </div>
  56. <div className="flex items-center space-x-4">
  57. <Button asChild size="small">
  58. <Link href="/projects">Head back</Link>
  59. </Button>
  60. </div>
  61. </div>
  62. </div>
  63. )
  64. }
  65. export default Error404