Design comparison
Solution retrospective
I have completed this as my 19th challenge in Frontend Mentors.
I have used ReactJS and I learned to use the axios
API Call in React. This was a good practice for me. Please look at the code and tell me whether the approach is correct or not
I have learned several things. By making mistakes😅.
- We cannot use box-shadow property along with clip-path property.
- We cannot use useEffect hook inside Event handlers.
If you have to correct any mistakes that I have done.... I am happy to recive the comments.
Advance thanks for the comments 🫡
Community feedback
- @danielmrz-devPosted 10 months ago
Hello @madhavan-ts!
Your solution looks great!
I have a suggestion for improvement:
- Use
<main>
to wrap the main content instead of<div>
.
📌 Tags like
<div>
and<span>
are typical examples of non-semantic HTML elements. They serve only as content holders but give no indication as to what type of content they contain or what role that content plays on the page.This tag change does not impact your project visually and makes your HTML code more semantic, improving SEO optimization as well as the accessibility of your project.
I hope it helps!
Other than that, great job!
0 - Use
- @akash02abPosted 10 months ago
1.In Firefox browser the response is cached thus not showing new "advice" on button click. You may want to check Using JavaScript Axios/Fetch. Can you disable browser cache?
2.When "Loading ..." text occur the "Dice" button jumps from it's original position, this is due to length of "Advice" text, it can be of any number of lines thus, changing the height of the card. To deal with it you can give fix
min-height
to the card..advice__box { min-height: 30rem; }
you also need to give
position: absolute;
to.advice__btn-wrap
.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