This is a solution to the Maker pre-launch landing page challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout depending on their device's screen size
- See hover states for interactive elements
- Receive an error message when the form is submitted if:
- The
Email address
field is empty should show "Oops! Please add your email" - The email is not formatted correctly should show "Oops! That doesn’t look like an email address"
- The
- Solution URL: https://github.com/norman02/maker-pre-launch-landing-page.git
- Live Site URL: https://maker-pre-launch-landing-page-tau.vercel.app/
- Semantic HTML5 markup
- CSS Grid
- Javascript
- Mobile-first workflow
- 7-1 Pattern
- Sass
I learned a lot about css grid while working on this project. There are several different grid layouts used in this design. I also needed to remember my regular expressiosns RegEx to complete the email validation script:
const isEmail = (email)=> {
const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(String(email).toLowerCase());
}
const validate = () => {
const inputEmail = document.getElementById('email').value
if (isEmail(inputEmail)) {
alert(`Email will be sent to ${inputEmail}`)
} else {
document.getElementById('cta').classList.toggle('error')
}
}
I would like to continue working on more complex layouts using CSS grid
- CSS-Tricks - This helped me with CSS grid as well as formating text areas.
- Frontend Mentor - @norman02
- Twitter - @JohnIsNorman
- Patrick Thank you for pointing out the bug I had in my transitions.