Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Advice generator with animated loader

Azhar 600

@azhar1038

Desktop design screenshot for the Advice generator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
  • API
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hi,

This is my solution to Advice generator app. I have added some cool animations to make it look better. Dice icon inside the button rotates while the advice is being loaded.

The most difficult part for me was to time the animation properly. When the advice is loaded, the icon should complete its rotation before stopping. I did this using animation-play-state along with following JS:

  myElement.addEventListener('animationiteration', (e) => {
    // Stop animation by removing class or data attributes
  }, {
    once: true
  });

If you have any suggestion or improvement idea, I would love to know!

Thanks for checking out :)

Community feedback

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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