you should be using keyframes and webkit-keyframes incase the browser doesn't support it. I like to create 20 steps on mine because I think it looks a lot cleaner and not so jumpy on the fade in.
.fade-in {
-webkit-animation: fade-in .8s steps(20, end) both;
animation: fade-in .8s steps(20, end) both;
}
@-webkit-keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
you can read about it here:
https://css-tricks.com/snippets/css/keyframe-animation-syntax/
in your function you can use renderer2 - in response to your comment this is how we did it and it works. I could have combined the classes but we were testing each on individually to make sure they injected into the Dom timely and in order.
const loading= document.getElementById('loading');
const signinElement = document.getElementById('signinelement');
this.renderer.removeClass(signinElement, 'show');
this.renderer.removeClass(signinElement, 'fade-in');
this.renderer.removeClass(loading, 'hidden');
this.renderer.addClass(signinElement, 'hidden');
this.renderer.addClass(signinElement, 'fade-out');
this.renderer.addClass(loading, 'show');
this.renderer.addClass(loading, 'fade-in');
setTimeout(()=>{
// this.renderer.addClass(signinElement, 'show');
// this.renderer.addClass(signinElement, 'fade-in');
setTimeout(()=>{
this.signin.googleSignin();
}, 500)
}, 500)