{"id":31766265,"url":"https://github.com/ayokanmi-adejola/quick-card-form","last_synced_at":"2025-10-10T00:30:40.194Z","repository":{"id":305313387,"uuid":"987299850","full_name":"Ayokanmi-Adejola/Quick-Card-Form","owner":"Ayokanmi-Adejola","description":"A responsive interactive card details form with real-time preview, form validation, and completion state. Built with HTML, CSS, and vanilla JavaScript as a solution to the Frontend Mentor challenge.","archived":false,"fork":false,"pushed_at":"2025-09-04T21:43:14.000Z","size":303,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-30T00:00:38.938Z","etag":null,"topics":["css3","flexbox","html5","mobile-first-workflow","vanilla-js"],"latest_commit_sha":null,"homepage":"https://quick-card-form.vercel.app/","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ayokanmi-Adejola.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-20T21:53:15.000Z","updated_at":"2025-09-29T20:58:34.000Z","dependencies_parsed_at":"2025-07-19T15:20:40.953Z","dependency_job_id":"eeec5867-c8b3-4f60-b29e-ae718347b1d0","html_url":"https://github.com/Ayokanmi-Adejola/Quick-Card-Form","commit_stats":null,"previous_names":["ayokanmi-adejola/quick-card-form"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ayokanmi-Adejola/Quick-Card-Form","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayokanmi-Adejola%2FQuick-Card-Form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayokanmi-Adejola%2FQuick-Card-Form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayokanmi-Adejola%2FQuick-Card-Form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayokanmi-Adejola%2FQuick-Card-Form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ayokanmi-Adejola","download_url":"https://codeload.github.com/Ayokanmi-Adejola/Quick-Card-Form/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayokanmi-Adejola%2FQuick-Card-Form/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002362,"owners_count":26083356,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css3","flexbox","html5","mobile-first-workflow","vanilla-js"],"created_at":"2025-10-10T00:30:06.975Z","updated_at":"2025-10-10T00:30:40.189Z","avatar_url":"https://github.com/Ayokanmi-Adejola.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Frontend Mentor - Interactive card details form solution\n\nThis is a solution to the [Interactive card details form challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/interactive-card-details-form-XpS8cKZDWw). Frontend Mentor challenges help you improve your coding skills by building realistic projects.\n\n| Desktop | Mobile |\n| ------- | ------ |\n| \u003cimg width=\"1440\" height=\"900\" alt=\"image\" src=\"https://github.com/user-attachments/assets/64814388-89bd-4677-a143-9ad39126c97b\" /\u003e | \u003cimg width=\"375\" height=\"704\" alt=\"image\" src=\"https://github.com/user-attachments/assets/87bde8eb-0e56-49a6-8434-a09678ce0755\" /\u003e |\n\n\n## Overview\n\n### The challenge\n\nUsers should be able to:\n\n- Fill in the form and see the card details update in real-time\n- Receive error messages when the form is submitted if:\n  - Any input field is empty\n  - The card number, expiry date, or CVC fields are in the wrong format\n- View the optimal layout depending on their device's screen size\n- See hover, active, and focus states for interactive elements on the page\n\n## Features\n\n- Real-time card details update as the user types\n- Form validation with error messages\n- Responsive design for mobile, tablet, and desktop views\n- Interactive form elements with hover and focus states\n- Completed state after successful form submission\n\n\n## Built with\n\n- Semantic HTML5 markup\n- CSS custom properties\n- Flexbox\n- Mobile-first workflow\n- Vanilla JavaScript\n\n## Implementation Details\n\n### HTML Structure\n- Responsive layout with card preview and form sections\n- Semantic form elements with proper labels and error message containers\n- Completion state that shows after successful form submission\n\n### CSS Styling\n- Implemented according to the style guide (colors, typography, etc.)\n- Responsive layouts for mobile, tablet, and desktop views\n- Custom styling for form elements, error states, and buttons\n- Used the provided background images and card designs\n\n### JavaScript Functionality\n- Real-time card preview updates as the user types\n- Form validation with appropriate error messages\n- Form submission logic to switch between form and completion states\n- Input formatting for the card number (spaces after every 4 digits)\n- Validation for expiry date and CVC\n\n## What I Learned\n\nThis project was a great opportunity to enhance my front-end development skills. Here are some key learnings:\n\n```html\n\u003c!-- Using proper semantic HTML structure for forms --\u003e\n\u003cdiv class=\"form-group\"\u003e\n  \u003clabel for=\"card-name\"\u003eCardholder Name\u003c/label\u003e\n  \u003cinput type=\"text\" id=\"card-name\" placeholder=\"e.g. Jane Appleseed\" required\u003e\n  \u003cdiv class=\"error-message\" id=\"name-error\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\n```css\n/* Creating a gradient border on focus */\ninput:focus {\n  outline: none;\n  border-image: linear-gradient(to right, hsl(249, 99%, 64%), hsl(278, 94%, 30%)) 1;\n}\n\n/* Styling error states */\ninput.error {\n  border-color: var(--red);\n}\n```\n\n```js\n// Real-time card preview updates\ncardNumberInput.addEventListener('input', (e) =\u003e {\n  let value = e.target.value.replace(/[^0-9]/g, '');\n\n  // Format with spaces every 4 digits\n  if (value.length \u003e 0) {\n    value = formatCardNumber(value);\n    e.target.value = value;\n  }\n\n  cardNumberDisplay.textContent = value || '0000 0000 0000 0000';\n});\n```\n\nKey skills improved:\n- Creating responsive layouts using CSS Flexbox\n- Implementing mobile-first design approach\n- Writing clean, maintainable JavaScript for form validation\n- Using CSS custom properties for consistent theming\n- Handling different form states and user interactions\n- Implementing real-time UI updates based on user input\n- Creating proper form validation with meaningful error messages\n- Using media queries effectively for responsive design\n\n## Useful Resources\n\n- [MDN Web Docs: Form Validation](https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation) - This helped me understand how to implement proper form validation techniques.\n- [CSS-Tricks: A Complete Guide to Flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/) - This is an amazing article that helped me understand Flexbox layout.\n- [JavaScript Regular Expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) - This resource was invaluable for creating the card number formatting function.\n- [CSS Custom Properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties) - This helped me implement a consistent color scheme throughout the project.\n- [CSS-Tricks: A Complete Guide to CSS Media Queries](https://css-tricks.com/a-complete-guide-to-css-media-queries/) - This guide helped me create responsive layouts for different screen sizes.\n\n## Future Improvements\n\n- Add animation for smoother transitions between states\n- Implement more advanced card number validation (Luhn algorithm)\n- Add accessibility features for screen readers\n- Optimize performance for slower devices\n- Implement autofocus on the first form field when the page loads\n- Add keyboard navigation support for better accessibility\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayokanmi-adejola%2Fquick-card-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayokanmi-adejola%2Fquick-card-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayokanmi-adejola%2Fquick-card-form/lists"}