Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 1 year ago

Base Apparel Coming Soon page with Grid

Kevin H.•150
@kevinx9000
A solution to the Base Apparel coming soon page challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I got this as far as I could take it, but then had to stop before I went mad. Here's where I need help and guidance:

  • Layout: the sneaky part from the design examples is how the layout changed from desktop to mobile. Since the location of the hero image changes in the flow, I went with grid-template-areas but didn't work out perfectly. For some reason it also left white space on the right of my mobile view that I couldn't get rid of.
  • Submit button: Trying to position it inside the input field. I used positioning, but when the resposive layout changes, sometimes it would be off by a few pixels and no longer fit neatly into the input bar.
  • Background image: Couldn't seem to control it the way I wanted to and match the example. The example seems more transparent and covers more of the page. I tried cover obviously, but that made it too huge so you couldn't see the whole design. This is probably impacted by my choice of Grid layout as mentioned above.
  • Workflow: I started with mobile-first, then tried to convert it to desktop, but it was a nightmare getting the content layout correct. So then I re-did my existing code to adjust for desktop-first and then go to mobile, since desktop was more complex. That almost worked better, except for the extra white space at the right edge of my mobile view that I could not get rid of.

And probably a few more things, but those are the major issues I experienced, so I welcome any and all comments. I plan to come back and rework this again sometime, but I wanted to submit it now as my best effort at the moment, until I can learn how to improve it.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • solitary_coder•1,000
    @kabir-afk
    Posted over 1 year ago

    Hey kevin , good job on completing the challenge , on reviewing your queries I was able to work on some of them . . . here are the necessary corrections to be made :-

    • Reason for whitespace
      • so when you inspect your image-on-1024px vw you'll see that your img is centered inside the <picture> element , this is ok but it is also the reason why you see whitespace despite compartmentalizing your grid through grid-template-areas . . . to solve this issue you can do the following:-
    picture img{
    margin:auto;
    width:100%
    }
    

    Literally this single addition of line solves your problem and fixes your layout issues

    • Submit btn

      • Not that your approach is wrong but another alternative would have been to use flex on your form element and position it accordingly , this would have been more responsive ig
    • Background-image

      • Well can't really help with that 😅😅. . .but you can try setting your background-size to a custom value like 70vw or whatever suits you, won't be perfect but still better than cover ig
    • Other Issues

      • you forgot to add alt description in your images , not a big deal but quite a need when there is a problem fetching the image properly.
      • you forgot adding id to your input element which is bad in terms of accessibility , it literally presents itself as an issue in your console . . .now here you have a single input element , but once you start working with a lot of inputs inside a single page , it will become a big issue.
    • Regarding JS

    Thanks to you I got to know about the checkValidity() method, otherwise up until now I was using JS Regex and using .test method to validate my input values . . .there are still some issues that I would like to address . . . .

    Your code really seemed repetitive , especially the constant addition and removal of classes, like you could have used toggle for a shorter and better approach . . . and since you used innerHTML to change the text inside error-message you could have done styling inside it using

    errorMessage.innerHTML = !inputField.checkValidity() ?
    `<small style="color: red;">Please provide a valid email address</small>`
        : `<small style="color: green;"><b>Success!</b> And immediately shredded.</small>`;
    
        inputField.style.borderColor = (!inputField.checkValidity()) ? "red" : "green";
        errorIcon.classList.toggle("hidden", inputField.checkValidity());
    });
    inputField.value = "";
    

    This also avoids need of adding unnecessary classes inside your CSS. Make sure to add the required attribute in your html as well , for the checkValidity() method to work when inputField is empty, something like

    <input type="email" placeholder="Email Address" class="input-field" required>
    

    Look , the JS code I provided might not resonate with you very well, but I think its better to write a short , concise and maintainable code when you can . . .

    Hope I was able to help, happy coding!! 🥂🥂

    Marked as helpful

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit 1st-party linked stylesheets, and styles within <style> tags.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub