Skip to content

Commit

Permalink
Merge pull request #286 from kushal7201/feature1
Browse files Browse the repository at this point in the history
Added password toggle and improved UI
  • Loading branch information
PriyaGhosal authored Oct 8, 2024
2 parents 2441ea8 + 18e35a1 commit a93066c
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 16 deletions.
9 changes: 9 additions & 0 deletions firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,12 @@ document.getElementById('loginForm').addEventListener('submit', function (e) {
// Call the login function
loginWithEmailAndPassword(email, password);
});

function togglePassword(fieldId) {
const passwordField = document.getElementById(fieldId);
if (passwordField.type === "password") {
passwordField.type = "text";
} else {
passwordField.type = "password";
}
}
24 changes: 22 additions & 2 deletions login.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ body {
.input-field label {
display: block;
margin-bottom: 0.5rem;
font-weight: bold;
font-weight: 600;
}

.input-field input {
Expand Down Expand Up @@ -131,9 +131,29 @@ body {
.signUp-link a {
color: #3066dc; /* Match the link color with the theme */
text-decoration: none; /* Remove underline from the link */
font-weight: 100; /* Make the link text bold */
font-weight: 300; /* Make the link text bold */
}

.signUp-link a:hover {
text-decoration: underline; /* Add underline on hover for better UX */
}

.req{
color: red;
}

.toggle-password {
cursor: pointer;
position: absolute;
right: 10px;
top: 55%;
}

.input-field {
position: relative;
}

.toggle-password svg {
width: 20px;
height: 20px;
}
11 changes: 9 additions & 2 deletions login.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,19 @@ <h2>Login</h2>

<form id="loginForm" action="book.html" method="POST">
<div class="input-field">
<label for="email">Email:</label>
<label for="email">Email<span class="req">*</span></label>
<input type="email" id="email" name="email" required />
</div>
<div class="input-field">
<label for="password">Password:</label>
<label for="password">Password<span class="req">*</span></label>
<input type="password" id="password" name="password" required />
<span class="toggle-password" onclick="togglePassword('password')">
<!-- Eye SVG Icon -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8S1 12 1 12z"></path>
<circle cx="12" cy="12" r="3"></circle>
</svg>
</span>
</div>
<div class="input-field">
<button type="submit">Continue</button>
Expand Down
24 changes: 22 additions & 2 deletions signUp.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ body {
.input-field label {
display: block;
margin-bottom: 0.4rem;
font-weight: bold;
font-weight: 600;
font-size: medium;
}

Expand Down Expand Up @@ -127,9 +127,29 @@ body {
.signin-link a {
color: #3066dc; /* Match the link color with the theme */
text-decoration: none; /* Remove underline from the link */
font-weight: 100; /* Make the link text bold */
font-weight: 300; /* Make the link text bold */
}

.signin-link a:hover {
text-decoration: underline; /* Add underline on hover for better UX */
}

.req{
color: red;
}

.toggle-password {
cursor: pointer;
position: absolute;
right: 10px;
top: 55%;
}

.input-field {
position: relative;
}

.toggle-password svg {
width: 20px;
height: 20px;
}
29 changes: 19 additions & 10 deletions signUp.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,34 @@ <h2>Create Account</h2>

<form id="signupForm" action="book.html" method="POST">
<div class="input-field">
<label for="name">Full Name:</label>
<label for="name">Full Name<span class="req">*</span></label>
<input type="text" id="name" name="name" required />
</div>
<div class="input-field">
<label for="email">Email:</label>
<label for="email">Email<span class="req">*</span></label>
<input type="email" id="email" name="email" required />
</div>
<div class="input-field">
<label for="password">Password:</label>
<label for="password">Password<span class="req">*</span></label>
<input type="password" id="password" name="password" required />
<span class="toggle-password" onclick="togglePassword('password')">
<!-- Eye SVG Icon -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8S1 12 1 12z"></path>
<circle cx="12" cy="12" r="3"></circle>
</svg>
</span>
</div>
<div class="input-field">
<label for="confirm-password">Confirm Password:</label>
<input
type="password"
id="confirm-password"
name="confirm-password"
required
/>
<label for="confirm-password">Confirm Password<span class="req">*</span></label>
<input type="password" id="confirm-password" name="confirm-password" required />
<span class="toggle-password" onclick="togglePassword('confirm-password')">
<!-- Eye SVG Icon -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8S1 12 1 12z"></path>
<circle cx="12" cy="12" r="3"></circle>
</svg>
</span>
</div>
<div class="input-field">
<button type="submit">Sign Up</button>
Expand Down

0 comments on commit a93066c

Please sign in to comment.