Shuffle / Filter

30 views
Skip to first unread message

Adam

unread,
May 18, 2017, 5:55:09 PM5/18/17
to Ractive.js

I'm looking to implement something like the plugins above using ractive... but can't figure out have to animate the items when they're re-order or filtered out.

Any suggestions?

Chris Reeves

unread,
May 18, 2017, 6:04:47 PM5/18/17
to Ractive.js
It's not too hard as long as your items are a fixed size along each axis of movement. You can position absolute, assign each an index (or two for grids) that is multiplied by the fixed size to position, and let a css transition handle the easing when the assigned index changes. You can even do it with ractive.animate if you can't depend on css transitions.

I'll see if I can put together an example later.


Thanks, Chris

--
You received this message because you are subscribed to the Google Groups "Ractive.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ractive-js+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Reeves

unread,
May 18, 2017, 7:39:28 PM5/18/17
to Ractive.js
Here you go: https://ractive.js.org/playground/#N4IgFiBcoE5SBTAJgcwSAvgGhAF3gDxICWAbgATFIC8AOngIYxq70B8BA9CaW7QHYCCAZwDGMYgAdclGvVwIAtpIA2DBfXK4AnpIR08CAB65OMBqNxkE7AbVwEARgFdcuAPb9yngLSiVxKIA1gYAAgB0AFbOio4qCAAUAJTsAFIxcQhcLm6efIIOPOT+DMLCBqKeuAzE-AgwtgX2wMAAxAgWYJQKisIYGHashWTFamUGxD2awjrxPh6SBi3htUjG5ABU5AkAfpxgCMQoYDIA1OR7ikwotUn9kkbTswg+B0cnS8B7b8e4948gfL2YEOMAAFjYyysuHi-S44KBQ3sBEkkOA4UkMAQpGICAA7nDOKjBsjuGREc1gJwOqIwP1BlwePkuGIJNI2CAcMJ4KQmORzJZrORqOQ6njyAAlCxWUiJYCDarMBC4SDkADkrUVLDVWAVSlU6gQqo1PQNCh1gyQ6gYqvlTVwPxOqoAjAAGV1YchXZi1VUAVl19smSmEqoA2iShsBKPw1kZVR6tJN4saAMruRQIchMKz+LMMRzuVzkGbOABmZZ15Ex2NxeONADl3OKHcRhJR2wwvDnAvFsyoVNnC8WwM2tAdhFnW-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,
May 19, 2017, 7:15:55 AM5/19/17
to Ractive.js
Makes sense. How would this work if I actually need to filter the array. I'd need access to the old dom elements before they're removed and any new dom elements to animate them in/out.


Thanks, Chris



Thanks, Chris

To unsubscribe from this group and stop receiving emails from it, send an email to ractive-js+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages