Hello frontendmentor community. This was substantially a simple challenge but if you take a close look, every piece of advice is enclosed by quotes which is something my code lacks. So, how could I implement this to my code. On top of that, every piece of advice appears abruptly when a user clicks on the dice button, thus I'd like to add some fade animation to advice whenever it shows up.
Red Pangilinan
@redpangilinanAll comments
- @Dan-KantSubmitted almost 2 years ago@redpangilinanPosted almost 2 years ago
To add quotes on the advice, just change your line 11 code on main,js and put a quote unquote between the data that you are fetching, like this: quote.innerHTML =
“${dataObj.advice}”
;For the animations, you can put your fetch code into a const then use a setTimeout() to call the said fetch advices code with await to give it a delay. You can then put animations based on that delay, whether you want it on button click or after the advice has been fetched.
I hope this helps!
1