rmcg.dev/projects/FrontendMentor/newbie/intro-component-with-signup.../README.md

80 lines
3.4 KiB
Markdown
Raw Normal View History

2022-09-28 22:06:27 +02:00
# Frontend Mentor - Intro component with sign up form solution
2022-09-28 22:06:27 +02:00
This is a solution to the [Intro component with sign up form challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/intro-component-with-signup-form-5cf91bd49edda32581d28fd1). Frontend Mentor challenges help you improve your coding skills by building realistic projects.
2022-09-28 22:06:27 +02:00
## Table of contents
2022-09-28 22:06:27 +02:00
- [Frontend Mentor - Intro component with sign up form solution](#frontend-mentor---intro-component-with-sign-up-form-solution)
- [Table of contents](#table-of-contents)
- [Overview](#overview)
- [The challenge](#the-challenge)
- [Screenshot](#screenshot)
- [Links](#links)
- [My process](#my-process)
- [Built with](#built-with)
- [What I learned](#what-i-learned)
- [Continued development](#continued-development)
- [Author](#author)
- [Acknowledgments](#acknowledgments)
2022-09-28 22:06:27 +02:00
**Note: Delete this note and update the table of contents based on what sections you keep.**
2022-09-28 22:06:27 +02:00
## Overview
2022-09-28 22:06:27 +02:00
### The challenge
2022-09-28 22:06:27 +02:00
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"*
2022-09-28 22:06:27 +02:00
### Screenshot
2022-09-28 22:06:27 +02:00
![Mobile](./screenshots/mobile.png)
![Mobile with Errors](./screenshots/mobile-errors.png)
![Desktop](./screenshots/desktop.png)
![Desktop with Errors](./screenshots/desktop-errors.png)
2022-09-28 22:06:27 +02:00
These screenshots represent the Mobile and Destktop versions, with and without the error states.
2022-09-28 22:06:27 +02:00
### Links
2022-09-28 22:06:27 +02:00
- Solution URL: [Github](https://github.com/tarasis/tarasis.github.io/tree/main/projects/FrontendMentor/newbie/intro-component-with-signup-form)
- Live Site URL: [Tarasis @ Github.io](https://tarasis.github.io/FrontendMentor/newbie/intro-component-with-signup-form/)
2022-09-28 22:06:27 +02:00
## My process
2022-09-28 22:06:27 +02:00
As usual I started with a mobile first approach, aiming to put most things into CSS properties, so that for the desktop version I was mostly just updating the values of the properties.
2022-09-28 22:06:27 +02:00
I'm not sure why I decided to not use a lot of classes, and instead put styling directly onto the html elements. I think it was just to be a little different than normal. I know that in a real project that I wouldn't use this approach.
2022-09-28 22:06:27 +02:00
For the JavaScript I tried to minimise how much I was doing there, and looked to leverage combining text with an element id so I could unhide or hide the error message.
2022-09-28 22:06:27 +02:00
### Built with
2022-09-28 22:06:27 +02:00
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Mobile-first workflow
2022-09-28 22:06:27 +02:00
### What I learned
2022-09-28 22:06:27 +02:00
Main thing I learnt was that the `checkValidity()` method triggers checks for ALL HTML inputs on the page, not just the specific one you targeted. This surprised me, and was consistent across Safari, Firefox and Chrome.
2022-09-28 22:06:27 +02:00
### Continued development
2022-09-28 22:06:27 +02:00
Continue working through challenges. I really must put some time into learning BEM / the version that Kevin Powell uses.
2022-09-28 22:06:27 +02:00
## Author
2022-09-28 22:06:27 +02:00
- Website - [Robert McGovern](https://tarasis.net)
- Frontend Mentor - [@tarasis](https://www.frontendmentor.io/profile/tarasis)
- Twitter - [@tarasis](https://www.twitter.com/tarasis)
2022-09-28 22:06:27 +02:00
## Acknowledgments
2022-09-28 22:06:27 +02:00
Matt for this useful service.