Check out this cool collection of modal animations which are class-drive and are animating the exact same HTML elements. Designed by Jesse Couch.
If you are having trouble with the pen, try the archived copy on GitHub
See the Pen Modal Animations by Jesse Couch (@designcouch) on CodePen.0