Update script.js

pull/111/head
nekefer 4 years ago committed by GitHub
parent cd228d507d
commit 51b9e1aa01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -29,15 +29,11 @@ function update() {
circles.forEach((circle, idx) => {
if(idx < currentActive) {
circle.classList.add('active')
progress.style.width = idx * (100/3)+ '%'
} else {
circle.classList.remove('active')
}
})
const actives = document.querySelectorAll('.active')
progress.style.width = (actives.length - 1) / (circles.length - 1) * 100 + '%'
if(currentActive === 1) {
prev.disabled = true
} else if(currentActive === circles.length) {
@ -46,4 +42,4 @@ function update() {
prev.disabled = false
next.disabled = false
}
}
}

Loading…
Cancel
Save