modified: backend/app.py

modified:   frontend/index.html
	modified:   frontend/js/app.js
This commit is contained in:
2026-05-15 19:02:24 +03:00
parent 2df4f52adb
commit 641f9e1d8c
3 changed files with 31 additions and 1 deletions

View File

@@ -31,7 +31,7 @@
<form id="auth-form">
<input type="text" id="auth-username" placeholder="Логин" required />
<input type="password" id="auth-password" placeholder="Пароль" required />
<button type="submit" class="btn-primary" style="width: 100%; margin-top: 1rem;">Войти</button>
<button type="submit" id="auth-submit-btn" class="btn-primary" style="width: 100%; margin-top: 1rem;">Войти</button>
</form>
<p style="margin-top: 1rem; text-align: center;">
<a href="#" id="auth-toggle">Нет аккаунта? Зарегистрироваться</a>

View File

@@ -87,6 +87,7 @@ function initAuth() {
const authForm = document.getElementById('auth-form');
const toggleBtn = document.getElementById('auth-toggle');
const title = document.getElementById('auth-title');
const submitBtn = document.getElementById('auth-submit-btn');
const logoutBtn = document.getElementById('logout-btn');
toggleBtn.addEventListener('click', (e) => {
@@ -94,6 +95,7 @@ function initAuth() {
isLoginMode = !isLoginMode;
title.textContent = isLoginMode ? 'Вход в систему' : 'Регистрация';
toggleBtn.textContent = isLoginMode ? 'Нет аккаунта? Зарегистрироваться' : 'Уже есть аккаунт? Войти';
submitBtn.textContent = isLoginMode ? 'Войти' : 'Зарегистрироваться';
});
authForm.addEventListener('submit', async (e) => {
@@ -110,6 +112,7 @@ function initAuth() {
isLoginMode = true;
title.textContent = 'Вход в систему';
toggleBtn.textContent = 'Нет аккаунта? Зарегистрироваться';
submitBtn.textContent = 'Войти';
return;
}
window.location.reload();