'use strict';
var animationTime = 1400;
var progress = 0;
var bar = new ProgressBar.Circle(radial_wrapper, {
color: '#414042',
strokeWidth: 6, // To prevent clipping, make the same as max width
trailWidth: 6,
easing: 'easeInOut',
duration: animationTime,
text: {
autoStyleContainer: false
},
// Changes loading bar color & width as it progresses
from: { color: '#d51f27', width: 1 },
to: { color: '#a11d27', width: 6 }, // To prevent clipping, make this the same as strokeWidth
step: function step(state, circle) {
circle.path.setAttribute('stroke', state.color);
circle.path.setAttribute('stroke-width', state.width);
var value = Math.round(circle.value() * 100);
if (value === 0) {
circle.setText('');
} else {
circle.setText(value);
}
}
});
bar.text.style.fontFamily = '"Roboto", Helvetica, sans-serif';
bar.text.style.fontSize = '2.8rem';
bar.animate(0.7); // Number from 0.0 to 1.0
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.