Skip to content

Commit

Permalink
Merge pull request Its-Aman-Yadav#714 from Poonam-Kashyap12/main
Browse files Browse the repository at this point in the history
Issue No. = Its-Aman-Yadav#670  Now, signup page working properly, Issue No.= Its-Aman-Yadav#669 Now, login page working properly ,Issue no.=Its-Aman-Yadav#624 now ,email accepting valid input
  • Loading branch information
Its-Aman-Yadav authored Jun 11, 2024
2 parents 6453c23 + 53e0b5d commit f52caa4
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 73 deletions.
137 changes: 64 additions & 73 deletions login.html
Original file line number Diff line number Diff line change
@@ -1,82 +1,73 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="login.css" />
<!-- font-awesome link -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
/>
<title>Login/Register</title>
</head>
<body>
<div class="container">
<input type="checkbox" id="flip" />
<div class="cover">
<div class="front">
<div class="text">
<img src="images/Slide1.jpg" alt="" />
</div>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="login.css" />
<!-- font-awesome link -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
/>
<title>Login page</title>
</head>
<body>
<div class="container">
<div class="cover">
<div class="front">
<div class="text">
<img src="images/Slide1.jpg" alt="" />
</div>
</div>
<form action="#">
<div class="form-content">
<div class="login-form">
<div class="title">Login</div>
<div class="input-boxes">
<div class="input-box">
<i class="fas fa-envelope"></i>
<input type="text " placeholder="Enter your Email" required />
</div>
<div class="input-box">
<i class="fas fa-lock"></i>
<input
type="password"
placeholder="Enter your Password"
required
/>
</div>
<div class="text"><a href="#">Forgot password?</a></div>
<div class="button input-box">
<input type="submit" value="Submit" />
</div>
<div class="text login-text">
Don't have an account? <label for="flip">Signup now</label>
</div>
</div>

<!-- Login Form -->
<form id="loginForm">
<div class="form-content">
<div class="login-form">
<div class="title">Login</div>
<div class="input-boxes">
<div class="input-box">
<i class="fas fa-envelope"></i>
<input type="email" id="myemail" placeholder="Enter your Email" required />
</div>
</div>
<div class="signup-form">
<div class="title">Signup</div>
<div class="input-boxes">
<div class="input-box">
<i class="fas fa-user"></i>
<input type="text " placeholder="Enter your Name" required />
</div>
<div class="input-box">
<i class="fas fa-envelope"></i>
<input type="text " placeholder="Enter your Email" required />
</div>
<div class="input-box">
<i class="fas fa-lock"></i>
<input
type="password"
placeholder="Enter your Password"
required
/>
</div>

<div class="button input-box">
<input type="submit" value="Submit" />
</div>
<div class="text sign-up-text">
Already have an account? <label for="flip">Login now</label>
</div>
<div class="input-box">
<i class="fas fa-lock"></i>
<input type="password" id="mypassword" placeholder="Enter your Password" required />
</div>
<div class="text"><a href="#">Forgot password?</a></div>
<div class="button input-box">
<input type="button" value="Submit" onclick="authenticate()" />
</div>
<div class="text login-text">
Don't have an account? <a href="signup.html">Sign Up</a>
</div>
</div>
</div>
</form>
</div>
</body>
</div>
</form>
</div>
<script>
// User credentials object
const users = [
{ email: '[email protected]', password: 'password1' },
{ email: '[email protected]', password: 'password2' },
{ email: '[email protected]', password: 'password3' }
];

function authenticate() {
var email = document.getElementById("myemail").value;
var password = document.getElementById("mypassword").value;

// Check if the entered email and password match any of the predefined credentials
const authenticatedUser = users.find(user => user.email === email && user.password === password);

if (authenticatedUser) {
window.location.href = "index.html";
} else {
alert('Invalid email or password');
}
}
</script>
</body>
</html>
54 changes: 54 additions & 0 deletions signup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="login.css" />
<!-- font-awesome link -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
/>
<title>Signup</title>
</head>
<body>
<div class="container">
<div class="cover">
<div class="front">
<div class="text">
<img src="images/Slide1.jpg" alt="" />
</div>
</div>
</div>

<!-- Signup Form -->
<form action="index.html" method="get">
<div class="form-content">
<div class="signup-form">
<div class="title">Signup</div>
<div class="input-boxes">
<div class="input-box">
<i class="fas fa-user"></i>
<input type="text" id="username" placeholder="Enter your Name" required />
</div>
<div class="input-box">
<i class="fas fa-envelope"></i>
<input type="email" id="myemail" placeholder="Enter your Email" required />
</div>
<div class="input-box">
<i class="fas fa-lock"></i>
<input type="password" id="mypassword" placeholder="Enter your Password" required />
</div>
<div class="button input-box">
<input type="submit" value="Submit" />
</div>
<div class="text sign-up-text">
Already have an account? <a href="login.html">Login now</a>
</div>
</div>
</div>
</div>
</form>
</div>
</body>
</html>

0 comments on commit f52caa4

Please sign in to comment.