I'm working on a progress bar that already animates but I'm unsure how to animate it with a progressive color gradient.
I searched all over but I couldn't find exactly what I'm looking for, but it seems like css animation would require webkits?
Example,
Default color is blue bar
if value is > 50%, yellow
if value is > 75%, orange
if value is > 90%, red
Animate:
componentDidMount() {
$(".progress div").each(function () {
var display = $(this),
nextValue = $(this).attr("data-values")
$(display).css("color", "black").animate({
"width": nextValue + "%"
}, 2000);
}
);
},
Render:
<div className="progress" role="progressbar" id="progressBarStyle">
<div className="progress-meter" data-values={this.calculatePercent(160000)}></div>
</div>