Skip to content

Latest commit

 

History

History
92 lines (66 loc) · 3.48 KB

README.md

File metadata and controls

92 lines (66 loc) · 3.48 KB

Sketchpad

Backers on Open Collective Sponsors on Open Collective

A simple sketchpad project. (Live Demo)

NPM

Authors

Installation

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

Contributing

  • Fork this repository.
  • Install with npm install
  • Send a PR

Contributors

This project exists thanks to all the people who contribute.

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]