JavaScripting

The definitive source of the best
JavaScript libraries, frameworks, and plugins.


  • ×

    A simple sketchpad library
    Filed under 

    • 🔾17%Overall
    • 317
    • 40.9 days
    • 🕩41
    • 👥4

    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]

    Show All