RaphCon is a simple wrapper around Raphael.js and jQuery to simplify drawing and animation of vector icons on the web.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
lib
spec
src
.gitignore
README.md
RaphCon.min.js
grunt.js

README.md

About

RaphCon is a simple wrapper around Raphael.js and jQuery to simplify drawing and animation of vector icons on the web.

See it in action

Have a look action have a look at example/index.html.

Dependencies

http://jquery.com/ http://raphaeljs.com/

Setup

Include dependencies and RaphCon...

Create Icon

var icon = RaphCon("#some-id", {width:512, height: 512});

Draw a path

icon.draw("..."); // Provide an svg path or an object with multiple paths

Define callbacks for events

icon.on("show", function() { this.layers.yourLayerName.attr({opacity: 0}).animate({ opacity: 1}, 500); });

Call show & hide to trigger callback

icon.show();

Iterate and style multiple layers

icon.each(function (name, path) { if (name==="layer1") { path.attr({fill: 'blue'}); } else { path.attr({fill: 'blue'}); } });

License

It's licensed under MIT, so feel free to remix...