Design comparison
Solution retrospective
Even though the challenge was fairly straight forward, it took me some time trying to get it as close as possible, especially the text. I tried to open the design photos in photoshop and get the sizes that way. If this is cheating, let me know, but I figured in real work situations you would work off designer's files anyway. I usually try building a challenge a few times after completing it, or building it differently in some way, therefore, as always, any feedback is much appreciated. As I'm still learning, I'm somewhat hesitant to comment on other peoples solutions so I don't give someone bad advice, but very much appreciate these challenges and the community, and will work on that going forward. Thanks!
Community feedback
- @correlucasPosted about 2 years ago
👾Hi @zp021, congratulations on your solution!👋 Welcome to the Frontend Mentor Coding Community!
Great solution and a great start! From what I saw you’re on the right track. I’ve few suggestions for you that you can consider adding to your code:
Your solution is great and the code is working, but the HTML structure can be reduced by removing unnecessary divs, all you need is a single
<main>
or<div>
to keep all the content inside, and nothing more. The ideal structure is thediv
and only the image, heading, and paragraph.Here’s one example to show can be cleaner this HTML structure:
<body> <main> <img src="./images/image-qr-code.png" alt="QR Code Frontend Mentor" > <h1>Improve your front-end skills by building projects</h1> <p>Scan the QR code to visit Frontend Mentor and take your coding skills to the next level</p> </main> </body>
To reduce the CSS you can use the direct selector for each element instead of using
class
this way you have a code even cleaner, for example, you can select everything using the direct selector for (img, h1, and p, main).Here's my solution for this challenge if you wants to see how I build it: https://www.frontendmentor.io/solutions/qr-code-component-vanilla-cs-js-darklight-mode-nS2aOYYsJR
✌️ I hope this helps you and happy coding!
0@zp021Posted about 2 years ago@correlucas That makes sense, I get that we should generally strive for less code and cleaner solutions, so that was very helpful. I'll have to take a closer look at your solution. I'm still learning JavaScript, so my skillset is limited but as I gain more experience, it would be fun to revisit each challenge, improve, embellish, and put a personal touch to each as you have done. Thanks!
1@correlucasPosted about 2 years ago@zp021 This is amazing, then tell me if worked and if was useful for you! Keep posting amazing content =)
0 - @hectorestebanmPosted about 2 years ago
Buenas @ zp021, no es mala la idea de usar Photoshop para obtener las dimensiones aproximadas de la tarjeta QR, otra opción mas simple sería usar el programa Paint de Windows para ir viendo las dimensiones y el espaciado aproximado de los textos. Pero ambos resultados son aceptables. Con respecto al diseño no lo veo mal y has tratado de hacerlo lo más parecido posible. Felicidades.
0
Please log in to post a comment
Log in with GitHubJoin 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