function updateValue(){
const progress = document.querySelector('progress');
progress.value = Math.round(Math.random()*100) + 1;
console.log(progress.value);
}
const interval = setInterval(updateValue, 500);
setTimeout(function () {
clearInterval(interval);
}, 4000);
.wrapper-progressbar {
flex: 1;
}
progress {
width: 100%;
background-image:
linear-gradient(
90deg,
rgba(255,0,0,0.1),
rgba(255,0,0,0.1) 30%,
rgba(0,255,0,0.1) 30%,
rgba(0,255,0,0.1) 70%,
rgba(255,0,0,0.1) 70%);
border: 0;
height: 2em;
border-radius: 9px;
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25) inset;
}
progress[value]::-webkit-progress-bar {
width: 100%;
background: transparent;
background-image:
-webkit-linear-gradient(
left,
rgba(255,0,0,0.1),
rgba(255,0,0,0.1) 30%,
rgba(0,255,0,0.1) 30%,
rgba(0,255,0,0.1) 70%,
rgba(255,0,0,0.1) 70%);
border: 0;
height: 2em;
border-radius: 9px;
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25) inset;
}
progress[value] {
background-color: transparent;
border-radius: 5px;
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25) inset;
position: relative;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
progress[value]::-moz-progress-bar {
border-radius: 2px;
background-size: 65px, 100%, 100%;
background-color: transparent;
background-image:
-moz-linear-gradient(
135deg,
transparent 33%,
rgba(0, 0, 0, 0.1) 33%,
rgba(0, 0, 0, 0.1) 66%,
transparent 66%
),
-moz-linear-gradient(
top,
rgba(255, 255, 255, 0.25),
rgba(0, 0, 0, 0.25)
),
-moz-linear-gradient(
left,
rgba(255,0,0,0.8),
rgba(255,0,0,0.8) 100%,
rgba(0,255,0,0.8) 100%,
rgba(0,255,0,0.8) 100%,
rgba(255,0,0,0.8) 100%
);
}
progress[value]::-webkit-progress-value {
border-radius: 2px;
background-size: 65px, 100%, 100%;
background-color: transparent;
background-image:
-webkit-linear-gradient(
135deg,
transparent 33%,
rgba(0, 0, 0, 0.1) 33%,
rgba(0, 0, 0, 0.1) 66%,
transparent 66%
),
-webkit-linear-gradient(
top,
rgba(255, 255, 255, 0.25),
rgba(0, 0, 0, 0.25)
),
-webkit-linear-gradient(
left,
rgba(255,0,0,0.8),
rgba(255,0,0,0.8) 100%,
rgba(0,255,0,0.8) 100%,
rgba(0,255,0,0.8) 100%,
rgba(255,0,0,0.8) 100%
);
}
<div className="wrapper-progressbar">
<progress style={styleProgress} max="100" value="90"></progress>
</div>