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

change theme of login and register form #285

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#ffffff" />
<title>Rentalog || Free Rent Management Web App For Landlords</title>

</head>

<body>
Expand Down
47 changes: 38 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/components/AboutUs-section/AboutUs-section.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
text-align: center;
padding-bottom: 150px;
overflow: hidden;
color: black;
}

.aboutUs-section .row {
Expand Down
53 changes: 42 additions & 11 deletions src/pages/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ export default function Login() {
password: "",
});


const [hover, setHovers] = useState({
email: false,
password: false,
});

const [errors, setErrors] = useState({});
const handleChange = (e) => {
setForm({ ...form, [e.target.name]: e.target.value });
Expand All @@ -18,11 +24,11 @@ export default function Login() {
const validationErrors = {};

if (!form.email.trim()) {
validationErrors.email = "email is required";
validationErrors.email = "Email is required";
}

if (!form.password.trim()) {
validationErrors.password = "password is required";
validationErrors.password = "Password is required";
}

setErrors(validationErrors);
Expand All @@ -35,16 +41,32 @@ export default function Login() {
});
}
};
const handleMouseEnter =(field) => {
setHovers({ ...hover, [field] : true});
};
const handleMouseLeave =(field) => {
setHovers({ ...hover, [field] : false});
};

const inputStyle = (isHovered) => ({
backgroundColor : "#FAFAFA",
padding :"0.5rem",
border: '1px solid ${isHovered? "#007bff : #dedede"}',
borderRadius: "0.5rem",
outline:"none",
boxShadow: isHovered ? "0 0 10px rgba(0,123,255,0.2)" : "none",
transition: "border-color 0.3s, box-shadow 0.3s",
});

return (
<article className="flex flex-col justify-center h-[100vh] bg-primaryGreen/10 overflow-hidden">
<article className="flex flex-col justify-center h-[100vh] bg-primaryBlue/10 overflow-hidden">
<Navbar />
<br className=" hidden xl:block"></br>
<section className="flex flex-row justify-baseline items-center ">
<div className="hidden w-full lg:flex lg:mt-12 flex-col lg:justify-start xl:justify-center xl:h-full ">
<div className="mb-10 mx-10 mr-auto">
<h2 className=" text-3xl font-bold text-gray-dark/90 ">
<span className="text-customRed italic"> Best way</span> to manage
<span className="text-customBlue italic"> Best way</span> to manage
you rent
</h2>

Expand All @@ -59,7 +81,7 @@ export default function Login() {
/>
</div>

<div className="flex mx-auto max-w-7xl w-full lg:w-[75vw] h-screen xl:h-fit justify-between lg:rounded-bl-3xl lg:rounded-tl-3xl bg-primaryGreen/10 ">
<div className="flex mx-auto max-w-7xl w-full lg:w-[75vw] h-screen xl:h-fit justify-between lg:rounded-bl-3xl lg:rounded-tl-3xl bg-primaryBlue/10 ">
<div className="w-full h-[100vh] flex flex-col justify-start mt-20 lg:mt-0 lg:justify-center items-center">
<TitleCard />

Expand All @@ -74,7 +96,10 @@ export default function Login() {
type="email"
placeholder="E-mail Address"
onChange={handleChange}
className="input-bar"
onMouseEnter={() => handleMouseEnter("email")}
onMouseLeave={() => handleMouseLeave("email")}
style={inputStyle(hover.email)}
// className="input-bar"
/>
<span className="pl-4 text-[#ff0000] text-sm">
{errors.email}
Expand All @@ -86,22 +111,26 @@ export default function Login() {
type="password"
placeholder="Password"
onChange={handleChange}
onMouseEnter={() => handleMouseEnter("password")}
onMouseLeave={() => handleMouseLeave("password")}
style={inputStyle(hover.password)}

className="input-bar"
/>
<span className="pl-4 text-[#ff0000] text-sm">
{errors.password}
</span>
<Link
to="#"
className="float-right relative bottom-3 text-green hover:underline"
className="float-right relative bottom-3 text-blue hover:underline"
>
Forgot Password?
</Link>

<div className="">
<button
type="submit"
className="border-2 border-green rounded-lg h-10 bg-primaryGreen w-full py-1.5 rounded-xl focus:shadow-md hover:bg-primaryGreen/80 text-textWhite font-semibold mt-2"
className="border-2 border-blue rounded-lg h-10 bg-primaryBlue w-full py-1.5 rounded-xl focus:shadow-md hover:bg-primaryBlue/80 text-textWhite font-semibold mt-2"
>
Log In
</button>
Expand Down Expand Up @@ -147,7 +176,7 @@ export default function Login() {
Don&rsquo;t have any account?{" "}
<Link
to="/register"
className=" text-primaryGreen font-semibold hover:text-primaryGreen/60"
className=" text-primaryBlue font-semibold hover:text-primaryGreen/60"
>
Sign Up
</Link>
Expand All @@ -174,7 +203,7 @@ const TitleCard = () => {
return (
<div className="flex flex-col">
<h2 className="mt-16 text-left text-3xl font-extrabold leading-9 tracking-tight text-gray-dark/90 ">
<span className=" text-customRed text-4xl">Welcome</span>
<span className=" text-customBlue text-4xl">Welcome</span>
<span> </span>back!!
</h2>

Expand All @@ -192,8 +221,10 @@ const Input = (props) => {
<div className="flex flex-col">
<input
{...rest}
className="bg-[#FAFAFA] p-2 border border-[#dedede] outline-none rounded-xl focus:shadow-md"
className="bg-[#FAFAFA] p-2 border border-[#dedede] outline-none rounded-xl focus:shadow-md ${className}"
/>
</div>
);
};


Loading