64 comments

[ 4.2 ms ] story [ 136 ms ] thread
Looks great. Would be interesting to add to blogging software to allow a quick sketch to be added to a post.

How would you go about persisting the canvas? json encoded output?

Thanks! By default the base64 string of the canvas image is stored in session storage to make the canvas persistent.
How is it stored when using the undo/redo buttons?
Leimi, any simple way to use a base64 image as background?
you can set a `background` option when creating a drawingboard - if I did things well, setting it as the base64 string should do it!
I don't have my phone with me right now. Can anybody confirm if this works on iOS? I'm asking because I'm looking for an HTML5 drawing script which works on mobile browsers.
Yeap, works. Tested on iOS mobile safari here.
Sweet, this looks extremely promising!
Yep. Pretty snappy in iOS7 at least.
Works great on iOS 5.
It only supports one finger at a time, but it works well then.
Only the first canvas works on Android Stock Browser.
Worked nicely and snappily on an iPad 1 iOS 5.

(added snark: how can this work so nicely and bloody OnSwipe and certain websites crash my browser instantly?)

Remark: The download results in an extension-less format. Which format is it?
First thing I thought of with this was creating a mobile app that would be a cloud based instant note taking tool. Preferably used with a stylus.
I like the simplicity and configurability. Excellent job.
Seems to perform quite well, though the fill tool is a bit useless thanks to the antialiasing on the lines that can't be turned off. Considering the simple approach of this, I'd either remove the AA (or make it togglable) or get rid of the fill tool.

Also...

    h1 { font-family: Comic Sans MS; }
Seriously?
Yeah there's still a bit of work to do on the paint can.

Hey, Comic Sans fits perfectly here, don't you think? :)

If you want a "casual" font then I'd recommend something that looks more like your logo or just looks more like marker/drawing board text in general. Fontsquirrel should serve your needs well.

Also, I'd recommend you to redo the logo digitally so you can overlay it on the background seamlessly - the mismatched grids look pretty ugly right now.

This is a lovely program and yes, Comic Sans fits 100% perfectly :) haters gonna hate!
I imagine Comic Sans fits, but you may want to include a fallback to sans-serif for non-Windows users. I'm getting the default serif font, which is not a great match.
Oops, you're right!
Did you really need to inspect to tell? :P
always reminded of the piece where comic-sans defends itself. curses a lot for a font, but is pretty funny.

"People love me. Why? Because I’m fun. I’m the life of the party. I bring levity to any situation. Need to soften the blow of a harsh message about restroom etiquette? SLAM. There I am. Need to spice up the directions to your graduation party? WHAM. There again. Need to convey your fun-loving, approachable nature on your business’ website? SMACK. Like daffodils in motherfucking spring."

http://www.mcsweeneys.net/articles/im-comic-sans-asshole

If I just click with the brush tool, only a semi-circle appears on the canvas. I would expect it to place a full circle.
Really really nice, thanks for releasing. Anybody tried it with Zepto yet instead of jQuery?
Nice! Leimi - you should check out my project xBoard: https://github.com/eipark/xboard. It is somewhat similar, but focuses more on making the drawing canvas 'video'-like with a scrubber and recording functions. You should fork or pull pieces from it if you'd like that sort of functionality.
The drawing board logo is a pretty fun easter egg-type-thing.
Oh wow, that's fun, I'm going to make everything drawable from now on! (but seriously, there's a children & technology centre website I will put this on :) :) )
Had quite a laugh at enlargeYourContainer.

Any plan to release a way to export the drawing in a json object (or any other data structure) ?

Props to you anyway.

Just noticed this comment in the code:

*droppable: true or false (false by default). If true, dropping an image on the canvas will include it and allow you to draw on it

That's awesome! I was thinking that this would make a great coloring book, and being able to just drop lineart into the back of a canvas and have your kid go to town is awesome. Really nice work, Leimi!

Are we really bringing back OekakiBBS? I'm totally ok with this.
And even working smoothly on touch devices, well done!
Sweet! I am building an app that can use this to take a customer signature. The app will be using a tablet and stylus to make sales on the floor. Been debating a feature like this.
This is one of the slickest implementation of a sketching app I've seen. The API is nice and the controls are self-explanatory. I've been working on a drawing app for the past few months (journeyship.com) and I'm considering replacing the main canvas with a sketching pad like this one.

For those of you who are curious about other projects out there that offer similar functionality, take a look at these:

http://www.createjs.com/#!/EaselJS/demos/drawing

http://fabricjs.com/freedrawing/

https://github.com/SketchIO/Sketch.js

https://github.com/literallycanvas/literallycanvas

Oh, never stumbled upon literallycanvas - it's cool! Don't know if I'd have made drawingboard.js if I knew it on the first place.
Hi, I wrote half of Literally Canvas. It looks like we have a lot of overlap, but nice job on the fill and save features. We never got to those. It also looks like you're smoothing your lines, also very good.

I feel like we got "scooped" a bit with this, but at the same time we haven't worked on it in months, so congrats. :-)

I just wanted to say that I was pleasantly surprised that this works so well with Chrome on my Android phone.
Oh, nice sharing, I hope I try your JS script right know !
I did comment to say that it works well on iPad, but I would like to add that there are some interesting 'features' when using 2 fingers: they don't work at the same time,but on one board, it's almost like an etchasketch where one finger takes over from where the other left off, on another board it draws between the the fingers, and yet another board the draw point switches between where each finger is. Looks like fun to explore later...
Simple and working just as fine. Well done.
Nice Leimi! Great API. If anyone is looking for a similar but hosted solution, give vinci.io a try. You can turn off any tools you don't need and leave the drawing tools enabled.
It would be awesome a tool like this, but with collaboration enabled (multiples drawers in different machines) !!
I made something similar for a webapp of mine (demo at http://www.wysp.ws/practice/course/1057894/ -- it's meant for painting so the functionality is a bit different, you control opacity)

A difficulty I had was to make the lines smooth whereas the cursor positions are not sampled very fast by the browser. I'm curious as to what your approach was, since everything seems perfectly smooth. I'll be reading your code...