diff --git a/frontend/src/pages/auth/reset-password.astro b/frontend/src/pages/auth/reset-password.astro index a96b6f5..1aa87b6 100644 --- a/frontend/src/pages/auth/reset-password.astro +++ b/frontend/src/pages/auth/reset-password.astro @@ -166,13 +166,13 @@ const error = Astro.url.searchParams.get('error'); } submitBtn.disabled = true; - submitBtn.textContent = 'Сохранение...'; + submitBtn.classList.add('loading'); try { const response = await fetch('/api/auth/confirm-password-reset', { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ token, password, passwordConfirm }), + body: JSON.stringify({ token, password, passwordConfirm: confirmPassword }), }); const data = await response.json(); @@ -188,7 +188,7 @@ const error = Astro.url.searchParams.get('error'); if (errorEl) errorEl.textContent = 'Ошибка соединения'; } finally { submitBtn.disabled = false; - submitBtn.textContent = 'Сохранить пароль'; + submitBtn.classList.remove('loading'); } }); @@ -367,6 +367,31 @@ const error = Astro.url.searchParams.get('error'); box-shadow: 0 8px 20px rgba(206, 159, 64, 0.4); } + .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); } + } + .hidden { display: none !important; }