Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 3 years ago

Base Apparel Page using HTML CSS and JS (grid & absolute position)

Nguyen Nguyen•340
@jesuisbienbien
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


Hello, I've struggled a lot with this challenge. I have a few specific questions but also welcome any other feedbacks.

1- I use setTimeout so that the form is clear before the alert pops up, will there be any issue? If I use promise instead, how can I do this? Any other way that you guys did to clear out the form after successfully submitted?

2- I learned from someone else how to do this linear background but I'm still very confused about how to achieve it. Is there any good tutorial on this topic that you'd recommend? How do you just look at this background design and know which colors to use for the linear gradient?

This is my second project using JS. Your feedbacks will help me learn a lot so I hope to receive some comments on this project. Thank you in advance :D

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Prabhash Ranjan•2,540
    @besttlookk
    Posted over 3 years ago

    Hi, First of all congtratulations on completing this challenge. Tho there are few things you need to change which I am going to point out:

    • When ever you use form rather that adding the eventListner on the submit-button add the eventListerner on the <form> element. When we click on button with type submit(that is very important) form automatically get submitted.
      <form  class="email-input-wrapper" id="form"> // no need to mention action
                <input
                  id="user-input"
                  name="email"  // with this we can extract the value of input. 
                />
                <button type="submit" id="submit-button">
                  <img src="images/icon-arrow.svg" alt="" />
                </button>
              </form>
    
    const formEl = document.getElementById("form")
    
    formEl.addEventListner("submit", (event) => {
       event.preventDefault() ;// form has default behaviour of going to differnt url for submission. We need to avoid that 
    
       const valueEntered = event.target.email.value ; // using the name to extract the value
    
       //DO ALL THE CHECKING HERE...ONCE EVERYTHING IS OKAY..YOU CAN CLEAR THE INPUT
       //FOR THAT YOU DONT HAVE TO USE ANY TIMER. JUST RESET THE VALUE LIKE THIS.
        event.target.email.value = "";
    
    • For gradient you can refer to https://www.w3schools.com/css/css3_gradients.asp or https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient

    Feel free to drop a mesg incase you need any help. I am no expert but will try to help you out

    Good Luck,

    Happy Coding

    Marked as helpful
  • Shashree Samuel•8,860
    @shashreesamuel
    Posted over 3 years ago

    Hey good job completing this challenge

    Keep up the good work

    Your solution looks great however I think that the logo is a bit too small. Secondly the description is supposed to wrap by the keyword "our" to look like the design.

    I hope this helps

    Cheers

    Happy coding 👍

    Marked as helpful
  • Vanza Setia•27,715
    @vanzasetia
    Posted over 3 years ago

    Hi, Nguyen! 👋

    It's great to see you submitting another solution! 👏 Good effort on this challenge! 👍

    Regarding your questions.

    • For me, I used the Netlify form. So, when the user submitted their email, there will be a "Thank you" page and inside it, there's a link to go back to my site. Then, once the user goes back the email input has been cleared. So, if I would do it by myself, I would probably clear the input by setting the value to an empty string and adding a pop-up that says "Thank you for submitting your email!".
    • If I don't have the design file, I would just probably use a solid background because I think it is hard to measure the color for the gradient background. However, I use this linear-gradient(135deg, white, #fff5f5) code. So, you can just copy-paste it if you want. Regarding the learning resource, I would recommend reading the MDN documentation and/or CSS Trick articles about gradients.

    I recommend adjusting the breakpoint for the media query, it's too late to change the layout into desktop layout on 1440px.

    I would highly recommend never using inline CSS in JavaScript. It's best to always use CSS classes to style different states. For example, you can have is-invalid class in your CSS to style any element that is invalid. So, in JavaScript you can add and remove the is-invalid class based on different conditions.

    That's it! 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 all CSS, SCSS and Less files in your repository.

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.

How does the JavaScript validation report work?

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

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

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

Oops! 😬

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

Log in with GitHub