feat: implement initial login UI and entry logic

This commit is contained in:
2026-06-01 16:23:23 +09:00
parent 9cd5d59bf8
commit 7d3d5ef281
3 changed files with 165 additions and 2 deletions

View File

@@ -136,4 +136,36 @@ function initApp() {
window.addEventListener('refresh-view', () => refreshView());
}
document.addEventListener('DOMContentLoaded', initApp);
/**
* 로그인 처리 로직
*/
function handleLogin() {
const loginContainer = document.getElementById('login-container');
const appLayout = document.getElementById('app-layout');
const loginForm = document.getElementById('login-form') as HTMLFormElement;
if (!loginForm || !loginContainer || !appLayout) return;
loginForm.addEventListener('submit', (e) => {
e.preventDefault();
// Mock 로그인: 아이디/비밀번호 입력 여부만 확인
const username = (document.getElementById('username') as HTMLInputElement).value;
const password = (document.getElementById('password') as HTMLInputElement).value;
if (username && password) {
console.log('🔓 Login successful (Mock)');
// UI 전환
loginContainer.style.display = 'none';
appLayout.style.display = 'flex';
// 앱 초기화 시작
initApp();
} else {
alert('아이디와 비밀번호를 입력해주세요.');
}
});
}
document.addEventListener('DOMContentLoaded', handleLogin);