Here is a minimal but functional CC form that you can test it with dummy credit card numbers to see how it automatically detects the card type. As you fill in the card number it detects the type of card and adds the necessary colour to the greyscale card. When you try and enter the CVV the card flips over, very cool.
If you are having trouble with the pen, try the archived copy on GitHub
CC Form With Flip Animation Snippet
See the Pen Credit Card Payment Form by Adam Quinlan (@quinlo) on CodePen.default