Vlad Solomon
@vlad-solomonAll comments
- @Edwin574Submitted over 2 years ago@vlad-solomonPosted over 2 years ago
Maybe you should try this one again after some more practice
0 - @ketchanjiSubmitted over 2 years ago
- @StarisblackSubmitted over 2 years ago@vlad-solomonPosted over 2 years ago
Why the modal on page load? It's useless and breaks the flow of the entire experience.
0 - @Maacaa0Submitted over 2 years ago@vlad-solomonPosted over 2 years ago
You could add a second parameter to your fetch request like so:
fetch("https://api.adviceslip.com/advice", { cache: "no-store" })
This will stop the API from caching, and you would be able to make requests one after the other, bypassing those 2 seconds. If I were you, I would add this and get rid of the timeout animation, seeing as it's useless if you spam the generate advice button.
Marked as helpful1 - @KellyCHI22Submitted over 2 years ago@vlad-solomonPosted over 2 years ago
You should really fetch some advice straight away on page load to have it displayed already.
Marked as helpful0 - @martinnkemakolamSubmitted over 2 years ago@vlad-solomonPosted over 2 years ago
Nope, giving classes to the body DOM element is absolutely fine! It's pretty common to use the body for theme changes. Great work
Marked as helpful0 - @Snorri967Submitted over 2 years ago@vlad-solomonPosted over 2 years ago
That's what display flex is for!
Marked as helpful1 - @faha1999Submitted over 2 years ago@vlad-solomonPosted over 2 years ago
It seems to me you're requesting info from the API every time a country loads and unloads - not even talking about how you are requesting information about its neighbors every time. This seems pretty cumbersome on both the API provider and your front-end.
0