Literally Canvas is an extensible, open source (BSD-licensed), HTML5 drawing widget that currently supports a minimal set of drawing operations. You can draw, erase, set the color with the eyedropper, undo, redo, pan, and zoom. It depends on jQuery and Underscore.js.
The instance at the top of this page uses the resizable feature of jQuery UI for its resize feature, to demonstrate that you can resize the container element with impunity. Resizing on the right edge of the canvas causes weirdness, but you get the idea.
If you look at Related Projects at the bottom of the page, you can see that this isn't the only HTML5 drawing tool on the block. However, it is unique in several ways:
Literally Canvas was created in part to replace the object drawing tool in Buildy. We hope you're inspired to use it to make new things of your own!
<div class="literally"><canvas></canvas></div>
$('.literally').literallycanvas();
$('.literally').literallycanvas({
backgroundColor: 'rgb(255, 0, 0)', // default rgb(230, 230, 230)
keyboardShortcuts: false, // default true
sizeToContainer: false, // default true
toolClasses: [LC.Pencil] // see coffee/tools.coffee
});
| Browser | Support |
|---|---|
| Chrome | Awesome (this is where we test) |
| Safari | Awesome |
| iOS | Awesome |
| Firefox | Requires a shim for <input type="range"> which we don't provide. Falls back to a normal input field, which works but isn't as nice. |
| Opera | ??? |
| Android | ??? |
| IE 10 | ??? |
| IE 9 | Nope |
We would be excited to see contributions of any form. New brushes, optimizations, feature requests, use cases, designs, bug reports – you name it, we want it! Just head on over to github.com/literallycanvas/literallycanvas and get started.
One particular area where we'd like some help is in styling the toolbar. If glitzy CSS-based UI is your thing, we'd love to hear your suggestions or merge your pull requests.
The web has only recently arrived at the point where this sort of project is feasible to implement without Flash, but there are several other projects with similar features. If Literally Canvas isn't quite what you're looking for, we encourage you to check them out and give them some love. All of them use Canvas unless otherwise specified.