Skip to content
Merged
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
14 changes: 12 additions & 2 deletions website/pages/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,14 @@ <h6 style="text-align: center; color: rgb(197 197 197); font-weight: 500; font-s
}
})

document.getElementById('loginButton').addEventListener('click', function() {
function login(event) {
// Check the identity of the key that was pressed.
if(event.type !== 'click') {
if(event.key !== 'Enter') {
return;
}
}

const emailInput = document.getElementById('emailInput');
const passwordInput = document.getElementById('passwordInput');
const emailValue = emailInput.value.trim();
Expand Down Expand Up @@ -228,7 +235,10 @@ <h6 style="text-align: center; color: rgb(197 197 197); font-weight: 500; font-s
// Redirect to index.html
alert('Login successful!');
window.location.href = '../../index.html';
});
}

document.getElementById('loginButton').addEventListener('click', login);
document.addEventListener("keyup", login);
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<script src="../scripts/script.js"></script>
Expand Down
13 changes: 10 additions & 3 deletions website/pages/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<center>
<div class="login-container" style="padding-top: 20px;">
<h1 style="text-align: center; color: rgb(255, 255, 255); font-weight: 400; font: sans-serif;">SIGN UP</h1>
<div id="errorContainer" class="error-message"></div>
<div id="errorContainer" class="error-message" style="color: white"></div>
<div style="text-align: left; margin-left: 10%;" class="mb-3">
<label for="emailInput" class="form-label" style="color: white;">Email address</label>
<input type="email" class="form-control" id="emailInput" placeholder="Enter your Email Address" style="width: 90%; margin-top: -5px">
Expand Down Expand Up @@ -199,7 +199,12 @@ <h1 style="text-align: center; color: rgb(255, 255, 255); font-weight: 400; font
})

// Function to handle signup
document.getElementById('signupButton').addEventListener('click', function () {
function signup(event) {
if(event.type !== "click") {
if(event.key !== 'Enter') {
return;
}
}
const emailInput = document.getElementById('emailInput');
const passwordInput = document.getElementById('passwordInput');
const confirmPasswordInput = document.getElementById('confirmPasswordInput');
Expand Down Expand Up @@ -248,7 +253,9 @@ <h1 style="text-align: center; color: rgb(255, 255, 255); font-weight: 400; font
// Redirect to login page
alert('Your account has been created successfully!');
window.location.href = 'login.html';
});
}
document.getElementById('signupButton').addEventListener('click', signup);
document.addEventListener('keyup', signup);

// Load remembered email on page load
window.onload = function () {
Expand Down