Skip to content

JulioCinquina/fem-intro-component-with-signup-form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - Intro component with sign up form solution

This is a solution to the Intro component with sign up form challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Live Site on GitHub Pages

Overview

The challenge

Users should be able to:

  • View the optimal layout for the site depending on their device's screen size
  • See hover states for all interactive elements on the page
  • Receive an error message when the form is submitted if:
    • Any input field is empty. The message for this error should say "[Field Name] cannot be empty"
    • The email address is not formatted correctly (i.e. a correct email address should have this structure: name@host.tld). The message for this error should say "Looks like this is not an email"

Links

Screenshots (click below to expand)

Mobile layout Mobile layout of the solution
Desktop layout Desktop layout of the solution
Form validation demonstration (GIF) error messages are displayed after trying to submit an empty sign-up form or entering an invalid email address

My process

What I learned

In this project, I have practiced the following skills:

  • Creating a responsive page with semantic HTML, CSS and JavaScript
  • Using JavaScript for client-side form validation and DOM manipulation
  • Graceful degradation: if JavaScript is disabled, the default HTML5 client-side form validation is used
  • Graceful degradation: if JavaScript is disabled, labels are positioned on top of input fields by default
  • Accessibility: input labels are always visible, even after entering data
  • Accessibility: input fields with invalid data receive the aria-invalid attribute and are described by their error message using aria-describedby
  • Accessibility: the first input field with invalid data receives focus after submitting the form
  • Accessibility: links that open a new tab or window are described using aria-describedby
  • Using CSS relative units to ensure the page scales according to the user's font size settings
  • Using CSS custom properties to allow easy customization and reusability of components
  • Using Git and GitHub

Note on accessibility: Parts of this project contain color contrast ratios that are not WCAG compliant. The colors used are part of Frontend Mentor's original design. In a real-world scenario, changes would be requested to the design team before deploying the project.


Continued development

To further develop this project, I would like to use the relational pseudo-class (:has()) to position the input labels (inside the input when it is empty; on top of it when the user starts typing) instead of relying on JavaScript. At the moment, however, the support for :has() is still insufficient for it to be used in production.

Author

About

A sign-up form component from Frontend Mentor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published