meteor-blaze-animations
meteor-blaze-animations copied to clipboard
Integration with Iron-Router
Very cool package!
I've been struggling to get animations in general to work with Iron Router. Is there an easy way to use this with IronRouter so that you can fade one page into the next (instead of instantly rendering) or slide iOS style?
Thanks! Adam
Would be cool indeed, I'll think about how to best implement it. PR are welcome if you want to have a shot at it btw. :)
The best way would be to:
- wrap your
{{> yield}}
within an element (say a div with a class.container
) - wrap each of your page templates within an element of the same class (say divs with a
.page
class) - set them all to
position: fixed
so that they can overlap on animations / transitions.
Then do something like that (assuming your {{> yield}}
is included in a layout
template):
Template.layout.animations({
".page": {
container: ".container",
in: "fadeIn",
out: "fadeOut"
}
});
Easy for fadeIn or any transition that does not imply directions. Slide iOS style is a bit more tricky since you have to be able to define in which direction the transition should happen (left->right or right->left).
Cool i'll check this out! I have a site that uses fading so that should be easy. For iOS perhaps a variable for the direction tied along with a helper like Router.goBack
and Router.goForward
or something. I'll try it out and let you know how it works :beers:
Yep, I dunno if you are still working on the project, but it's seems that changing route from iron router break the effect.