Skip to content

Commit bd3995a

Browse files
authored
feat: 404 Page Webapp (#65)
* 404 Page Webapp * 404 Page Webapp 2.0 * fix: merge conflict
1 parent 6c0f7f9 commit bd3995a

3 files changed

Lines changed: 70 additions & 2 deletions

File tree

src/app/not-found.tsx

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import Image from "next/image";
2+
import { hackyPeeking } from "@/assets/images";
3+
import Link from "next/link";
4+
import { getServerSession } from "next-auth";
5+
import authOptions from "./api/auth/[...nextauth]/authOptions";
6+
import Toolbar from "@/components/Toolbar";
7+
import BottomNavbar from "@/components/BottomNavbar";
8+
9+
export default async function NotFound() {
10+
const session = await getServerSession(authOptions);
11+
12+
return (
13+
<div
14+
className={`relative overflow-hidden min-h-screen flex flex-col ${
15+
session ? "bg-gray-100 text-black" : "bg-white"
16+
}`}
17+
>
18+
{/* Background accents */}
19+
<div className="pointer-events-none absolute inset-0 -z-10">
20+
<div className="absolute -top-20 -left-20 h-72 w-72 rounded-full bg-sinfo-primary/10 blur-3xl animate-blob" />
21+
<div className="absolute top-1/4 -right-10 h-64 w-64 rounded-full bg-sinfo-secondary/10 blur-3xl animate-blob [animation-delay:800ms]" />
22+
<div className="absolute bottom-0 left-1/3 h-64 w-64 rounded-full bg-sinfo-quaternary/10 blur-3xl animate-blob [animation-delay:1500ms]" />
23+
</div>
24+
25+
{session ? <Toolbar /> : null}
26+
27+
<main className="flex-1 flex items-center justify-center">
28+
<section className="w-full mx-auto max-w-5xl flex flex-col items-center justify-center gap-4 px-4 py-16 text-center">
29+
<h1 className="relative text-7xl font-extrabold leading-none tracking-tight sm:text-8xl">
30+
<span className="text-sinfo-primary">404</span>
31+
<span className="sr-only">Page not found</span>
32+
</h1>
33+
34+
<p className="max-w-xl text-balance text-base text-gray-500 sm:text-lg leading-relaxed">
35+
Oops, this page got a bit lost.
36+
<br /> While we are working on it, here&apos;s Hacky peeking to say
37+
hi.
38+
</p>
39+
40+
{/* Static Hacky placed just above the CTA so it looks like he's holding the button */}
41+
<div className="relative mx-auto mt-6 -mb-4 flex items-end justify-center">
42+
<Link href="/" className="cursor-pointer">
43+
<Image
44+
src={hackyPeeking}
45+
alt="Hacky peeking"
46+
priority
47+
// keep origin-bottom so any transforms (if later added) pivot from feet
48+
className="origin-bottom w-48 sm:w-56"
49+
sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
50+
/>
51+
</Link>
52+
</div>
53+
54+
<div className="mt-0 flex items-center justify-center gap-3 relative z-10">
55+
<Link
56+
href="/"
57+
className="button-primary text-base font-medium px-10 py-3.5 rounded-full shadow-lg !rounded-full"
58+
>
59+
Go back home
60+
</Link>
61+
</div>
62+
</section>
63+
</main>
64+
65+
{session ? <BottomNavbar /> : null}
66+
</div>
67+
);
68+
}

src/components/BottomNavbar/QRCodeButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default function QRCodeButton() {
2121
<Link href="/qr">
2222
<div className="absolute -top-20 right-4">
2323
<div className="p-4 rounded-full bg-sinfo-primary relative overflow-hidden">
24-
<QrCode size={32} />
24+
<QrCode size={32} className="text-white" />
2525
<div className="shine-effect" />
2626
</div>
2727
</div>

src/components/Toolbar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function Toolbar() {
2222
<>
2323
<Sidebar show={isExpanded} onClose={() => setIsExpanded(false)} />
2424
<div className="sticky top-0 z-10 bg-sinfo-primary">
25-
<div className="container mx-auto p-4 flex flex-col gap-4">
25+
<div className="container mx-auto p-4 flex flex-col gap-4 text-white">
2626
<nav className="flex flex-row items-center">
2727
<div className="w-1/6 flex justify-start items-center">
2828
{showMenu ? (

0 commit comments

Comments
 (0)