Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

JOKE Generator 😜

Galaxy159 470

@Galaxy159

Desktop design screenshot for the Advice generator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
  • API
2junior
View challenge

Design comparison


SolutionDesign

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 🎉

Community 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

2

Galaxy159 470

@Galaxy159

Posted

@twDevNoob ah man so my code was bad after all 😅 darn

This will be helpful in future projects for sure..

Thanks and have a great day\night 🎉

0
Travolgi 🍕 31,420

@denielden

Posted

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 of main 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

1

Galaxy159 470

@Galaxy159

Posted

@denielden Awesome feedback! Will try the techniques you mentioned

Thanks and happy coding! 😋

1
Travolgi 🍕 31,420

@denielden

Posted

@Galaxy159 you are welcome and keep it up!

1

Please log in to post a comment

Log in with GitHub
Discord logo

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