Hey guys ;)
I've been practising my react skills with an amazing training you can find right here : https://scrimba.com/
The goal of this exercise was simple : to create a meme generator using React in order to add a title and a subtitle like any meme enthusiast likes it.
There was no search bar or download button that had to be implemented.
Feel free to send me some improvements or impressions 😉
To access the project online, please visit this URL : https://meme-generator-pierre.netlify.app/
I've used several react hooks :
- useState
- useEffect
To interact with the state of my app.
I've also done an API fetch request on https://api.imgflip.com/get_memes to use their huge database.
To randomize the images, i've simply used a Math.random()
function :
function getMemeImage() {
const randomNumber = Math.floor(Math.random() * allMemes.length);
const { url } = allMemes[randomNumber];
setMeme((prevMeme) => ({
...prevMeme,
randomImage: url,
}));
}
To deploy this project i've used https://www.netlify.com
-
I'm actually working on a download button that could finish the project.
-
The second thing that i still want to improve is the CSS. Maybe some transitions and animations...
Feel free to contact me on my LinkedIn account : https://www.linkedin.com/in/pierre-ricard-/
Or to connect on my GitHub account : https://github.com/Pierre747