0.1.0 • Published 9 years ago

colorful-it v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

ColorfulIt

Add colorful chars to element.

sample

Inspired by the banner at http://substack.net/.

install

With NPM:

npm install colorful-it

usage

Require it:

var ColorfulIt = require('colorful-it');
ColorfulIt(document.getElementById('colorfulCharsContainer'), 'Hello, world!');

Or use the global var:

ColorfulIt(document.getElementById('colorfulCharsContainer'), 'Hello, world!');

Or use as jQuery plugin (if you import jQuery before):

$('#colorfulCharsContainer').ColorfulIt('Hello, world!');

api

  • ColorfulIt(ele, str, options)

    options:

    • seed: seed colors used to colorful chars, like [255,255,0,0,255,255,...]
    • stepNum: insert colors between every two colors in seed to get the Colors to be used
    • interval: speed of the change of colors, in millisecond
  • ColorfulIt.prototype

    • run() - after stoped, use it to restart changing color
    • stop() - stop changing color

test

npm install
npm test