diff --git a/ProjectSourceCode/src/index.js b/ProjectSourceCode/src/index.js index c70bd91..1187b17 100644 --- a/ProjectSourceCode/src/index.js +++ b/ProjectSourceCode/src/index.js @@ -162,7 +162,7 @@ app.get('/', (req, res) => { // Render login page for /login route app.get('/login', (req, res) => { - res.render('pages/home'); + res.render('/'); }); // Trigger login form to check database for matching username and password @@ -182,7 +182,7 @@ app.post('/login', async (req, res) => { // Check if match returns no data if (!match) { // Render the login page with the message parameter - return res.render('pages/home', { message: 'Password does not match' }); + return res.render('/', { message: 'Password does not match' }); } else{ // Save user information in the session variable @@ -190,7 +190,7 @@ app.post('/login', async (req, res) => { req.session.save(); // Redirect user to the home page - res.redirect('/home'); + res.redirect('/'); } } catch (error) { // Direct user to login screen if no user is found with matching password @@ -204,7 +204,7 @@ app.post('/login', async (req, res) => { // Render registration page for /register route app.get('/register', (req, res) => { - res.render('pages/register'); + res.redirect('/'); }); // Trigger Registration Form to Post @@ -259,8 +259,6 @@ app.get('/logout', (req, res) => { }); }); - - /************************ League Page Routes *************************/ diff --git a/ProjectSourceCode/src/resources/css/login-and-registration/account.css b/ProjectSourceCode/src/resources/css/login-and-registration/account.css new file mode 100644 index 0000000..1529c50 --- /dev/null +++ b/ProjectSourceCode/src/resources/css/login-and-registration/account.css @@ -0,0 +1,3 @@ +#account-pane { + display: none; +} \ No newline at end of file diff --git a/ProjectSourceCode/src/resources/css/login-and-registration/login.css b/ProjectSourceCode/src/resources/css/login-and-registration/login.css index baed53c..d33eeb6 100644 --- a/ProjectSourceCode/src/resources/css/login-and-registration/login.css +++ b/ProjectSourceCode/src/resources/css/login-and-registration/login.css @@ -1,4 +1,4 @@ -#login-page { +#login-pane { display: none; } diff --git a/ProjectSourceCode/src/resources/css/login-and-registration/login_and_registration.css b/ProjectSourceCode/src/resources/css/login-and-registration/login_and_registration.css index 6894a6e..abb0b6f 100644 --- a/ProjectSourceCode/src/resources/css/login-and-registration/login_and_registration.css +++ b/ProjectSourceCode/src/resources/css/login-and-registration/login_and_registration.css @@ -1,6 +1,7 @@ + +/* Standardized Styling for Login, Registration, and Account Panes */ .account-portal-container { width: 400px; - height: 408px; position: absolute; top: 150px; /* Adjust this value as needed */ right: 20px; /* Adjust this value as needed */ @@ -10,7 +11,12 @@ border: 1px solid gray; } +/* Set Login and Registration Panes to be same size */ +#login-pane, #register-pane { + height: 408px; +} +/* */ .form-container { width: 70%; /* Adjust width as needed */ margin: 0 auto; /* Center horizontally */ diff --git a/ProjectSourceCode/src/resources/js/navigation-bar/user/login-and-register-page-linking.js b/ProjectSourceCode/src/resources/js/navigation-bar/user/login-and-register-page-linking.js index d83d818..5d67dc6 100644 --- a/ProjectSourceCode/src/resources/js/navigation-bar/user/login-and-register-page-linking.js +++ b/ProjectSourceCode/src/resources/js/navigation-bar/user/login-and-register-page-linking.js @@ -5,10 +5,10 @@ $(document).ready(function() { $('#register-screen-container').hide(); // Toggle the visibility of the login container - $('#login-page').toggle(); + $('#login-pane').toggle(); }); - $('#register-page-login-button').click(function() { + $('#register-page-login-button').click(function (event) { event.preventDefault(); // Prevent the default action of following the link $('#register-screen-container').hide(); @@ -27,4 +27,15 @@ $(document).ready(function () { // Show the register container $('#register-screen-container').show(); }); + +}); + +$(document).ready(function() { + + // When #user is clicked + $('#user-profile-button').click(function() { + + // Toggle the visibility of the login container + $('#account-pane').toggle(); + }); }); \ No newline at end of file diff --git a/ProjectSourceCode/src/views/partials/head.hbs b/ProjectSourceCode/src/views/partials/head.hbs index 44953fc..716b4a5 100644 --- a/ProjectSourceCode/src/views/partials/head.hbs +++ b/ProjectSourceCode/src/views/partials/head.hbs @@ -13,6 +13,7 @@ + diff --git a/ProjectSourceCode/src/views/partials/navigation-bar/nav.hbs b/ProjectSourceCode/src/views/partials/navigation-bar/nav.hbs index e7f38b5..6fa4471 100644 --- a/ProjectSourceCode/src/views/partials/navigation-bar/nav.hbs +++ b/ProjectSourceCode/src/views/partials/navigation-bar/nav.hbs @@ -57,15 +57,15 @@ {{#if user.username}} -