• Stars
    star
    2,856
  • Rank 15,897 (Top 0.4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Very lightweight progress bars. No jQuery

nanobar

Very lightweight progress bars (~699 bytes gzipped).

Compatibility: iE7+ and the rest of the world

npm version Bower version

Demo

See nanobar.jacoborus.codes

Installation

Download and extract the latest release or install with package manager:

Bower:

$ bower install nanobar

npm:

$ npm install nanobar

Usage

Load

Link nanobar.js from your html file

<script src="path/to/nanobar.min.js"></script>

or require it:

var Nanobar = require('path/to/nanobar');

Generate progressbar

var nanobar = new Nanobar( options );

options

  • id <String>: (optional) id for nanobar div
  • classname <String>: (optional) class for nanobar div
  • target <DOM Element>: (optional) Where to put the progress bar, nanobar will be fixed to top of document if no target is passed

Move bar

Resize the bar with nanobar.go(percentage)

arguments

  • percentage <Number> : percentage width of nanobar

Example

Create bar

var options = {
	classname: 'my-class',
  id: 'my-id',
	target: document.getElementById('myDivId')
};

var nanobar = new Nanobar( options );

//move bar
nanobar.go( 30 ); // size bar 30%
nanobar.go( 76 ); // size bar 76%

// size bar 100% and and finish
nanobar.go(100);

Customize bars

Nanobar injects a style tag in your HTML head. Bar divs has class .bar, and its containers .nanobar, so you can overwrite its values.

Default css:

.nanobar {
  width: 100%;
  height: 4px;
  z-index: 9999;
  top:0
}
.bar {
  width: 0;
  height: 100%;
  transition: height .3s;
  background:#000;
}

You should know what to do with that ;)




© 2016 jacoborus - Released under MIT License

More Repositories

1

tender.vim

A 24bit colorscheme for Vim, Airline and Lightline
Vim Script
1,058
star
2

estilo

Create color schemes for Vim, Airline and Lightline
TypeScript
345
star
3

deep-json

Load a tree of splitted JSON files and folders
JavaScript
65
star
4

wiretree

Dependency injection framework for Node.js
JavaScript
47
star
5

directus-extension-display-link

Display URLs as links in Directus 9
TypeScript
45
star
6

weak-emitter

Contexts based event emitter on ES6 WeakMaps
TypeScript
38
star
7

deno-buckets

Bundle assets and scripts in a single executable file. Deno
TypeScript
23
star
8

curlymail

Lightweight email sending with mustache templates support for messages
JavaScript
20
star
9

directus-lite-sdk

The unofficial Directus Lite SDK in less than 1Kb
TypeScript
16
star
10

nuts

View compiler for javascript apps. Work in progress
TypeScript
10
star
11

safename

Normalize and transform diacritics, dashes, and spaces
TypeScript
10
star
12

dotfiles

Dotfiles for Neovim, zsh, tmux, ...
Lua
8
star
13

boxes

Strongly typed reactive immutable proxies as state containers
TypeScript
6
star
14

hexterm

Convert hexadecimal color codes to closest Xterm
TypeScript
6
star
15

dotmail

Send emails with templates.
JavaScript
5
star
16

submitter

Automatically submitting forms with AJAX
JavaScript
5
star
17

miniruler

Manage roles in contexts
JavaScript
5
star
18

node-filesaver

Stores files in folders easily with node.js
JavaScript
4
star
19

jetkit

Dynamic website generator 🚀. Work in progress
JavaScript
3
star
20

updox

Get markdown documentation from your javascript comments
JavaScript
3
star
21

hardwire

Structured and scalable node.js app container. Work in progress
JavaScript
3
star
22

express-nuts

Nuts template engine plugin for Expressjs 4
JavaScript
2
star
23

spa-vue

Basic Vue + Vite templates
TypeScript
1
star
24

hw-base

Admin panel base for Hardwire CMs
CSS
1
star
25

hw-blog

Blog plugin for Hardwire CMS
JavaScript
1
star
26

wikimatic

Minimalistic, markdown-based wiki for (neo)Vim
Vim Script
1
star
27

live-nuts

Live template rendering engine based on NUTS syntax (in early development)
JavaScript
1
star
28

hardwire-cli

Command line interface for Hardwire.
JavaScript
1
star
29

jacoborus.github.io

HTML
1
star
30

hardwire-boilerplates

Two boilerplates for Hardwire: basic and blog
JavaScript
1
star