From ae08bcdcb7b154b5e2141d7c95f78cdf1dda8547 Mon Sep 17 00:00:00 2001 From: Web-serfer Date: Tue, 5 May 2026 20:42:34 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D1=8B=D0=B9=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/auth/forgot-password.astro | 32 +++++++++++++++++-- frontend/src/pages/auth/reset-password.astro | 30 +++++++++++------ 2 files changed, 51 insertions(+), 11 deletions(-) diff --git a/frontend/src/pages/auth/forgot-password.astro b/frontend/src/pages/auth/forgot-password.astro index ac5b4c0..f334862 100644 --- a/frontend/src/pages/auth/forgot-password.astro +++ b/frontend/src/pages/auth/forgot-password.astro @@ -70,7 +70,7 @@ import { SITE_URL } from '@constants'; if (!email) return; submitBtn.disabled = true; - submitBtn.textContent = 'Отправка...'; + submitBtn.classList.add('loading'); try { const response = await fetch('/api/auth/request-password-reset', { @@ -87,15 +87,18 @@ import { SITE_URL } from '@constants'; } else { const errorEl = document.getElementById('email-error'); if (errorEl) errorEl.textContent = data.error || 'Ошибка'; + submitBtn.disabled = false; + submitBtn.classList.remove('loading'); } } catch (err) { if (formError) { formError.textContent = 'Ошибка соединения'; formError.classList.remove('hidden'); } + submitBtn.disabled = false; + submitBtn.classList.remove('loading'); } finally { submitBtn.disabled = false; - submitBtn.textContent = 'Отправить ссылку'; } }); @@ -197,6 +200,31 @@ import { SITE_URL } from '@constants'; cursor: not-allowed; } + .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); } + } + .auth-messages { margin-top: 1.5rem; text-align: center; diff --git a/frontend/src/pages/auth/reset-password.astro b/frontend/src/pages/auth/reset-password.astro index 1b90c90..a96b6f5 100644 --- a/frontend/src/pages/auth/reset-password.astro +++ b/frontend/src/pages/auth/reset-password.astro @@ -57,15 +57,27 @@ const error = Astro.url.searchParams.get('error');
- +
+ + +