Slide-in-right animation for ionicModal

I couldn’t find slide-in-right animation for ionicModal. So i create one on my own.

Usage:

animation: ‘slide-in-right’

css:

.slide-in-right {
  -webkit-transform: translateX(100%);
    transform: translateX(100%); }

.slide-in-right.ng-enter, .slide-in-right > .ng-enter {
  -webkit-transition: all cubic-bezier(0.1, 0.7, 0.1, 1) 400ms;
  transition: all cubic-bezier(0.1, 0.7, 0.1, 1) 400ms; }

.slide-in-right.ng-enter-active, .slide-in-right > .ng-enter-active {
  -webkit-transform: translateX(0);
    transform: translateX(0); }

.slide-in-right.ng-leave, .slide-in-right > .ng-leave {
  -webkit-transition: all ease-in-out 250ms;
  transition: all ease-in-out 250ms; }
18 Likes

pretty cool, will give this a try… i am more of a developer and not too good with animations, how would I change this to slide in from the bottom

Use ‘slide-in-up’ instead of ‘slide-in-right’. That is the default animation for ionicModals.

Nice, works perfectly!

Awesome, Thanks guy!

fantastic! thank you very much. works great

I love you… thanks!

well done! i love it and just copy paste it … works! :slight_smile: thanks

nice one!!! Absolutely perfect

it’s cool :slight_smile:
thank for a lot :cactus:

Great, thanks for sharing this. It saved a good time!

Only a small change to use translate3d(100%, 0, 0) instead of translateX(100%)

It will trigger hardware acceleration in devices with it and will deliver a better performance.

The same code with this change:

.slide-in-right {
  -webkit-transform: translate3d(100%, 0, 0);
    transform: translate3d(100%, 0, 0); }

.slide-in-right.ng-enter, .slide-in-right > .ng-enter {
  -webkit-transition: all cubic-bezier(0.1, 0.7, 0.1, 1) 400ms;
  transition: all cubic-bezier(0.1, 0.7, 0.1, 1) 400ms; }

.slide-in-right.ng-enter-active, .slide-in-right > .ng-enter-active {
  -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0); }

.slide-in-right.ng-leave, .slide-in-right > .ng-leave {
  -webkit-transition: all ease-in-out 250ms;
  transition: all ease-in-out 250ms; }
1 Like

How do you use this in the modalController create method?

@mrameezraja do you mind sharing the details of how you applied the animation to ionicModal?. I tried passing to .present({animation:… but did not work. FYI - I’m using version 3

Others … I was able to implement based informatio provided by @onderceylan here