feat(404): greater 404 page
This commit is contained in:
+53
-13
@@ -1,28 +1,68 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import { Spinner } from "@/components/ui/spinner";
|
||||||
|
import { Activity, Home } from "lucide-react";
|
||||||
|
import { Skeleton } from "@/components/ui/skeleton";
|
||||||
|
|
||||||
export default function NotFound() {
|
export default function NotFound() {
|
||||||
|
const [goingHome, goHome] = useState(false);
|
||||||
|
const [message, setMessage] = useState("");
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const messages = [
|
||||||
|
"Erika กินหน้านี้ไปแล้ว...",
|
||||||
|
"หรือจริงๆแล้วหน้านี้จะโดน Sukuna เล่น...",
|
||||||
|
"อาจจะโดนต่อยจากคนด้านบนแล้วก็ได้...",
|
||||||
|
"หรือ Erika ตัวปลอมขะมีอยู่จริง...",
|
||||||
|
"หน้านี้อาจโดนErikaตัวปลอมทำลายไปแล้วนะ...",
|
||||||
|
];
|
||||||
|
|
||||||
|
setMessage(messages[Math.floor(Math.random() * messages.length)]);
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative flex min-h-screen flex-col items-center justify-center p-4">
|
<div className="flex min-h-screen w-full flex-col items-center justify-center gap-2 bg-[#2225] backdrop-blur-md backdrop-grayscale">
|
||||||
<Image
|
<Image
|
||||||
src="https://cdn.gunshiz.top/404-erika.png"
|
src="/404.png"
|
||||||
alt="404 Background"
|
alt="404 Background"
|
||||||
fill
|
fill
|
||||||
priority
|
priority
|
||||||
className="-z-10 object-cover opacity-40"
|
className="fixed top-0 left-0 z-[-1] h-full w-full object-cover opacity-20"
|
||||||
/>
|
/>
|
||||||
|
<div className="rounded-sm bg-white p-4 pb-12 shadow-lg max-sm:landscape:hidden">
|
||||||
<div className="text-center space-y-6">
|
<Image src="/404-image.jpg"
|
||||||
<h1 className="text-8xl font-bold">404</h1>
|
alt="404"
|
||||||
<h2 className="text-3xl font-semibold">ไม่พบหน้าที่คุณต้องการ</h2>
|
width={256}
|
||||||
<p className="text-muted-foreground text-lg">
|
height={256}
|
||||||
ขออภัย หน้าที่คุณกำลังพยายามเข้าถึงอาจถูกลบ ย้าย หรือไม่มีอยู่ตั้งแต่แรก
|
className="vintage-filter h-64 w-64 bg-gray-300"
|
||||||
</p>
|
/>
|
||||||
<Button asChild size="lg">
|
|
||||||
<Link href="/">กลับสู่หน้าหลัก</Link>
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
|
<h2 className="text-2xl font-semibold">404 ไม่พบหน้านี้</h2>
|
||||||
|
<span>{message || <Skeleton className="h-6 w-40" />}</span>
|
||||||
|
<div className="flex gap-2">
|
||||||
|
<Link href="/">
|
||||||
|
<Button
|
||||||
|
onClick={() => {
|
||||||
|
goHome(true);
|
||||||
|
}}
|
||||||
|
disabled={goingHome}
|
||||||
|
variant="destructive"
|
||||||
|
>
|
||||||
|
{goingHome ? <Spinner /> : <Home />}
|
||||||
|
กลับหน้าแรก
|
||||||
|
</Button>
|
||||||
|
</Link>
|
||||||
|
<Link href="https://status.sudloh.com">
|
||||||
|
<Button variant="link" className="text-secondary-foreground">
|
||||||
|
<Activity />
|
||||||
|
สถานะเว็บไซต์
|
||||||
|
</Button>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 47 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.9 MiB |
Reference in New Issue
Block a user