Files
uniare.sori.studio/login.html
zenn dbf02241e2 v4.0.0: 회원·덱 API, 인증 UI, 프로필 및 레이아웃 통일
Express/SQLite API와 Docker 구성을 추가하고 로그인·덱 저장·공개 덱·관리자·프로필 화면을 구현했다. 결과 화면 저장 UX, 헤더 프로필, 애드센스용 app-shell 레이아웃(1280px) 및 문서를 반영했다.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-22 16:59:36 +09:00

67 lines
3.0 KiB
HTML

<!doctype html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="./style/output.css" />
<link rel="stylesheet" href="./style/auth-pages.css" />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Noto+Sans+KR:wght@400;700&display=swap" rel="stylesheet" />
<title>로그인 - UADECK</title>
</head>
<body class="auth-page">
<nav class="auth-nav">
<div class="auth-nav-inner">
<a href="/" class="auth-brand">
<img src="/images/assets/apple-touch-icon.png" alt="UA Logo" />
<span class="auth-brand-text">UADECK <span>v4.0.0</span></span>
</a>
</div>
</nav>
<main class="auth-main">
<header class="auth-header">
<h1>로그인</h1>
<p>덱을 저장하고 관리하려면<br />계정으로 로그인하세요.</p>
</header>
<form id="login-form" class="auth-card">
<div class="auth-field">
<label class="auth-label" for="email">이메일</label>
<input type="email" id="email" required class="auth-input" placeholder="you@example.com" autocomplete="email" />
</div>
<div class="auth-field">
<label class="auth-label" for="password">비밀번호</label>
<input type="password" id="password" required class="auth-input" placeholder="••••••••" autocomplete="current-password" />
</div>
<p id="error-msg" class="auth-error hidden"></p>
<button type="submit" class="auth-submit">로그인</button>
</form>
<p class="auth-footer">
계정이 없으신가요?
<a href="/signup.html">회원가입</a>
</p>
</main>
<script src="/script/api.js"></script>
<script>
document.getElementById('login-form').addEventListener('submit', async (e) => {
e.preventDefault();
const errEl = document.getElementById('error-msg');
errEl.classList.add('hidden');
try {
const email = document.getElementById('email').value;
const password = document.getElementById('password').value;
const { token, user } = await UaDeckApi.login(email, password);
UaDeckApi.saveAuth(token, user);
const redirect = new URLSearchParams(location.search).get('redirect') || '/';
location.href = redirect;
} catch (err) {
errEl.textContent = err.message;
errEl.classList.remove('hidden');
}
});
</script>
</body>
</html>