Socket
Socket
Sign inDemoInstall

simple-loading-bar

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    simple-loading-bar

A simple loading bar inside of a webcomponent.


Version published
Maintainers
1
Install size
6.87 kB
Created

Readme

Source

A simple loading bar as a webcomponent without externel dependencies (~3KB).

JSFiddle | Preview

Installation

npm install simple-loading-bar

Usage

import the module depending on envirement. Exmpl.:

require('simple-loading-bar')

It can be used by creating a new element and setting appropriate starting values (end is the most important one, describing 100%):

let loadingbar = document.createElement('simple-loading-bar')

loadingbar.end = 2000;
loadingbar.width = 400;
loadingbar.height = 20;
loadingbar.color = 'lightgreen';
loadingbar.backgroundColor = 'lightgray';

document.body.append(loadingbar)

Start values should be set before adding it to the DOM.

Finally you can add progress by calling:

loadingbar.addProgress(100)

It automatically stops at 100%.

License

Copyright 2019, Protronic GmbH

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Keywords

FAQs

Last updated on 29 Aug 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc