Open AmirRafiee opened 1 year ago
i want to animate javascript object with nested object. currently we can animate root properties but when we get deeper in to the object we cant animate the values. i think this will be pretty handy if we were able to do such.
sample code :
var Rect= { width: 100, height: 100, position: { x: 10, y: 10 } } anime({ targets: Rect, width: 200, height: 200, "position.x": 100, "position.y": 100, round: 1, easing: 'linear' });
This is not possible out of the box in JS, but maybe you can create a proxy object with getter and setter props that will update the original object?
i want to animate javascript object with nested object. currently we can animate root properties but when we get deeper in to the object we cant animate the values. i think this will be pretty handy if we were able to do such.
sample code :
var Rect= { width: 100, height: 100, position: { x: 10, y: 10 } } anime({ targets: Rect, width: 200, height: 200, "position.x": 100, "position.y": 100, round: 1, easing: 'linear' });