The general idea is to allow something like this:
$elements = $('#foo') # assume <div> element with width and height equal to 100px
animation = new Bounce()
animation.translate(
from: { x: 0, y: 0 },
to: { x: 0, y: '100%' }, # Translate up 100% (at time of evaluation, 100px)
easing: 'bounce',
duration: 1500,
delay: 0,
bounces: 2,
stiffness: 5
).translate(
from: { x: 0, y: 0 },
to: { x: '100%', y: 0 }, # Translate right 100% (at time of evaluation, 100px)
easing: 'bounce',
duration: 1500,
delay: 0,
bounces: 2,
stiffness: 5
)
animation.applyTo($elements)
The reason is that it makes bounce animations much more dynamic with respect to either the current DOM properties of the applied elements (and could be even more flexible if we could interpolate with the current values established by previous components in the chain).
EDIT: After further thought and inspection, I'm wondering - is this even possible with the usage of matrices?
Let me know. Thanks, cheers.
The general idea is to allow something like this:
The reason is that it makes bounce animations much more dynamic with respect to either the current DOM properties of the applied elements (and could be even more flexible if we could interpolate with the current values established by previous components in the chain).
EDIT: After further thought and inspection, I'm wondering - is this even possible with the usage of matrices?
Let me know. Thanks, cheers.