@alleycaaat
Posted
Congrats on finishing the project! APIs were daunting at first to me, but they're really not that bad and really open up so many fun programming opportunities.
Can you elaborate on your question about the animation? When I hover the dice icon/button it rotates fast, clicking it slides a new quote in, and when I remove hover from the button it slowly reverses its spin. So the animations appear to be working. Are you talking about making the animations occur every time via CSS instead of JS? That I may be able to help with! Or rather, the classList
property can help.
I typically define the styles in my SCSS and add
or remove
them via JS; this keeps my JS cleaner and all my styles in the stylesheet. Sometimes a class
may need to be removed automatically after a set time, the setTimeOut
function can help you there. This is really helpful with animations in particular, in my experience.
Let me know if this didn't make sense, I'm happy to clarify further.
-Cheers!
Marked as helpful
@GHNetCode
Posted
@alleycaaat Hey Alleycaat Thank you so much for your input and response, apologies that it is so late at responding it has been quite hectic at my end. Yes you are right, it is in relation to ensuring the animations can continue to work every time i push the button when defined within CSS preferably. I would prefer the most elegant and proper way of doing it as i feel via JS it is more of a "hack" when dealing with animations. Don`t get me wrong i love JS haha, just i like to try to keep code where it should belongs.
Thank you.. :)