I am using aurelia-animator-css to animate router views. Upon navigation to a new router view, I want the current view to slide off screen to the left while the new view slides onto the screen from the right.
Here is my router-view element:
<router-view swap-order="with"></router-view>
Here is the top element in each of the views:
<div class="pages au-animate">
And here is the css:
@keyframes slideLeftIn {
0% {
transform: translate(100%, 0);
}
100% {
transform: translate(0, 0);
}
}
@keyframes slideLeftOut {
0% {
transform: translate(0, 0);
}
100% {
transform: translate(-100%, 0);
}
}
.pages.au-enter {
transform: translate(100%, 0);
}
.pages.au-enter-active {
animation: slideLeftIn 0.6s;
}
.pages.au-leave-active {
animation: slideLeftOut 0.6s;
}
I am using autoprefixer, so there is no need for prefixes such as "webkit-".
With swap-order="with", the current view slides off screen to the left, and then the new view appears without sliding.
The same thing happens with swap-order="before".
Here's a youtube screen video with swap-order="with".
With swap-order="after", the current view slides off screen to the left, and then the new view slides in from the right.
Here's a youtube screen video with swap-order="after".
I would think that swap-order="with" would be the one that is needed in this situation. But swap-order="after" is closest to what I need, since both views actually perform slides, just not together.