Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Frontend for Login Page #4

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 86 additions & 33 deletions client/src/components/Signup.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,91 @@
import React, { useState } from 'react';
import React, { useState } from "react";

const Signup: React.FC = () => {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');

const handleEmailChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setEmail(e.target.value);
};

const handlePasswordChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setPassword(e.target.value);
};

const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
// Add your sign-up logic here
};

return (
<div className='h-[60vh] w-[90vh] p-2 flex flex-col justify-evenly items-center bg-wrapper backdrop-blur-md text-black/90 z-1 border border-slate-400/30 rounded-lg'>
<h2 className='text-2xl text-black '>Sign Up</h2>
<form onSubmit={handleSubmit} className="flex flex-col item-center justify-center gap-4">
<div>
<label htmlFor="email">Email:</label>
<input type="email" id="email" value={email} onChange={handleEmailChange} />
</div>
<div>
<label htmlFor="password">Password:</label>
<input type="password" id="password" value={password} onChange={handlePasswordChange} />
</div>
</form>
<button type="submit">Sign Up</button>
</div>
);
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");

const handleEmailChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setEmail(e.target.value);
};

const handlePasswordChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setPassword(e.target.value);
};

const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
// Add your sign-up logic here
};

return (
<div className="flex h-[100vh] w-screen ">
<div className=" h-screen">
<img
src="https://ideogram.ai/api/images/direct/c5rIT2ruTjO5eaDHjj3sSA.jpg"
alt=""
className="h-full object-cover"
/>
</div>
<div className="w-screen p-2 flex flex-col justify-around items-center text-black/90 z-1 border border-slate-400/30 rounded-lg">
<h2 className="text-4xl text-black font-bold uppercase ">User Login</h2>
<form
onSubmit={handleSubmit}
className="flex flex-col item-center justify-center gap-4"
>
<div>
{/* <label htmlFor="email">Email:</label> */}
<label
htmlFor="email-address-icon"
className="block mb-2 text-sm font-medium text-gray-900"
>
Your Email
</label>
<div className="relative">
<div className="absolute inset-y-0 start-0 flex items-center ps-3.5 pointer-events-none">
<svg
className="w-4 h-4 text-gray-500 dark:text-gray-400"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
fill="currentColor"
viewBox="0 0 20 16"
>
<path d="m10.036 8.278 9.258-7.79A1.979 1.979 0 0 0 18 0H2A1.987 1.987 0 0 0 .641.541l9.395 7.737Z" />
<path d="M11.241 9.817c-.36.275-.801.425-1.255.427-.428 0-.845-.138-1.187-.395L0 2.6V14a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V2.5l-8.759 7.317Z" />
</svg>
</div>
<input
type="text"
id="email"
value={email}
onChange={handleEmailChange}
className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full ps-10 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder="[email protected]"
required
/>
</div>

{/* <input type="email" id="email" value={email} onChange={handleEmailChange} /> */}
</div>
<div>
<label htmlFor="password" className="text-sm">Password:</label>
{/* <input type="password" id="password" value={password} onChange={handlePasswordChange} /> */}

{/* <label htmlFor="password" className="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Your password</label> */}
<input
type="password"
id="password"
className="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light"
name="password"
required
value={password}
onChange={handlePasswordChange}
/>
</div>
</form>
<button type="submit" className=" bg-blue-400 py-2 px-4 rounded-md">Sign Up</button>
</div>
</div>
);
};

export default Signup;
9 changes: 5 additions & 4 deletions client/src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ body {
font-family: 'Roboto', sans-serif;
background-color: #f5f5f5;
color: #333;
background-image: url('https://ideogram.ai/api/images/direct/c5rIT2ruTjO5eaDHjj3sSA.jpg');
background-repeat: no-repeat;
background-size: cover;
background-position: initial;
/* background-image: url('https://ideogram.ai/api/images/direct/c5rIT2ruTjO5eaDHjj3sSA.jpg'); */
/* background-repeat: no-repeat; */
/* background-size: cover; */
/* background-position: center; */

}

.bg-wrapper{
Expand Down