Skip to content

iamso/u.circularrr.js

Repository files navigation

u.circularrr.js

Creates an SVG circular progress indicator inside the element matching the selector.

While loading it adds the loading class to the element, when it's done it add the class loaded.

Usage

Setup (with default options):

u('selector').circularrr({
  size: 40,
  border: 3,
  bg: 'ghostwhite',
  progress: 'lightgreen',
  duration: 1500,
});

Set:

u('selector').circularrr(10); // from 0 to 100

Reset:

u('selector').circularrr('reset');

To center the SVG inside the element, use the following css:

selector {
  position: relative;
}
selector .circularrr {
  margin: -20px 0 0 -20px;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
}

License

MIT License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published