152 lines
4.2 KiB
HTML
152 lines
4.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ru">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Вход в админ-панель</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
background: #D2B48C;
|
|
min-height: 100vh;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
padding: 20px;
|
|
}
|
|
|
|
.login-container {
|
|
background: #F5E6D3;
|
|
border-radius: 15px;
|
|
padding: 40px;
|
|
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
|
|
max-width: 400px;
|
|
width: 100%;
|
|
}
|
|
|
|
h1 {
|
|
color: #5C4033;
|
|
margin-bottom: 30px;
|
|
text-align: center;
|
|
font-size: 28px;
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
label {
|
|
display: block;
|
|
color: #5C4033;
|
|
margin-bottom: 8px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
input[type="text"],
|
|
input[type="password"] {
|
|
width: 100%;
|
|
padding: 12px;
|
|
border: 2px solid #e0e0e0;
|
|
border-radius: 8px;
|
|
font-size: 16px;
|
|
transition: border-color 0.3s;
|
|
}
|
|
|
|
input[type="text"]:focus,
|
|
input[type="password"]:focus {
|
|
outline: none;
|
|
border-color: #8B6F47;
|
|
}
|
|
|
|
.error-message {
|
|
background: #f8d7da;
|
|
color: #721c24;
|
|
padding: 12px;
|
|
border-radius: 8px;
|
|
margin-bottom: 20px;
|
|
display: none;
|
|
}
|
|
|
|
.error-message.show {
|
|
display: block;
|
|
}
|
|
|
|
button {
|
|
width: 100%;
|
|
padding: 14px;
|
|
background: #8B6F47;
|
|
color: white;
|
|
border: none;
|
|
border-radius: 8px;
|
|
font-size: 16px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: background 0.3s;
|
|
}
|
|
|
|
button:hover {
|
|
background: #6B5432;
|
|
}
|
|
|
|
button:active {
|
|
transform: scale(0.98);
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="login-container">
|
|
<h1>🔐 Вход в админ-панель</h1>
|
|
|
|
<div class="error-message" id="error-message"></div>
|
|
|
|
<form method="POST" action="/login" id="login-form">
|
|
{% if error %}
|
|
<div class="error-message show">{{ error }}</div>
|
|
{% endif %}
|
|
<div class="form-group">
|
|
<label for="username">Логин:</label>
|
|
<input type="text" id="username" name="username" required autofocus>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="password">Пароль:</label>
|
|
<input type="password" id="password" name="password" required>
|
|
</div>
|
|
|
|
<button type="submit">Войти</button>
|
|
</form>
|
|
</div>
|
|
|
|
<script>
|
|
// Показываем ошибку, если она есть в URL
|
|
const urlParams = new URLSearchParams(window.location.search);
|
|
const error = urlParams.get('error');
|
|
if (error) {
|
|
const errorDiv = document.getElementById('error-message');
|
|
errorDiv.textContent = decodeURIComponent(error);
|
|
errorDiv.classList.add('show');
|
|
}
|
|
|
|
// Обработка отправки формы
|
|
document.getElementById('login-form').addEventListener('submit', function(e) {
|
|
const username = document.getElementById('username').value.trim();
|
|
const password = document.getElementById('password').value;
|
|
|
|
if (!username || !password) {
|
|
e.preventDefault();
|
|
const errorDiv = document.getElementById('error-message');
|
|
errorDiv.textContent = 'Пожалуйста, заполните все поля';
|
|
errorDiv.classList.add('show');
|
|
return false;
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|