0.1.2 • Published 3 years ago

@buuug7/simplify-progress v0.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

simplify progress

Install

install @buuug7/simplify-progress package via npm, and then import from @buuug7/simplify-progress/index.css file.

npm install @buuug7/simplify-progress

Demo examples

Usage

<div class="progress">
  <div class="bar" style="width: 50%"></div>
</div>

the progress bar width style specified the progress current percentage, you can change it dynamic by using javascript like below.

function progress(selector) {
  let el = document.querySelector(selector);
  let percentage = 50;
  let id = setInterval(frame, 100);

  function frame() {
    if (percentage >= 100) {
      clearInterval(id);
    } else {
      percentage++;
      el.style.width = percentage + '%';
    }
  }
}
0.1.2

3 years ago

0.1.0

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.5

4 years ago