Frontend Mentor - Interactive card details form solution

This is a solution to the Interactive card details form challenge on Frontend Mentor.

Table of contents

Overview

The challenge

Users should be able to:

  • Fill in the form and see the card details update in real-time
  • Receive error messages when the form is submitted if:
    • Any input field is empty
    • The card number, expiry date, or CVC fields are in the wrong format
  • View the optimal layout depending on their device's screen size
  • See hover, active, and focus states for interactive elements on the page

Screenshot

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • CSS Grid
  • Javascript
  • Building forms

What I learned

With this challenge, I have improved my form-building skills. I have also learned how to add live messages to a form.

my biggest struggle is the formatting. I have been unable to add the credit card numbers output in groups of 4. I have looked at some formulas or functions but none of them have worked well for me or I lack the knowledge to implement them. Any tips or suggestions would be much appreciated. Another pain point has been keeping absolute elements in position with responsive styles but I was able to overcome these challenges.

I have also added a box shadow to both cards but there seems to be an extra layer at the bottom of the card, which I can't remove unless I remove the shadow.

I have added some extra codes for fun, like correct or different error messages.

Continued development

Use this section to outline areas that you want to continue focusing on in future projects. These could be concepts you're still not completely comfortable with or techniques you found useful that you want to refine and perfect.

Useful resources

  • Keving powells - This helped me for XYZ reason. I really liked this pattern and will use it going forward.
  • superhi - This is an amazing article which helped me finally understand XYZ. I'd recommend it to anyone still learning this concept.

Note: Delete this note and replace the list above with resources that helped you during the challenge. These could come in handy for anyone viewing your solution or for yourself when you look back on this project in the future.

Author

Acknowledgments

This is where you can give a hat tip to anyone who helped you out on this project. Perhaps you worked in a team or got some inspiration from someone else's solution. This is the perfect place to give them some credit.