Skip to content

Commit

Permalink
remember me
Browse files Browse the repository at this point in the history
  • Loading branch information
shriyadindi committed Nov 5, 2024
1 parent c1d7cf8 commit 1b64056
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 36 deletions.
11 changes: 9 additions & 2 deletions auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ <h2 class="title">Sign in</h2>
<input type="password" placeholder="Password" id="sign-in-password" />
<i class="fas fa-eye password-toggle" onclick="togglePassword('sign-in-password', this)"></i>
</div>
<div class="form-check d-flex">
<input type="checkbox" class="form-check-input" id="login-remember" />
<label class="form-check-label">Remember me</label>
</div>
<div class="login">
<input type="submit" value="Login" class="btn solid" />
</div>
Expand Down Expand Up @@ -81,12 +85,15 @@ <h2 class="title">Sign up</h2>
</div>

<!-- Password Strength Bars -->
<div class="password-strength">
<!-- <div class="password-strength">
<div id="strength-weak"></div>
<div id="strength-medium"></div>
<div id="strength-strong"></div>
</div> -->
<div class="form-check d-flex">
<input type="checkbox" class="form-check-input" id="login-remember" />
<label class="form-check-label">Remember me</label>
</div>

<input type="submit" class="btn" value="Sign up" />
</form>
<p id="error-message" style="color: red; display: none;"></p>
Expand Down
14 changes: 14 additions & 0 deletions auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,20 @@ document.querySelector(".sign-up-form").addEventListener('submit', function(even
console.error('Signup error:', error);
}
});
document.querySelector('#login-btn').addEventListener('click', (event) => {
event.preventDefault();

const emailInput = document.getElementById('login-email');
const rememberMeCheckbox = document.getElementById('login-remember');

if (rememberMeCheckbox.checked) {
localStorage.setItem('rememberedEmail', emailInput.value);
} else {
localStorage.removeItem('rememberedEmail');
}

// Continue with your existing login logic...
});

// Toggle password visibility
function togglePassword(fieldId, icon) {
Expand Down
35 changes: 1 addition & 34 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
left: 0;
pointer-events: none;
z-index: 99999999;

}

</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
Expand Down Expand Up @@ -3064,34 +3064,6 @@ <h2>Exclusive Deals and Offers!</h2>
window.scrollTo({ top: 0, behavior: "smooth" }); // Smooth scroll to top
};
</script>
// <script>
// document.getElementById('contactForm').addEventListener('submit', function (e) {
// e.preventDefault();

// // Submit the form data using fetch
// fetch(this.action, {
// method: 'POST',
// body: new FormData(this),
// headers: {
// 'Accept': 'application/json'
// }
// }).then(response => {
// // Show the confirmation popup
// document.getElementById('confirmationPopup').style.display = 'block';
// // Reset the form
// this.reset();
// }).catch(error => {
// console.error('Error:', error);
// // Still show the confirmation popup even if there's an error
// document.getElementById('confirmationPopup').style.display = 'block';
// });
// });


// function closePopup() {
// document.getElementById('confirmationPopup').style.display = 'none';
// }
// </script>
<script>
document.getElementById('reviewForm').addEventListener('submit', function(event) {
event.preventDefault(); // Prevents form submission
Expand Down Expand Up @@ -3213,7 +3185,6 @@ <h2>Exclusive Deals and Offers!</h2>
line-height: 1.5;
}
</style>
</script>
<script src="script.js">
document.getElementById('newsletter-form').addEventListener('submit', function (e) {
e.preventDefault(); // Prevent the default form submission
Expand Down Expand Up @@ -3244,7 +3215,6 @@ <h2>Exclusive Deals and Offers!</h2>


<script>
main
// coordinates for the cursor :
const coords = { x: 0, y: 0 };
const circles = document.querySelectorAll(".circle");
Expand Down Expand Up @@ -3326,8 +3296,6 @@ <h2>Exclusive Deals and Offers!</h2>

animateCircles();
});

main
</script>

<body>
Expand Down Expand Up @@ -3376,5 +3344,4 @@ <h2>Exclusive Deals and Offers!</h2>
<script src="script.js"></script>

</body>

</html>

0 comments on commit 1b64056

Please sign in to comment.