[ create a new paste ] login | about

Link: http://codepad.org/EipkT4no    [ raw code | fork ]

C, pasted on Jul 14:
<script type="text/javascript">
// progressbar.js@1.0.0 version is used
// Docs: http://progressbarjs.readthedocs.org/en/1.0.0/

var bar = new ProgressBar.Circle(circularbar, {
  color: '#aaa',
  // This has to be the same size as the maximum width to
  // prevent clipping
  strokeWidth: 4,
  trailWidth: 10,
  easing: 'easeInOut',
  duration: 3200,
  text: {
    autoStyleContainer: false
  },
  from: { color: '#ff0000', width: 10 },
  to: { color: '#0000ff', width: 10 },
  // Set default step function for all animate calls
  step: function(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 = '"Raleway", Helvetica, sans-serif';
bar.text.style.fontSize = '2rem';

bar.animate(0.8);  // Number from 0.0 to 1.0
</script>


Create a new paste based on this one


Comments: