All Projects → LoeiFy → colorBar

LoeiFy / colorBar

Licence: MIT License
colorfully loading bar

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

colorBar

colorfully loading bar http://loeify.github.io/colorBar

Installation

npm i -S colourbar

Usage

html markup

<div id="bar"></div>

use as module

import colorBar from 'colourbar'
//var colorBar = require('colourbar')

or use the script

<script src="colorBar.min.js"></script>

Options

// default
new colorBar({
	selector: 'colorBar',  // html id only
	height: '3px',
	duration: '2s',
	colors: [
        // ['color', 'position']
        ['#37cca2', '0%'], 
        ['#46deb6', '17%'], 
        ['#feed00', '38%'], 
        ['#fbf27a', '59%'], 
        ['#f24141', '79%'], 
        ['#37cca2', '100%']
    ]
})

API

const bar = new colorBar({
    selector: 'bar'
})

// loading
bar.loading()

// loaded
bar.loaded()

// hide
bar.hide()

Development

# build 
$ npm run build

# local server http://127.0.0.1:1234
$ npm start

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].