Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
runas24 authored Apr 15, 2024
1 parent bf4c5a5 commit 7676f6d
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,25 @@ document.getElementById("loanForm").addEventListener("submit", function(event) {
var submitButton = document.getElementById('calculateButton');
submitButton.disabled = true;

var progressCircle = document.querySelector('.progress-ring__circle');
progressCircle.classList.add('in-progress');

setTimeout(function() {
progressCircle.classList.remove('in-progress');
progressCircle.classList.add('complete');

setTimeout(function() {
submitButton.disabled = false;
progressCircle.classList.remove('complete');
}, 1000); // Длительность анимации зависит от CSS
}, 3000); // Продолжительность времени загрузки
var progressBar = document.getElementById('progressBar');
var progressBarInner = document.createElement('div');
progressBarInner.classList.add('progress-bar-inner');
progressBar.appendChild(progressBarInner);

progressBar.classList.add('active');

// Имитация задержки выполнения
var progress = 0;
var interval = setInterval(function() {
progress += 10;
progressBarInner.style.width = progress + '%';
if (progress >= 100) {
clearInterval(interval);
setTimeout(function() {
submitButton.disabled = false;
progressBar.classList.remove('active');
progressBar.removeChild(progressBarInner);
}, 500); // Добавлено для завершения анимации
}
}, 300); // Промежуток времени для обновления прогресса
});

0 comments on commit 7676f6d

Please sign in to comment.