0.1.0 • Published 8 years ago

sketchpad v0.1.0

Weekly downloads
40
License
MIT
Repository
github
Last release
8 years ago

Sketchpad

A simple sketchpad project. (Live Demo)

NPM

Authors

Instalation

To install Sketchpad via Bower:

$ bower install sketchpad --save

or use npm:

npm install sketchpad

Usage

Having a canvas on the DOM:

<canvas id="sketchpad"></canvas>

You should simply configure it by instantiating the Sketchpad:

var sketchpad = new Sketchpad({
  element: '#sketchpad',
  width: 400,
  height: 400,
});

After that, the API provides a variety of functionalities:

// undo
sketchpad.undo();

// redo
sketchpad.redo();

// Change color
sketchpad.color = '#FF0000';

// Change stroke size
sketchpad.penSize = 10;

// Playback each sketchpad stroke (10 ms is the time between each line piece)
sketchpad.animate(10);

For more documentation about the project, visit: TBA

Contribute

Just send PR :-)