Skip to content

Instantly share code, notes, and snippets.

@AidanDelaney
Created October 24, 2013 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AidanDelaney/7129623 to your computer and use it in GitHub Desktop.
Save AidanDelaney/7129623 to your computer and use it in GitHub Desktop.
<html>
<head>
<script src="../../dist/snap.svg-min.js"></script>
</head>
<body>
<svg id="theCanvas" width="200" height="200" />
<script type="text/javascript">
var s = Snap("#theCanvas");
// Lets create big circle in the middle:
var bigCircle = s.circle(100, 100, 50);
// By default its black, lets change its attributes
bigCircle.attr({
fill: "#bada55",
stroke: "#000",
strokeWidth: 5
});
function growCircle() {
bigCircle.animate({
r: 80
}, 500, mina.elastic);
}
function shrinkCircle() {
bigCircle.animate({
r: 50
}, 500, mina.elastic);
}
bigCircle.hover(growCircle, shrinkCircle)
var protopattern = s.circle(10, 10, 10);
protopattern.drag();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment