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

QR code component attempt 1

Ricardo•20
@WickedBlack
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


  • Sizing is something I find difficult. how or what is the process used when starting a project, and sizing it to the size stated in the style guide?

  • I was trying to add an animation to the QR image. Could you tell me how to make the background blurry or dim, so the QR image is the only thing in focus when you hover over the image?

  • any feedback is welcome, please feel free to suggest anything even if unrelated to the questions above.

Thank YOU!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Mohamed Ehab•350
    @MOHAMED-EHAB-DEV
    Posted about 3 years ago

    Hi @WickedBlack

    There is a problem: In index.html line 30 change the code to:

    <img src="./image-qr-code.png" alt="Qr Code">
    

    to be the image seen in the website

    I have some suggestions:

    1. Make The Code Semantic by put in the div with className attribution this code to be semantic:
    <footer class="attribution">
        <p>Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>.</p> 
        <p>Coded by <a href="#">Wicked Black</a>.</p> 
      </div>
    

    and put this code in the div with className container to be semantic:

    <main class="container">
        <article class="card">
          <img src="images\image-qr-code.png" alt="Qr Code">
          
          <h2>Improve your front-end skills by building projects</h2>
          <figcaption> Scan the QR code to visit Frontend Mentor and take your coding skills to the next level</figcaption>
        </article>
      </div>
    
    1. remove the style tag in the head tag

    2. to be the card in the middle of the page use the following code:

    body {
        display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3.5rem; /* separation between the card and attribution */
      min-height: 100vh;
    }
    
    Marked as helpful
  • AgilitiesZ•310
    @phichayut-pak
    Posted about 3 years ago

    Hi! Congrats on your first project submission! 🎉🎉 Here are some suggestions from me:

    1. Check your image if it works when your website is deployed. From what I've seen in your code, you assigned the wrong path in <img> tag. How you can fix is to change it to <img src="./image-qr-code.png" alt="Qr Code">

    2. Sizing doesn't matter that much in here. But if you really want to make it challenging, it's easier for you to buy premium since you'll get an access to figma design which is more accurate than jpeg/png image.

    3. From your second question, I would recommend you implement JavaScript to make it interactive as you want user to hover, the qr code will scale up and background will get blurred.

    4. Try to make it to the center by making use of flexbox, it's one of the important features in css.

    5. Even though you're trying to make the qr code scales up on hover, but it might be a bit big. You might want to scale that down. Moreover, when user quits hovering the qr code, it immediately quits the scaling. You should try using transition on this.

    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