Новый правки в компоненты

This commit is contained in:
Web-serfer 2026-05-05 20:52:45 +05:00
parent ae08bcdcb7
commit c3ff6bc17b

View file

@ -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;
}