diff options
author | Saivan <savian@me.com> | 2018-05-29 18:28:15 +1000 |
---|---|---|
committer | Saivan <savian@me.com> | 2018-05-29 18:28:15 +1000 |
commit | 7c65a664bb4f3ab6bdbb9604414d01debcca6847 (patch) | |
tree | 6795c1de9d802a18c036df6d05a880bca5acae5f /dirty.html | |
parent | 8c4e55ee559fdc1597319f18aa1ccb9ac15474cc (diff) | |
download | svg.js-7c65a664bb4f3ab6bdbb9604414d01debcca6847.tar.gz svg.js-7c65a664bb4f3ab6bdbb9604414d01debcca6847.zip |
Diagnosing the declarative animations and suggesting changes
Diffstat (limited to 'dirty.html')
-rw-r--r-- | dirty.html | 19 |
1 files changed, 9 insertions, 10 deletions
@@ -74,8 +74,8 @@ function getColor(t) { // } // } -var bla = SVG('<rect>').size(0, 0).move(200, 200).addTo('svg') -bla.animate().size(220, 200).queue(null, console.log) +// var bla = SVG('<rect>').size(0, 0).move(200, 200).addTo('svg') +// bla.animate().size(220, 200).queue(null, console.log) // var randPoint = (x = 50, y = 50) => [ // Math.random() * 100 - 50 + x, @@ -101,14 +101,13 @@ bla.animate().size(220, 200).queue(null, console.log) // ]) // }) -// 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) { -// //mover.animate(SVG.PID()).move(e.pageX, e.pageY) -// 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) |