A UI library needs a transition system. Ideally it would have the following features:
- transition code shouldn't be deeply intertwined with the rest of the code (as in Ractive)
- should facilitate JS or CSS transitions
- should have zero cost for people who aren't using transitions
- transition plugins should be easy to write
- control over order (e.g. Vue has
out-in, which is nice – could get even more granular for staggered transitions)
- nice-to-have – abortable/reversable transitions (e.g. if something is fading out because you toggled
visible, and you toggle it again before the fade completes, it'd be great to unfade the same element, rather than letting the fade complete and rendering a new element)
- some way to access the transitions in such a way that you can do advanced stuff like transitioning one element into another, a la Ramjet
Proposed syntax, following that used by existing directives:
{{#if visible}}
<div in:fade='{duration:200}' out:fly='{x:100,easing:'elastic'}'>hello!</div>
{{/if}}
A UI library needs a transition system. Ideally it would have the following features:
out-in, which is nice – could get even more granular for staggered transitions)visible, and you toggle it again before the fade completes, it'd be great to unfade the same element, rather than letting the fade complete and rendering a new element)Proposed syntax, following that used by existing directives:
{{#if visible}} <div in:fade='{duration:200}' out:fly='{x:100,easing:'elastic'}'>hello!</div> {{/if}}