129 lines
5.6 KiB
JavaScript
129 lines
5.6 KiB
JavaScript
'use client';
|
|
|
|
import { useState } from 'react';
|
|
import { motion } from 'framer-motion';
|
|
import Link from 'next/link';
|
|
import { Mail, ArrowLeft, CheckCircle } from 'lucide-react';
|
|
|
|
export default function ForgotPasswordPage() {
|
|
const [email, setEmail] = useState('');
|
|
const [isLoading, setIsLoading] = useState(false);
|
|
const [isSubmitted, setIsSubmitted] = useState(false);
|
|
|
|
const handleSubmit = async (e) => {
|
|
e.preventDefault();
|
|
setIsLoading(true);
|
|
|
|
setTimeout(() => {
|
|
setIsLoading(false);
|
|
setIsSubmitted(true);
|
|
}, 1500);
|
|
};
|
|
|
|
return (
|
|
<div className="min-h-screen bg-gradient-to-br from-gray-900 via-gray-800 to-gray-900 flex items-center justify-center p-4 relative overflow-hidden">
|
|
<div className="absolute inset-0 overflow-hidden">
|
|
<div className="absolute -top-40 -right-40 w-80 h-80 bg-purple-500 rounded-full opacity-20 blur-3xl animate-pulse"></div>
|
|
<div className="absolute -bottom-40 -left-40 w-80 h-80 bg-pink-500 rounded-full opacity-20 blur-3xl animate-pulse delay-1000"></div>
|
|
</div>
|
|
|
|
<motion.div
|
|
initial={{ opacity: 0, scale: 0.95 }}
|
|
animate={{ opacity: 1, scale: 1 }}
|
|
transition={{ duration: 0.5 }}
|
|
className="relative w-full max-w-md"
|
|
>
|
|
<motion.div
|
|
initial={{ opacity: 0, x: -20 }}
|
|
animate={{ opacity: 1, x: 0 }}
|
|
className="absolute -top-16 left-0"
|
|
>
|
|
<Link href="/login" className="flex items-center gap-2 text-gray-300 hover:text-white transition-colors group">
|
|
<ArrowLeft className="w-4 h-4 group-hover:-translate-x-1 transition-transform" />
|
|
<span>العودة لتسجيل الدخول</span>
|
|
</Link>
|
|
</motion.div>
|
|
|
|
<div className="bg-white/10 backdrop-blur-xl rounded-3xl shadow-2xl border border-white/20 overflow-hidden">
|
|
<div className="bg-gradient-to-r from-purple-500 to-pink-500 p-8 text-center">
|
|
<motion.h1
|
|
initial={{ y: 20, opacity: 0 }}
|
|
animate={{ y: 0, opacity: 1 }}
|
|
className="text-3xl font-bold text-white mb-2"
|
|
>
|
|
استعادة كلمة المرور
|
|
</motion.h1>
|
|
<motion.p
|
|
initial={{ y: 20, opacity: 0 }}
|
|
animate={{ y: 0, opacity: 1 }}
|
|
transition={{ delay: 0.1 }}
|
|
className="text-purple-100"
|
|
>
|
|
سنرسل لك رابط لإعادة تعيين كلمة المرور
|
|
</motion.p>
|
|
</div>
|
|
|
|
<div className="p-8">
|
|
{!isSubmitted ? (
|
|
<form onSubmit={handleSubmit} className="space-y-6">
|
|
<div>
|
|
<label className="block text-sm font-medium text-gray-200 mb-2">
|
|
البريد الإلكتروني
|
|
</label>
|
|
<div className="relative group">
|
|
<div className="absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none">
|
|
<Mail className="w-5 h-5 text-gray-400 group-focus-within:text-purple-500 transition-colors" />
|
|
</div>
|
|
<input
|
|
type="email"
|
|
value={email}
|
|
onChange={(e) => setEmail(e.target.value)}
|
|
className="w-full pr-12 pl-4 py-3 bg-white/5 border border-gray-600 rounded-xl focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent text-white placeholder-gray-400 transition-all"
|
|
placeholder="أدخل بريدك الإلكتروني"
|
|
required
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
<button
|
|
type="submit"
|
|
disabled={isLoading}
|
|
className="w-full bg-gradient-to-r from-purple-500 to-pink-500 text-white py-3 rounded-xl font-bold text-lg hover:from-purple-600 hover:to-pink-600 transition-all transform hover:scale-[1.02] active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed shadow-lg shadow-purple-500/25"
|
|
>
|
|
{isLoading ? (
|
|
<div className="flex items-center justify-center gap-2">
|
|
<div className="w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin" />
|
|
<span>جاري الإرسال...</span>
|
|
</div>
|
|
) : (
|
|
'إرسال رابط الاستعادة'
|
|
)}
|
|
</button>
|
|
</form>
|
|
) : (
|
|
<motion.div
|
|
initial={{ scale: 0.9, opacity: 0 }}
|
|
animate={{ scale: 1, opacity: 1 }}
|
|
className="text-center py-6"
|
|
>
|
|
<div className="w-20 h-20 bg-green-500/20 rounded-full flex items-center justify-center mx-auto mb-4">
|
|
<CheckCircle className="w-10 h-10 text-green-500" />
|
|
</div>
|
|
<h3 className="text-xl font-bold text-white mb-2">تم الإرسال بنجاح!</h3>
|
|
<p className="text-gray-300 mb-6">
|
|
تم إرسال رابط استعادة كلمة المرور إلى {email}
|
|
</p>
|
|
<Link
|
|
href="/login"
|
|
className="inline-block px-6 py-3 bg-white/10 text-white rounded-xl hover:bg-white/20 transition-colors"
|
|
>
|
|
العودة لتسجيل الدخول
|
|
</Link>
|
|
</motion.div>
|
|
)}
|
|
</div>
|
|
</div>
|
|
</motion.div>
|
|
</div>
|
|
);
|
|
} |