1.3.0 • Published 5 months ago

responsive-sketchpad v1.3.0

Weekly downloads
22
License
MIT
Repository
github
Last release
5 months ago

Responsive-Sketchpad

npm version Build

A completely responsive, HTML5 canvas sketchpad for use on desktop and mobile browsers with no dependencies.

Demo

Installation

npm install responsive-sketchpad

Follow node-canvas setup instructions

Example Usage

<!-- index.html -->
<html>
  <head>
    <script src="script.js" async></script>
  </head>
  <body>
    <div id="sketchpad"></div>
  </body>
  <!-- Can also include global bindings if not using JS modules -->
  <!-- <script src="sketchpad.js"></script> -->
</html>
// script.js
var Sketchpad = require('responsive-sketchpad');

// Initialize Sketchpad
var el = document.getElementById('sketchpad');
var pad = new Sketchpad(el, {
    line: {
        color: '#f44335',
        size: 5
    }
});

// Set line color
pad.setLineColor('#f44336');

// Set line size
pad.setLineSize(10);

// Undo
pad.undo();

// Redo
pad.redo();

// Clear canvas
pad.clear();

// Resize canvas
pad.resize(100);

// Make read only
pad.setReadOnly(true);
1.3.0

5 months ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.2.1

5 years ago

0.2.0

7 years ago

0.1.0

9 years ago