sketchpad

0.1.0 • Public • Published

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 :-)

Readme

Keywords

Package Sidebar

Install

npm i sketchpad

Weekly Downloads

68

Version

0.1.0

License

MIT

Last publish

Collaborators

  • jean