diff options
author | Saivan <savian@me.com> | 2018-05-29 21:45:16 +1000 |
---|---|---|
committer | Saivan <savian@me.com> | 2018-05-29 21:45:16 +1000 |
commit | fe0360187801b6a71281fe682e1f3cea49eda35b (patch) | |
tree | d67870820e85c4f2dda8d2b5431d1d8e3fea91f3 /dirty.html | |
parent | 366038d4a52a4f9b434e86b31dc31525b885855b (diff) | |
download | svg.js-fe0360187801b6a71281fe682e1f3cea49eda35b.tar.gz svg.js-fe0360187801b6a71281fe682e1f3cea49eda35b.zip |
Looping is now working and code is generally cleaner
Diffstat (limited to 'dirty.html')
-rw-r--r-- | dirty.html | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -101,13 +101,13 @@ function getColor(t) { // ]) // }) -var mover = SVG('<ellipse>').size(50, 50).center(100, 100).addTo('svg') -var anim = mover.animate(new SVG.Spring(500, 10)).move(500, 500) - -SVG.on(document, 'mousemove', function (e) { - var p = mover.point(e.pageX, e.pageY) - anim.center(p.x, p.y) -}) +// var mover = SVG('<ellipse>').size(50, 50).center(100, 100).addTo('svg') +// var anim = mover.animate(new SVG.Spring(500, 10)).move(500, 500) +// +// SVG.on(document, 'mousemove', function (e) { +// var p = mover.point(e.pageX, e.pageY) +// anim.center(p.x, p.y) +// }) // var timeline = new SVG.Timeline().pause() // var runner = new SVG.Runner(100000) @@ -122,6 +122,12 @@ SVG.on(document, 'mousemove', function (e) { //timeline.play() //timeline.finish() + +var circle = SVG('<circle>').addTo('svg').size(100, 100).center(200, 200) +circle.loop(500, 6, true, [500, 1000, 1500]) + .move(500, 500) + + </script> </body> |