feat: add custom 404 error page with animated background and navigation links
All checks were successful
Staging Build / build (push) Successful in 2m57s

This commit is contained in:
DanielS
2026-08-11 01:30:23 +02:00
parent bc02a6d000
commit 7346b42ff3

90
shop/app/not-found.tsx Normal file
View File

@@ -0,0 +1,90 @@
'use client'
import Link from 'next/link'
import { motion } from 'framer-motion'
import { AsciiShaderBackground } from '@/components/AsciiShaderBackground'
import { ArrowLeft, Home } from 'lucide-react'
import { Button } from '@/components/ui/button'
export default function NotFound() {
return (
<div className="min-h-screen bg-transparent text-slate-100 overflow-hidden relative selection:bg-blue-500/30 selection:text-blue-200">
<AsciiShaderBackground />
<div className="relative z-10 flex flex-col items-center justify-center min-h-screen px-4">
<motion.div
initial={{ opacity: 0, y: 30 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.6, ease: [0.25, 0.1, 0.25, 1] }}
className="text-center space-y-8 max-w-lg"
>
{/* Große 404 */}
<motion.h1
initial={{ opacity: 0, scale: 0.8 }}
animate={{ opacity: 1, scale: 1 }}
transition={{ duration: 0.8, delay: 0.1, type: 'spring', stiffness: 100 }}
className="text-[10rem] md:text-[14rem] font-black leading-none tracking-tighter bg-gradient-to-b from-white via-slate-300 to-slate-600 bg-clip-text text-transparent select-none"
>
404
</motion.h1>
{/* Beschreibung */}
<motion.div
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5, delay: 0.3 }}
className="space-y-3"
>
<h2 className="text-2xl md:text-3xl font-bold text-white">
Seite nicht gefunden
</h2>
<p className="text-slate-400 text-sm md:text-base leading-relaxed max-w-md mx-auto">
Die angeforderte Seite existiert nicht oder wurde verschoben.
</p>
</motion.div>
{/* Buttons */}
<motion.div
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5, delay: 0.5 }}
className="flex flex-col sm:flex-row items-center justify-center gap-3 pt-4"
>
<Button
asChild
size="lg"
className="h-12 px-8 text-base gap-2 bg-gradient-to-r from-blue-600 to-sky-500 hover:from-blue-500 hover:to-sky-400 border-0 shadow-[0_0_20px_rgba(56,189,248,0.25)] hover:shadow-[0_0_30px_rgba(56,189,248,0.4)] transition-all"
>
<Link href="/">
<Home className="w-4 h-4" />
Zur Startseite
</Link>
</Button>
<Button
asChild
variant="ghost"
size="lg"
className="h-12 px-8 text-base gap-2 text-slate-400 hover:text-white border border-white/10 hover:border-white/20 hover:bg-white/5"
onClick={() => typeof window !== 'undefined' && window.history.back()}
>
<button type="button">
<ArrowLeft className="w-4 h-4" />
Zurück
</button>
</Button>
</motion.div>
{/* Subtle info */}
<motion.p
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ duration: 0.5, delay: 0.7 }}
className="text-xs text-slate-600 pt-8"
>
Fehlercode 404 · CASPOS Shop
</motion.p>
</motion.div>
</div>
</div>
)
}