2025-11-16 18:29:54 +09:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import { useState } from "react";
|
|
|
|
|
import Link from "next/link";
|
2025-11-17 10:36:53 +09:00
|
|
|
import MainLogo from "@/app/svgs/mainlogosvg"
|
2025-11-18 01:37:56 +09:00
|
|
|
import LoginCheckboxActiveSvg from "@/app/svgs/logincheckboxactivesvg";
|
|
|
|
|
import LoginCheckboxInactiveSvg from "@/app/svgs/logincheckboxinactivesvg";
|
|
|
|
|
import LoginInputSvg from "@/app/svgs/inputformx";
|
|
|
|
|
import LoginErrorModal from "./LoginErrorModal";
|
|
|
|
|
import LoginOption from "@/app/login/loginoption";
|
2025-11-16 18:29:54 +09:00
|
|
|
|
|
|
|
|
export default function LoginPage() {
|
|
|
|
|
const [userId, setUserId] = useState("");
|
|
|
|
|
const [password, setPassword] = useState("");
|
|
|
|
|
const [rememberId, setRememberId] = useState(false);
|
|
|
|
|
const [autoLogin, setAutoLogin] = useState(false);
|
2025-11-18 01:37:56 +09:00
|
|
|
const [isUserIdFocused, setIsUserIdFocused] = useState(false);
|
|
|
|
|
const [isPasswordFocused, setIsPasswordFocused] = useState(false);
|
|
|
|
|
const [isLoginErrorOpen, setIsLoginErrorOpen] = useState(false);
|
|
|
|
|
const [idError, setIdError] = useState("");
|
|
|
|
|
const [passwordError, setPasswordError] = useState("");
|
2025-11-16 18:29:54 +09:00
|
|
|
|
|
|
|
|
function handleSubmit(e: React.FormEvent<HTMLFormElement>) {
|
|
|
|
|
e.preventDefault();
|
2025-11-18 01:37:56 +09:00
|
|
|
// 실제 로그인 API 연동 전까지는 실패 모달을 노출합니다.
|
|
|
|
|
// API 연동 시 결과에 따라 성공/실패 분기에서 setIsLoginErrorOpen(true) 호출로 교체하세요.
|
|
|
|
|
// if (userId.trim().length > 0 && password.trim().length > 0) {
|
|
|
|
|
// setIsLoginErrorOpen(true);
|
|
|
|
|
// }
|
2025-11-16 18:29:54 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
2025-11-17 22:51:23 +09:00
|
|
|
<div className="min-h-screen w-full flex flex-col items-center justify-between">
|
2025-11-18 01:37:56 +09:00
|
|
|
|
|
|
|
|
<LoginErrorModal
|
|
|
|
|
open={isLoginErrorOpen}
|
|
|
|
|
onClose={() => setIsLoginErrorOpen(false)}
|
|
|
|
|
/>
|
|
|
|
|
<LoginOption
|
|
|
|
|
onClick={() => setIsLoginErrorOpen(true)}
|
|
|
|
|
loginErrorModalEnabled={isLoginErrorOpen}
|
|
|
|
|
setLoginErrorModalEnabled={setIsLoginErrorOpen}
|
|
|
|
|
/>
|
|
|
|
|
|
2025-11-17 22:51:23 +09:00
|
|
|
<div className="rounded-xl bg-white max-w-[560px] px-[40px] w-full">
|
2025-11-16 18:29:54 +09:00
|
|
|
{/* 로고 영역 */}
|
2025-11-18 01:37:56 +09:00
|
|
|
<div className="my-15 flex flex-col items-center">
|
2025-11-17 10:36:53 +09:00
|
|
|
<div className="mb-[7px]">
|
|
|
|
|
<MainLogo/>
|
|
|
|
|
</div>
|
2025-11-17 22:51:23 +09:00
|
|
|
<div className="text-[28.8px] font-extrabold leading-[145%] text-neutral-700" >
|
2025-11-16 18:29:54 +09:00
|
|
|
XR LMS
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* 폼 */}
|
2025-11-18 01:37:56 +09:00
|
|
|
<form onSubmit={handleSubmit} className="space-y-5">
|
2025-11-16 18:29:54 +09:00
|
|
|
<div className="space-y-4">
|
|
|
|
|
{/* 아이디 */}
|
2025-11-18 01:37:56 +09:00
|
|
|
<div className="relative">
|
2025-11-16 18:29:54 +09:00
|
|
|
<label htmlFor="userId" className="sr-only">
|
|
|
|
|
아이디
|
|
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
id="userId"
|
|
|
|
|
name="userId"
|
|
|
|
|
value={userId}
|
|
|
|
|
onChange={(e) => setUserId(e.target.value)}
|
2025-11-18 01:37:56 +09:00
|
|
|
onFocus={() => setIsUserIdFocused(true)}
|
|
|
|
|
onBlur={() => setIsUserIdFocused(false)}
|
2025-11-17 10:36:53 +09:00
|
|
|
placeholder="아이디 (이메일)"
|
2025-11-17 22:51:23 +09:00
|
|
|
className="
|
|
|
|
|
h-[56px] px-[12px] py-[7px] w-full rounded-[8px] border border-neutral-40
|
2025-11-17 10:36:53 +09:00
|
|
|
focus:outline-none focus:ring-0 focus:ring-offset-0 focus:shadow-none
|
|
|
|
|
focus:appearance-none focus:border-neutral-700
|
2025-11-17 22:51:23 +09:00
|
|
|
text-[18px] text-neutral-700 font-normal leading-[150%] placeholder:text-input-placeholder-text
|
2025-11-18 01:37:56 +09:00
|
|
|
pr-[40px]
|
2025-11-17 22:51:23 +09:00
|
|
|
"
|
2025-11-16 18:29:54 +09:00
|
|
|
/>
|
2025-11-18 01:37:56 +09:00
|
|
|
{userId.trim().length > 0 && isUserIdFocused && (
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onMouseDown={(e) => {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
setUserId("");
|
|
|
|
|
}}
|
|
|
|
|
aria-label="입력 지우기"
|
|
|
|
|
className="absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer"
|
|
|
|
|
>
|
|
|
|
|
<LoginInputSvg />
|
|
|
|
|
</button>
|
|
|
|
|
)}
|
2025-11-16 18:29:54 +09:00
|
|
|
</div>
|
|
|
|
|
{/* 비밀번호 */}
|
2025-11-18 01:37:56 +09:00
|
|
|
<div className="relative">
|
2025-11-16 18:29:54 +09:00
|
|
|
<label htmlFor="password" className="sr-only">
|
|
|
|
|
비밀번호
|
|
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
id="password"
|
|
|
|
|
name="password"
|
|
|
|
|
type="password"
|
|
|
|
|
value={password}
|
|
|
|
|
onChange={(e) => setPassword(e.target.value)}
|
2025-11-18 01:37:56 +09:00
|
|
|
onFocus={() => setIsPasswordFocused(true)}
|
|
|
|
|
onBlur={() => setIsPasswordFocused(false)}
|
2025-11-16 18:29:54 +09:00
|
|
|
placeholder="비밀번호"
|
2025-11-17 22:51:23 +09:00
|
|
|
className="
|
|
|
|
|
h-[56px] px-[12px] py-[7px] rounded-[8px] w-full border border-neutral-40
|
|
|
|
|
focus:outline-none focus:ring-0 focus:ring-offset-0 focus:shadow-none
|
|
|
|
|
focus:appearance-none focus:border-neutral-700
|
|
|
|
|
text-[18px] text-neutral-700 font-normal leading-[150%] placeholder:text-input-placeholder-text
|
2025-11-18 01:37:56 +09:00
|
|
|
pr-[40px]
|
2025-11-17 22:51:23 +09:00
|
|
|
"
|
2025-11-16 18:29:54 +09:00
|
|
|
/>
|
2025-11-18 01:37:56 +09:00
|
|
|
{password.trim().length > 0 && isPasswordFocused && (
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onMouseDown={(e) => {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
setPassword("");
|
|
|
|
|
}}
|
|
|
|
|
aria-label="입력 지우기"
|
|
|
|
|
className="absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer"
|
|
|
|
|
>
|
|
|
|
|
<LoginInputSvg />
|
|
|
|
|
</button>
|
|
|
|
|
)}
|
2025-11-16 18:29:54 +09:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* 체크박스들 */}
|
2025-11-18 01:37:56 +09:00
|
|
|
<div className="flex items-center justify-start gap-6 mb-15">
|
2025-11-17 22:51:23 +09:00
|
|
|
<label className="flex cursor-pointer select-none items-center gap-2 text-[15px] font-normal text-basic-text">
|
2025-11-16 18:29:54 +09:00
|
|
|
<input
|
|
|
|
|
type="checkbox"
|
|
|
|
|
checked={rememberId}
|
|
|
|
|
onChange={(e) => setRememberId(e.target.checked)}
|
2025-11-18 01:37:56 +09:00
|
|
|
className="sr-only"
|
2025-11-16 18:29:54 +09:00
|
|
|
/>
|
2025-11-18 01:37:56 +09:00
|
|
|
{rememberId ? (
|
|
|
|
|
<LoginCheckboxActiveSvg />
|
|
|
|
|
) : (
|
|
|
|
|
<LoginCheckboxInactiveSvg />
|
|
|
|
|
)}
|
2025-11-16 18:29:54 +09:00
|
|
|
아이디 기억하기
|
|
|
|
|
</label>
|
2025-11-17 22:51:23 +09:00
|
|
|
<label className="flex cursor-pointer select-none items-center gap-2 text-[15px] font-normal text-basic-text">
|
2025-11-16 18:29:54 +09:00
|
|
|
<input
|
|
|
|
|
type="checkbox"
|
|
|
|
|
checked={autoLogin}
|
|
|
|
|
onChange={(e) => setAutoLogin(e.target.checked)}
|
2025-11-18 01:37:56 +09:00
|
|
|
className="sr-only"
|
2025-11-16 18:29:54 +09:00
|
|
|
/>
|
2025-11-18 01:37:56 +09:00
|
|
|
{autoLogin ? (
|
|
|
|
|
<LoginCheckboxActiveSvg />
|
|
|
|
|
) : (
|
|
|
|
|
<LoginCheckboxInactiveSvg />
|
|
|
|
|
)}
|
2025-11-16 18:29:54 +09:00
|
|
|
자동 로그인
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* 로그인 버튼 */}
|
|
|
|
|
<button
|
|
|
|
|
type="submit"
|
2025-11-18 01:37:56 +09:00
|
|
|
className={`h-14 w-full rounded-lg text-[16px] font-semibold text-white transition-opacity cursor-pointer mb-3 ${userId.trim().length > 0 && password.trim().length > 0 ? "bg-active-button" : "bg-inactive-button"}`}
|
2025-11-16 18:29:54 +09:00
|
|
|
>
|
|
|
|
|
로그인
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
{/* 하단 링크들 */}
|
2025-11-18 01:37:56 +09:00
|
|
|
<div className="flex items-center justify-between text-[15px] leading-[150%] h-[36px]">
|
2025-11-16 18:29:54 +09:00
|
|
|
<Link
|
2025-11-17 22:51:23 +09:00
|
|
|
href="/register"
|
2025-11-18 01:37:56 +09:00
|
|
|
className="underline-offset-2 text-basic-text font-bold"
|
2025-11-16 18:29:54 +09:00
|
|
|
>
|
|
|
|
|
회원가입
|
|
|
|
|
</Link>
|
|
|
|
|
<div
|
2025-11-17 22:51:23 +09:00
|
|
|
className="flex items-center gap-3 text-basic-text"
|
2025-11-16 18:29:54 +09:00
|
|
|
>
|
2025-11-17 22:51:23 +09:00
|
|
|
<Link href="#" className="underline-offset-2">
|
2025-11-16 18:29:54 +09:00
|
|
|
아이디 찾기
|
|
|
|
|
</Link>
|
2025-11-17 22:51:23 +09:00
|
|
|
<span className="h-3 w-px bg-input-border" />
|
|
|
|
|
<Link href="#" className="underline-offset-2">
|
2025-11-16 18:29:54 +09:00
|
|
|
비밀번호 재설정
|
|
|
|
|
</Link>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
2025-11-17 22:51:23 +09:00
|
|
|
<div></div>
|
|
|
|
|
<p className="text-center py-[40px] text-[15px] text-basic-text">
|
2025-11-16 18:29:54 +09:00
|
|
|
Copyright ⓒ 2025 XL LMS. All rights reserved
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|