127 lines
4.7 KiB
Markdown
127 lines
4.7 KiB
Markdown
# Frontend Mentor - Base Apparel coming soon page solution
|
|
|
|
This is a solution to the [Base Apparel coming soon page challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/base-apparel-coming-soon-page-5d46b47f8db8a7063f9331a0). Frontend Mentor challenges help you improve your coding skills by building realistic projects.
|
|
|
|
## 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)
|
|
- [Useful resources](#useful-resources)
|
|
- [Author](#author)
|
|
- [Acknowledgments](#acknowledgments)
|
|
|
|
**Note: Delete this note and update the table of contents based on what sections you keep.**
|
|
|
|
## 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:
|
|
- The `input` field is empty
|
|
- The email address is not formatted correctly
|
|
|
|
### Screenshot
|
|
|
|
![](./screenshot.jpg)
|
|
|
|
Add a screenshot of your solution. The easiest way to do this is to use Firefox to view your project, right-click the page and select "Take a Screenshot". You can choose either a full-height screenshot or a cropped one based on how long the page is. If it's very long, it might be best to crop it.
|
|
|
|
Alternatively, you can use a tool like [FireShot](https://getfireshot.com/) to take the screenshot. FireShot has a free option, so you don't need to purchase it.
|
|
|
|
Then crop/optimize/edit your image however you like, add it to your project, and update the file path in the image above.
|
|
|
|
**Note: Delete this note and the paragraphs above when you add your screenshot. If you prefer not to add a screenshot, feel free to remove this entire section.**
|
|
|
|
### Links
|
|
|
|
- Solution URL: [Add solution URL here](https://your-solution-url.com)
|
|
- Live Site URL: [Add live site URL here](https://your-live-site-url.com)
|
|
|
|
## My process
|
|
|
|
|
|
|
|
### Built with
|
|
|
|
- Semantic HTML5 markup
|
|
- CSS custom properties
|
|
- Flexbox
|
|
- CSS Grid
|
|
- Mobile-first workflow
|
|
- [React](https://reactjs.org/) - JS library
|
|
- [Next.js](https://nextjs.org/) - React framework
|
|
- [Styled Components](https://styled-components.com/) - For styles
|
|
|
|
**Note: These are just examples. Delete this note and replace the list above with your own choices**
|
|
|
|
### What I learned
|
|
|
|
The <picture> element is a container only. The <img> element is the main part describing its contents. <source> only describes different sources. So the alt remains the same for all of them.
|
|
|
|
https://stackoverflow.com/a/48207973
|
|
|
|
|
|
### Continued development
|
|
|
|
Use this section to outline areas that you want to continue focusing on in future projects. These could be concepts you're still not completely comfortable with or techniques you found useful that you want to refine and perfect.
|
|
|
|
**Note: Delete this note and the content within this section and replace with your own plans for continued development.**
|
|
|
|
### Useful resources
|
|
|
|
- [Example resource 1](https://www.example.com) - This helped me for XYZ reason. I really liked this pattern and will use it going forward.
|
|
- [Example resource 2](https://www.example.com) - This is an amazing article which helped me finally understand XYZ. I'd recommend it to anyone still learning this concept.
|
|
|
|
**Note: Delete this note and replace the list above with resources that helped you during the challenge. These could come in handy for anyone viewing your solution or for yourself when you look back on this project in the future.**
|
|
|
|
## Author
|
|
|
|
- Website - [Robert McGovern Blog](https://tarasis.net)
|
|
- Frontend Mentor - [@tarasis](https://www.frontendmentor.io/profile/tarasis)
|
|
- Twitter - [@tarasis](https://www.twitter.com/tarasis)
|
|
|
|
## Acknowledgments
|
|
|
|
My thanks to Julio Cinquina on the FEM Slack for correcting my misunderstanding of the `:has` pseudo-class.
|
|
|
|
Initial HTML
|
|
```html
|
|
<main>
|
|
<header>
|
|
<picture>
|
|
<img src="images/logo.svg" alt="Logo of Base Apparel. Hollow round circle with the text Base Apparel beside it">
|
|
</picture>
|
|
</header>
|
|
|
|
<picture>
|
|
<source srcset="images/hero-desktop.jpg" media="(min-width: 1000px">
|
|
<img src="images/hero-mobile.jpg"
|
|
alt="Hero image of a young lady holding her arm up showing some jewelry on her wrist. The lady stands in front of a bush">
|
|
</picture>
|
|
|
|
<h1></h1>
|
|
<p></p>
|
|
|
|
<form action="submit">
|
|
<label class="visually-hidden" for="email">Email input field</label>
|
|
<input placeholder="Email Address" type="email" name="email" id="email">
|
|
<button type="submit"><img src="" alt=""></button>
|
|
|
|
</form>
|
|
</main>
|
|
|
|
```
|
|
|
|
visually hidden https://stackoverflow.com/a/71349645
|
|
|