Design comparison
Community feedback
- @FrostemanNeogardPosted over 1 year ago
This is pretty great! There's only one small thing I'd like to mention.
Fetching advice doesn't seem to work on Firefox, though this is very easily fixed. When fetching the API, you can simply add
{cache: "no-cache"}
as a second parameter, like this:const response = await fetch(API_URL, {cache: "no-cache"})
It is in my opinion a bit cleaner to use async await for stuff like this. Here's an example of what that could look like.
async function FetchRandomAdvice(callback: Function) { const response = await fetch(API_URL, {cache: "no-cache"}) const data = await response.json() const adviceSlip = data.slip callback(adviceSlip) }
Design-wise, I think the only thing you didn't get quite right was the hover effect for the button. It should have a green dropshadow instead of a lighter background color.
Hope this helps!
Marked as helpful1
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