Hi!
Looking for feedback on my random quote project. https://codepen.io/ceptember/pen/jeBamj
It passed the tests, but I wanted to include a jQuery fade transition and it’s giving me some trouble. I thought I could use fadeOut() to get rid of the previous quote box, then set the React state to the new quote and box color, and bring the box back with fadeIn(). But it wants to set the new one first, and then fade it out and then back in. I thought I could use a callback function to make sure nothing happened until after it faded out, but it still doesn’t give a smooth transition:
getQuoteCallback(){
this.setState({randomNum : Math.floor(Math.random()*quotes.length)})
$("#quote-box").fadeIn(1000);
}
getQuote(){
$("#quote-box").fadeOut(1000);
this.getQuoteCallback();
}
I’m also looking for any other general feedback on this project.
I saw on this forum that a lot of people used a quote generator API, but I didn’t do that since it looks like that’s one of the topics of the next certificate, and it didn’t seem productive for me to spend time on it at this stage.
Thanks in advance!