JOKE Generator đ

Solution retrospective
The random advice API showed me the same advice on multiple re-renders, and i wasn't sure if it was my code so i tried replacing it with with a random joke API and it worked đ
Also added a loader with the matching primary color
Any feedback appreciated!
Happy coding đ
Please log in to post a comment
Log in with GitHubCommunity feedback
- Account deleted
I encountered a simular issue, when the app was displaying the same advice over and over. I found out it was caused by HTTP response caching in certain browsers. Passing { cache: "no-cache" } as the 2nd argument to the fetch() function solved the problem.
Otherwise your solution seems just right. I hope this was helpful
Marked as helpful - @denielden
Hello Galaxy, You have done a good work! đ
Some little tips to improve your code:
- use
main
tag to wrap the card and improve the Accessibility but not as a container of that one element - also you can use
article or blockquote
tag instead ofmain
tag to the container card for improve the Accessibility - remove all
margin
from.container and .generator
classes - use flexbox to the body to center the card. Read here -> best flex guide
- after, add
min-height: 100vh
to body because Flexbox aligns child items to the size of the parent container
Keep learning how to code with your amazing solutions to challenges.
Hope this help đ and Happy coding!
Marked as helpful - use
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