Allow to fake dom elemenst with js objects #15

criloz opened this Issue Nov 13, 2015 · 1 comment


None yet

2 participants

criloz commented Nov 13, 2015

something like this

var fakeSvgObj = {
    d: "...",
    fill: "....",
    _objectType: "SVG"

dynamics.animate(fakeSvgObj, {
    d: "M0,0 L0,100 L100,50 L0,0 Z",
    fill: "#FF0000",
    rotateZ: 45,
    // rotateCX and rotateCY are the center of the rotation
    rotateCX: 100,
    rotateCY: 100
}, {
    friction: 800

then it will try the object like a svg. ( is this possible?)

why? it will integrate nicely with the vdom libraries out there, like reactjs and mercury, etc. and let the dom changes to these library instead of be done by dynamics.js itself.

because currently the library is supported in browsers where is possible create objects with with getter and setter functions, will be easy to communicate the changes to mercuryjs for example and fire the re-render functionality. without conflict with the library.


This was mostly working (beside the rotate properties). But I just did a fix to make that work as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment