0.2.1 • Published 7 years ago

progress-js v0.2.1

Weekly downloads
11
License
ISC
Repository
github
Last release
7 years ago

npm version

Progress

Easily show a progress indicator for anything on your web page.

Installation

To use this library, you can install as an npm package if you are using Browserify.

npm install progress-js --save-dev

Usage

To use this package, given this html:

<div id="progress-container"></div>

And this css:

#progress-container {
  background: lightblue;
  width: 0;
  height: 4px;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  visibility: hidden;
  transition: width 300ms ease, opacity 100ms;
}

#progress-container.active {
    opacity: 1;
    visibility: visible;
}

You can do:

let el = document.getElementById('progress-container');
let progress = new Progress(el);

Then, your progress instance has access to all methods available.