This is a simple canvas doodling app I built, originaly to entertain a toddler. Like most vacation hacking, this app exploded over my two week break into a full fledged app with undo/redo, history-jumping, etc.
In Progress: Beware, some buttons just do: throw new Error('implement me!');
:)
Basically, this is super simple, history-recording canvas JavaScript. The intention is to have a useable, basic sketchboad, hopefully make other features easier to implement. Currently implemented:
I'm making heavy use of Github issues for this repo. The highlights:
On first clone, quick npm install
:
git clone git@github.com:jzacsh/doodle.git &&
cd doodle &&
npm install
This is basically a tiny angularjs app, but could be built with anything. The real meat of this repo is in the vanilla JavaScript classes prefixed Doodle...
and similarly vanilla JavaScript in lib/ directory to manage history and CanvasRenderingContext2D
.
Run unit tests and watch for file updates, as you modify tests:
# one one terminal
$EDITOR test/*.js
# in another terminal
npm run testing # or `npm run test` to just run once
Of course, now that you have dilligently added failing tests, implement your features
Compile & serve locally, via npm watch
automatic calls to npm run restart
(or restartdev
):
npm run watch # or `npm run watchdev` for uncompiled
This is a static web app, meaning its plain text files that only a browser
interprets. Just serve them from anywhere. The target files are produced in
./tmp/
by executing:
npm run build