Skip to content

An interactive ATM card that takes in the that take in the details inputted and update it live on the card.

Notifications You must be signed in to change notification settings

mallow12/interactive-card-details-form-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - Interactive card details form solution

This is a solution to the Interactive card details form challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

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
  • SASS - SCSS
  • Mobile-first workflow
  • Vanilla Js

What I learned

I learned a lot about styling images and form validation. I encountered a lot of challenges in the completion of this project but i am happy with the progress i have made so far.

<div class="thank-you hidden">
  <div class="content">
    <img src="images/icon-complete.svg" alt="" />
    <h1>THANK YOU!</h1>
    <p>We've added your card details</p>
    <button class="continue">Continue</button>
  </div>
</div>

This is the thankyou page html

function confirm(inputs) {
  let allFilled = true;
  inputs.forEach((input) => {
    const formControl = input.parentElement;
    if (input.value === '') {
      formControl.classList.add('error');
      allFilled = false;
    } else if (formControl.className.includes('error')) {
      allFilled = false;
    } else {
      formControl.classList.remove('error');
    }
  });

  if (allFilled) {
    form.classList.add('hidden');
    thankYou.classList.remove('hidden');
  }
}

Continued development

I want to continue improving my skills on using local storage.

Author

About

An interactive ATM card that takes in the that take in the details inputted and update it live on the card.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published