diff --git a/frontend/src/app/login/layout.tsx b/frontend/src/app/login/layout.tsx deleted file mode 100644 index cd37163..0000000 --- a/frontend/src/app/login/layout.tsx +++ /dev/null @@ -1,12 +0,0 @@ -export const metadata = { - title: "Patriots & Paws", - description: "Web application for Patriots & Paws", -}; - -export default function LoginLayout({ children }: { children: React.ReactNode }) { - return ( - -
{children} - - ); -} diff --git a/frontend/src/app/login/login.css b/frontend/src/app/login/login.css deleted file mode 100644 index b085b59..0000000 --- a/frontend/src/app/login/login.css +++ /dev/null @@ -1,101 +0,0 @@ -/* Login.css */ - -body, -html { - height: 100%; - margin: 0; -} - -.login-container { - position: relative; - height: 100%; -} - -.login-box { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - display: flex; - flex-direction: column; - align-items: center; - padding: 15px; - border-radius: 12px; - background: #fff; - box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25); - width: 70%; - max-width: 500px; -} - -.logo-container { - position: absolute; - top: -20%; - display: inline-flex; - padding: 15px; - align-items: flex-start; - gap: 10px; - border-radius: 12px; - background: #fff; - box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25); -} - -.logo-image { - background: lightgray no-repeat; - width: 190px; - height: 90px; -} - -.welcome-text { - color: #000; - text-align: center; - font-family: Lora; - font-size: 40px; - font-style: normal; - font-weight: 700; - line-height: normal; - margin-top: 50px; /* Gap between Welcome and Name field */ -} - -.login-form { - width: 100%; - margin-top: 22px; /* Gap between Name and Password */ -} - -.input-group { - margin-bottom: 22px; /* Gap between Password and Forgot Password */ -} - -label { - display: block; - margin-bottom: 5px; - color: gray; -} - -input { - width: 100%; - padding: 8px; - border: 1px solid #ccc; - border-radius: 4px; -} - -.forgot-password { - color: blue; - text-align: center; - margin-bottom: 48px; /* Gap between Forgot password and Log In */ -} - -.login-button { - width: 100%; - height: 50px; - flex-shrink: 0; - border-radius: 4px; - background: var(--Secondary-1, #102d5f); - color: #fff; - cursor: pointer; - text-align: center; - font-family: Lora; - font-size: 24px; - font-style: normal; - font-weight: 700; - line-height: normal; -} diff --git a/frontend/src/app/login/page.module.css b/frontend/src/app/login/page.module.css new file mode 100644 index 0000000..c06f1c5 --- /dev/null +++ b/frontend/src/app/login/page.module.css @@ -0,0 +1,181 @@ +/* Login.css */ + +.loginContainer { + position: relative; + height: 100vh; + margin: 0; +} + +.loginBox { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + display: flex; + flex-direction: column; + align-items: center; + padding: 15px; + border-radius: 12px; + background: #fff; + box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25); + width: 70%; + max-width: 580px; +} + +.logoContainer { + position: absolute; + top: -65px; + display: inline-flex; + padding: 15px; + align-items: flex-start; + gap: 10px; + border-radius: 12px; + background: #fff; + box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25); +} + +.logoImage { + background: lightgray no-repeat; + width: 190px; + height: 90px; +} + +.image { + width: 190px; + height: 90px; +} + +.welcomeText { + color: #000; + text-align: center; + font-family: Lora; + font-size: 40px; + font-style: normal; + font-weight: 700; + line-height: normal; + margin-top: 65px; /* Gap between Welcome and Name field */ +} + +.loginForm { + width: 80%; + margin-top: 54px; /* Gap between Name and Password */ +} + +.inputGroup { + margin-bottom: 16px; /* Gap between Password and Forgot Password */ + padding-top: 6px; +} + +.label { + display: block; + margin-bottom: 5px; + color: gray; + font-size: 16px; +} + +.input { + width: 100%; + padding: 8px; + border: 1px solid #ccc; + border-radius: 4px; +} + +.forgotPassword { + color: #4274f4; + + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: normal; + text-align: center; + padding-top: 30px; + margin-bottom: 48px; /* Gap between Forgot password and Log In */ +} + +.loginButton { + width: 100%; + height: 50px; + flex-shrink: 0; + border-radius: 4px; + background: var(--Secondary-1, #102d5f); + color: #fff; + cursor: pointer; + text-align: center; + font-family: Lora; + font-size: 24px; + font-style: normal; + font-weight: 700; + line-height: normal; + margin-bottom: 49px; +} + +/* tablet version */ +@media screen and (max-width: 850px) { + .backgroundImage { + object-fit: cover; + object-position: 35% 10%; + } + + .loginBox { + width: 90%; + max-width: 500px; + } + + .loginForm { + margin-top: 32px; /* Gap between Name and Password */ + } + + .forgotPassword { + font-size: 12px; + margin-bottom: 38px; /* Gap between Forgot password and Log In */ + } + + .loginButton { + font-size: 18px; + font-weight: 600; + } +} + +/* mobile version */ +@media screen and (max-width: 550px) { + .backgroundImage { + object-fit: cover; + object-position: 35% 10%; + } + + .logoContainer { + padding: 10px; + } + + .logoImage { + width: 130px; + height: 60px; + } + + .image { + width: 130px; + height: 60px; + } + + .welcomeText { + font-size: 28px; + margin-top: 17px; /* Gap between Welcome and Name field */ + } + + .loginForm { + width: 100%; + } + + .inputGroup { + padding-top: 0; + } + + .forgotPassword { + padding-top: 16px; + margin-bottom: 32px; /* Gap between Forgot password and Log In */ + } + + .loginButton { + margin-bottom: 17px; + } +} diff --git a/frontend/src/app/login/page.tsx b/frontend/src/app/login/page.tsx index 19f2fe3..d4dcdbd 100644 --- a/frontend/src/app/login/page.tsx +++ b/frontend/src/app/login/page.tsx @@ -4,10 +4,11 @@ import React, { useState } from "react"; import InputField from "@/components/shared/input/InputField"; import Image from "next/image"; -import "@/app/login/login.css"; +import styles from "@/app/login/page.module.css"; import { signInWithEmailAndPassword } from "firebase/auth"; import { initFirebase } from "@/firebase/firebase"; import { useRouter } from "next/navigation"; +import { useScreenSizes } from "@/util/useScreenSizes"; const Login = () => { const [email, setEmail] = useState(""); @@ -17,6 +18,8 @@ const Login = () => { const router = useRouter(); + const { isMobile } = useScreenSizes(); + const sendTokenToBackend = async (token: string) => { try { const response = await fetch(`http://localhost:3001/api/whoami`, { @@ -60,20 +63,22 @@ const Login = () => { return ( -