diff --git a/frontend/src/pages/auth/sign-up.astro b/frontend/src/pages/auth/sign-up.astro index 26f5bc1..63d4d5d 100644 --- a/frontend/src/pages/auth/sign-up.astro +++ b/frontend/src/pages/auth/sign-up.astro @@ -625,6 +625,31 @@ import { SITE_URL } from '@constants'; transform: none; } + .btn-submit.loading { + position: relative; + color: transparent !important; + pointer-events: none; + } + + .btn-submit.loading::after { + content: ''; + position: absolute; + width: 20px; + height: 20px; + top: 50%; + left: 50%; + margin-left: -10px; + margin-top: -10px; + border: 2px solid #ffffff; + border-radius: 50%; + border-top-color: transparent; + animation: spin 0.8s linear infinite; + } + + @keyframes spin { + to { transform: rotate(360deg); } + } + .btn-submit:active { transform: translateY(0); } @@ -877,7 +902,7 @@ import { SITE_URL } from '@constants'; // Отправка данных на сервер const submitBtn = form.querySelector('.btn-submit') as HTMLButtonElement; submitBtn.disabled = true; - submitBtn.textContent = 'Регистрация...'; + submitBtn.classList.add('loading'); try { const response = await fetch('/api/auth/sign-up', { @@ -914,12 +939,12 @@ if (result.success) { } else { showError(emailInput, result.error || 'Ошибка регистрации'); submitBtn.disabled = false; - submitBtn.textContent = 'Зарегистрироваться'; + submitBtn.classList.remove('loading'); } } catch (err) { showError(emailInput, 'Ошибка соединения'); submitBtn.disabled = false; - submitBtn.textContent = 'Зарегистрироваться'; + submitBtn.classList.remove('loading'); } });