You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
3.3 KiB

7 months ago
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Drone System - Login</title>
<link rel="stylesheet" href="style.css">
</head>
<body class="login-page">
<h1 class="page-title">AI Mission Camera Console for Drones</h1>
7 months ago
<div class="login-container">
<h1>Login</h1>
<p class="login-subtext">Sign In to your account</p>
<form id="login-form">
<div class="input-group">
<span class="icon">👤</span>
<input type="text" id="id" name="id" placeholder="Username" required>
7 months ago
</div>
<div class="input-group">
<span class="icon">🔒</span>
<input type="password" id="password" name="password" placeholder="Password" required>
7 months ago
</div>
<button type="submit" class="login-button">Login</button>
</form>
</div>
<div class="footer-bar">
<img src="science_dep.png" width="134" height="30"/>
<img src="kait_logo_on.png" width="128" height="40"/>
<img src="img_tta_logo.svg" width="140" height="40"/>
<img src="nexreal_logo-dark.svg" width="100" height="25"/>
<img src="cuuva_logo.png" width="66" height="30"/>
<img src="nextchip_logo.png" width="99" height="25"/>
<img src="datamaker_logo.svg" width="100" height="30"/>
</div>
<script>
// DOM(HTML)이 모두 로드되었을 때 실행
document.addEventListener('DOMContentLoaded', () => {
// ID가 'login-form'인 폼 요소를 가져옵니다.
const loginForm = document.getElementById('login-form');
if (loginForm) {
// 폼에서 'submit' 이벤트(로그인 버튼 클릭)가 발생했을 때 실행될 함수를 정의
loginForm.addEventListener('submit', (event) => {
// 1. 폼의 기본 제출 동작(페이지 새로고침 또는 이동)을 막습니다.
event.preventDefault();
// 2. ID와 비밀번호 입력 필드에서 사용자가 입력한 값을 가져옵니다.
const idInput = document.getElementById('id');
const passwordInput = document.getElementById('password');
const id = idInput.value;
const password = passwordInput.value;
// 3. ID와 비밀번호가 'admin'인지 확인합니다.
if (id === 'admin' && password === 'admin') {
// 4. 일치하면: 'dashboard.html' 페이지로 이동합니다.
console.log('Login successful. Redirecting to dashboard.html...');
window.location.href = 'dashboard.html';
} else {
// 5. 일치하지 않으면: 사용자에게 알림 창을 표시합니다.
alert('ID 또는 비밀번호가 올바지 않습니다.');
// (선택 사항) 틀린 비밀번호 필드를 비우고 다시 포커스합니다.
passwordInput.value = '';
passwordInput.focus();
}
});
}
});
</script>
7 months ago
</body>
</html>