loading-bar

0.0.2 • Public • Published

loading-bar experimental

loading bar

A quick-and-dirty loading bar for use in your larger demos.

Usage

loading-bar

require('loading-bar')([fill, width, height, border])

Creates a new loading bar element, ready to be attached to the DOM. All arguments are optional:

  • fill: the color of the loading bar, as a CSS string. Defaults to #fff
  • width: the width of the loading bar in pixels. Defaults to 500
  • height: the height of the loading bar in pixels. Defaults to 30
  • border: the size of the inner and outer border in pixels. Defaults to 4.

bar.append([parent])

Appends the loading bar to parent, which defaults to document.body.

bar.update(t)

Pass a value between 0 and 1 to this function to update the progress of the loading bar.

bar.remove()

Removes the bar from the DOM.

bar.fadeout([duration])

Fades the loading bar out over duration milliseconds. Defaults to 1 second.

License

MIT. See LICENSE.md for details.

Readme

Keywords

none

Package Sidebar

Install

npm i loading-bar

Weekly Downloads

55

Version

0.0.2

License

MIT

Last publish

Collaborators

  • hughsk