arfcdashboard / login-react.html
arfcodes's picture
Not in html but in typescript with common react developing procesa. - Initial Deployment
b638907 verified
Raw History Blame Contribute Delete
6.92 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login | Portfolio Dashboard</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/react@18/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<style>
.gradient-bg {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.input-focus:focus {
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}
</style>
</head>
<body class="min-h-screen flex items-center justify-center gradient-bg">
<div id="root"></div>
<script type="text/babel">
const { useState, useEffect } = React;
function LoginForm() {
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
const [rememberMe, setRememberMe] = useState(false);
useEffect(() => {
AOS.init({
duration: 800,
easing: 'ease-in-out',
once: true
});
feather.replace();
}, []);
const handleSubmit = (e) => {
e.preventDefault();
// Handle login logic here
console.log({ username, password, rememberMe });
};
return (
<div className="w-full max-w-md px-8 py-12 mx-4 bg-white rounded-xl shadow-2xl" data-aos="fade-up">
<div className="text-center mb-10">
<div className="flex justify-center mb-6">
<i data-feather="lock" className="w-12 h-12 text-indigo-600"></i>
</div>
<h1 className="text-3xl font-bold text-gray-800 mb-2">Welcome Back</h1>
<p className="text-gray-600">Sign in to access your portfolio dashboard</p>
</div>
<form className="space-y-6" onSubmit={handleSubmit}>
<div>
<label htmlFor="username" className="block text-sm font-medium text-gray-700 mb-1">Username</label>
<div className="relative">
<div className="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i data-feather="user" className="h-5 w-5 text-gray-400"></i>
</div>
<input
id="username"
name="username"
type="text"
required
className="input-focus pl-10 block w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none transition duration-200"
placeholder="Enter your username"
value={username}
onChange={(e) => setUsername(e.target.value)}
/>
</div>
</div>
<div>
<label htmlFor="password" className="block text-sm font-medium text-gray-700 mb-1">Password</label>
<div className="relative">
<div className="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i data-feather="key" className="h-5 w-5 text-gray-400"></i>
</div>
<input
id="password"
name="password"
type="password"
required
className="input-focus pl-10 block w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none transition duration-200"
placeholder="••••••••"
value={password}
onChange={(e) => setPassword(e.target.value)}
/>
</div>
</div>
<div className="flex items-center justify-between">
<div className="flex items-center">
<input
id="remember-me"
name="remember-me"
type="checkbox"
className="h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded"
checked={rememberMe}
onChange={(e) => setRememberMe(e.target.checked)}
/>
<label htmlFor="remember-me" className="ml-2 block text-sm text-gray-700">Remember me</label>
</div>
<div className="text-sm">
<a href="#" className="font-medium text-indigo-600 hover:text-indigo-500">Forgot password?</a>
</div>
</div>
<div>
<button type="submit"
className="w-full flex justify-center py-3 px-4 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition duration-200">
Sign in
</button>
</div>
</form>
<div className="mt-8 text-center">
<p className="text-sm text-gray-600">
Don't have an account?
<a href="#" className="font-medium text-indigo-600 hover:text-indigo-500">Request access</a>
</p>
</div>
</div>
);
}
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<LoginForm />);
</script>
</body>
</html>