Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 9 months ago

LOOPSTUDIOS LANDING PAGE USING HTML AND SCSS

sass/scss, accessibility
1deadjoe•370
@1deadjoe
A solution to the Loopstudios landing page challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

I am proud that I am getting better at SCSS. It is easier to avoid repitition using mixins, extend, etc.

What challenges did you encounter, and how did you overcome them?

I got too focused on the styling that I somehow got lost with the JS. Not being able to follow what class to call was wracking.

What specific areas of your project would you like help with?

I would greatly appreciate if someone could help me identiy where to use JS to add the interactivity. I did not know how to place the items in the header in order to get the desired effect.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • ricardoychino•190
    @ricardoychino
    Posted 9 months ago

    Hi,

    Congratulations! That's a great looking solution. Very readable and good semantics, too!

    There are two things that caught my attention that I'd like to point out:

    1. At hero section, I think it would be better if you just use background property to apply the image instead of using a <picture> with position: absolute;. It is easier to handle an image change or if the image doesn't have the dimensions that fits the section. As for the responsive source of the images, you can always use a media query.

    2. Initially I was intending to recommend the selector :nth-child() for the section where you have the products, instead of using selectors .product-{n}, but actually I don't think you need to set the grid properties from lines 374 to 391 and 425 to 440 in your main.scss. I disabled those properties on devtools and your design is still looking great! The only one that I kept is the grid-template-columns: repeat(4, 1fr); for desktop viewing. Why did I point this out? Because, let's assume you need to add another product eventually. You will then probably need to add a .product-9 rule to your CSS, or use one of the currently created .product-{n} on it. Either way, there are disadvantages: maintainability or consistency, respectively. If you remove those styling, the style will still be as you intended and there's no need to worry in case you need to add or remove new items

    About the JS interactivity:

    It seems like it's pretty much halfway done and that only needs to add a JS interaction. With your current code, I'd start adding a event listener to the button which adds (or in your current code's case, remove) a class to handle visibility of the menu, such as:

    /*
      This adds a reference to the target elements
      (This is optional, but I personally believe that this 
      makes the code a bit cleaner)
    */
    const buttonElement = document.getElementById('menu')
    const navElement = document.querySelector('.header-nav')
    
    /* Adds the event listener for clicks to the <button> */
    buttonElement.addEventListener('click', () => {
      // Check if nav is hidden
      if (navElement.classList.contains('hidden')) {
        navElement.classList.remove('hidden') // Shows nav
        buttonElement.querySelector(':scope .open').classList.add('hidden')  // Hide the hamburger icon
        buttonElement.querySelector(':scope .close').classList.remove('hidden') // Shows the close icon
      } else {
        navElement.classList.add('hidden')  // Hides nav
        buttonElement.querySelector(':scope .open').classList.remove('hidden')  // Shows the hamburger icon
        buttonElement.querySelector(':scope .close').classList.add('hidden') // Hide the close icon
      }
    })
    

    This is enough to toggle the show/hide in your current code and continue to style further or change the structure if you want to. You will see that the styling will need some adjusts after applying that toggling. I'd change a little this approach, but the way you did works fine as well.

    I hope this is what you needed and that it helps. I apologize if it didn't. Again, great job and keep it up!

    Marked as helpful
  • 1deadjoe•370
    @1deadjoe
    Posted 9 months ago

    Thank you. Sadly it is the one thing I could not do perfectly. I got too focused on the styling.

  • andrean-sihombing•350
    @imandreans
    Posted 9 months ago

    Your solution is already similar to the design, while there are difference like layout and size. You can come back and improve it later.

    The solution is responsive, sadly there's no sidebar that appear when I click the menu button.

    Your code is well-written both SCSS and HTML. I like that you use picture tag to add the images.

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