From b5cfb13ea2b274d96f1d771582ed3ea355965c2e Mon Sep 17 00:00:00 2001 From: Atiwit Pattanapukdee <65160394@go.buu.ac.th> Date: Sun, 16 Mar 2025 22:34:17 +0700 Subject: [PATCH] Project Round 2 --- controllers/tourController.js | 2 +- public/css/login.css | 96 ++++++++++++++++++++++ public/css/regis.css | 114 +++++++++++++++++++++++++++ public/css/{style.css => styles.css} | 0 views/index.ejs | 2 +- views/login.ejs | 2 +- views/register.ejs | 2 +- 7 files changed, 214 insertions(+), 4 deletions(-) create mode 100644 public/css/login.css create mode 100644 public/css/regis.css rename public/css/{style.css => styles.css} (100%) diff --git a/controllers/tourController.js b/controllers/tourController.js index 3e742df..cc5b92b 100644 --- a/controllers/tourController.js +++ b/controllers/tourController.js @@ -80,7 +80,7 @@ exports.postLogin = async (req, res) => { exports.Logout = (req, res) => { req.session.destroy(() => { - res.redirect('/login'); + res.redirect('/'); }); }; diff --git a/public/css/login.css b/public/css/login.css new file mode 100644 index 0000000..45a9227 --- /dev/null +++ b/public/css/login.css @@ -0,0 +1,96 @@ +/* Global Styles */ +body { + font-family: 'Arial', sans-serif; + background-color: #f0f2f5; + margin: 0; + padding: 0; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +.login-container { + background-color: #fff; + border-radius: 8px; + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); + padding: 30px; + width: 100%; + max-width: 400px; + text-align: center; +} + +h2 { + font-size: 24px; + margin-bottom: 20px; + color: #333; +} + +/* Error Message Styling */ +.error-message { + background-color: #f8d7da; + color: #721c24; + padding: 10px; + border-radius: 5px; + margin-bottom: 15px; + font-size: 14px; +} + +/* Input Group */ +.input-group { + margin-bottom: 20px; + text-align: left; +} + +.input-group label { + font-size: 14px; + color: #666; + margin-bottom: 5px; + display: block; +} + +.input-group input { + width: 100%; + padding: 10px; + border: 1px solid #ccc; + border-radius: 5px; + font-size: 16px; + outline: none; + transition: border-color 0.3s ease; +} + +.input-group input:focus { + border-color: #007bff; +} + +/* Submit Button */ +button { + width: 100%; + padding: 12px; + background-color: #007bff; + color: white; + border: none; + border-radius: 5px; + font-size: 16px; + cursor: pointer; + transition: background-color 0.3s ease; +} + +button:hover { + background-color: #0056b3; +} + +/* Register Link */ +p { + font-size: 14px; + color: #666; +} + +a { + color: #007bff; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} diff --git a/public/css/regis.css b/public/css/regis.css new file mode 100644 index 0000000..b3d0237 --- /dev/null +++ b/public/css/regis.css @@ -0,0 +1,114 @@ +/* Global Styles */ +body { + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + background-color: #f7f9fc; + margin: 0; + padding: 0; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +.register-container { + background-color: #ffffff; + border-radius: 10px; + box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1); + padding: 40px; + width: 100%; + max-width: 420px; + text-align: center; + transition: transform 0.3s ease-in-out; +} + +.register-container:hover { + transform: translateY(-5px); +} + +h2 { + font-size: 28px; + color: #333; + margin-bottom: 20px; + font-weight: 600; +} + +/* Error Message Styling */ +.error-message { + background-color: #f8d7da; + color: #721c24; + padding: 12px; + border-radius: 5px; + margin-bottom: 20px; + font-size: 14px; + box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1); +} + +/* Input Group */ +.input-group { + margin-bottom: 25px; + text-align: left; + display: flex; + flex-direction: column; + align-items: flex-start; +} + +.input-group label { + font-size: 16px; + color: #666; + margin-bottom: 8px; +} + +.input-group input { + width: 100%; + padding: 14px; + border: 1px solid #ccc; + border-radius: 8px; + font-size: 16px; + outline: none; + transition: border-color 0.3s ease, box-shadow 0.3s ease; + background-color: #f7f9fc; +} + +.input-group input:focus { + border-color: #5c6bc0; + box-shadow: 0 0 10px rgba(92, 107, 192, 0.3); +} + +/* Submit Button */ +button { + width: 100%; + padding: 15px; + background-color: #5c6bc0; + color: white; + border: none; + border-radius: 8px; + font-size: 18px; + font-weight: 600; + cursor: pointer; + transition: background-color 0.3s ease, transform 0.2s ease; +} + +button:hover { + background-color: #3f4f8c; + transform: translateY(-2px); +} + +button:active { + transform: translateY(1px); +} + +/* Register Link */ +p { + font-size: 16px; + color: #777; +} + +a { + color: #5c6bc0; + text-decoration: none; + font-weight: 600; +} + +a:hover { + text-decoration: underline; +} diff --git a/public/css/style.css b/public/css/styles.css similarity index 100% rename from public/css/style.css rename to public/css/styles.css diff --git a/views/index.ejs b/views/index.ejs index 2076198..2962118 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -4,7 +4,7 @@ <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Tour Website</title> - <link rel="stylesheet" href="/css/style.css"> + <link rel="stylesheet" href="/css/styles.css"> </head> <body> <header> diff --git a/views/login.ejs b/views/login.ejs index 96e215e..245b485 100644 --- a/views/login.ejs +++ b/views/login.ejs @@ -4,7 +4,7 @@ <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Login</title> - <link rel="stylesheet" href="/styles.css"> + <link rel="stylesheet" href="/login.css"> </head> <body> <div class="login-container"> diff --git a/views/register.ejs b/views/register.ejs index b12cfe4..93bdcb0 100644 --- a/views/register.ejs +++ b/views/register.ejs @@ -4,7 +4,7 @@ <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Register</title> - <link rel="stylesheet" href="/styles.css"> + <link rel="stylesheet" href="/regis.css"> </head> <body> <div class="register-container"> -- GitLab