2024-11-30 22:24:35 +08:00
|
|
|
|
import React, { useState, useEffect } from "react";
|
2024-12-05 16:58:57 +08:00
|
|
|
|
import { Template } from "interface/template";
|
2024-11-30 22:24:35 +08:00
|
|
|
|
|
2024-12-20 00:34:54 +08:00
|
|
|
|
export default new Template( ({ }) => {
|
2024-11-30 22:24:35 +08:00
|
|
|
|
const [text, setText] = useState("");
|
|
|
|
|
const fullText = "404 - 页面不见了 :(";
|
|
|
|
|
const typingSpeed = 100;
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
let currentIndex = 0;
|
|
|
|
|
const typingEffect = setInterval(() => {
|
|
|
|
|
if (currentIndex < fullText.length) {
|
|
|
|
|
setText(fullText.slice(0, currentIndex + 1));
|
|
|
|
|
currentIndex++;
|
|
|
|
|
} else {
|
|
|
|
|
clearInterval(typingEffect);
|
|
|
|
|
}
|
|
|
|
|
}, typingSpeed);
|
|
|
|
|
|
|
|
|
|
return () => clearInterval(typingEffect);
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
return (
|
2024-12-04 19:57:59 +08:00
|
|
|
|
<div className="min-h-screen flex items-center justify-center bg-[--background] transition-colors duration-300">
|
2024-11-30 22:24:35 +08:00
|
|
|
|
<div className="text-center">
|
2024-12-04 19:57:59 +08:00
|
|
|
|
<h1 className="text-6xl font-bold text-[--foreground] mb-4">
|
2024-11-30 22:24:35 +08:00
|
|
|
|
{text}
|
|
|
|
|
<span className="animate-pulse">|</span>
|
|
|
|
|
</h1>
|
2024-12-04 19:57:59 +08:00
|
|
|
|
<p className="text-[--muted-foreground] text-xl">
|
2024-11-30 22:24:35 +08:00
|
|
|
|
抱歉,您访问的页面已经离家出走了
|
|
|
|
|
</p>
|
2024-12-04 02:35:06 +08:00
|
|
|
|
<button
|
|
|
|
|
onClick={() => (window.location.href = "/")}
|
2024-12-04 19:57:59 +08:00
|
|
|
|
className="mt-8 px-6 py-3 bg-[--primary] hover:bg-[--primary-foreground] text-[--primary-foreground] hover:text-[--primary] rounded-lg transition-colors duration-300"
|
2024-11-30 22:24:35 +08:00
|
|
|
|
>
|
|
|
|
|
返回首页
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2024-12-05 16:58:57 +08:00
|
|
|
|
});
|