If you want to enhance your popout effect, here's a suggestion for you.
Start by creating both close and open animations.
Next, apply the animation to .white-popup-block
when the popout is opening and then add it to .mfp-removing
when the popup is closing.
.white-popup-block {
background: #ccc;
padding: 20px;
max-width: 300px;
margin: 0 auto;
animation: open 1s;
}
.mfp-removing{
animation: close 1s;
}
@keyframes open {
0% {opacity: 0;}
100% {opacity: 1;}
}
@keyframes close {
0% {opacity: 1;}
100% {opacity: 0;}
}
Then, introduce a delay using removalDelay
set to 900ms. Since the keyframe animation duration is 1 second, the delay should be less than this time.
$('.popup-with-content').magnificPopup({
type: 'inline',
preloader: false,
gallery:{enabled:true},
removalDelay: 900,
callbacks: {
beforeOpen: function() {
this.st.mainClass = this.st.el.attr('data-effect');
}
},
});
You can view a working example on this fiddle https://jsfiddle.net/gbp31r8n/26/
Try implementing these steps and see how they elevate your design!