random pokemon generator

javascript scss pug

I wanted to practice using fetch and DOM manipulation and so the Pokemon Card Generator was born.

Each time the ball is clicked, data is fetched from the PokeAPI and I have written a script to display a styled pokemon card based on the pokemon type attribute. I was initially having trouble with the card displaying before the pokemon image had finished loading but got around this with a promise to display a spinning animation until the image is complete.

Next to do: Better responsiveness on the ball click, smoother spinning animation, take user input to generate a pokemon card based on user details.