Tarot Card App! Mainly refactoring (also any general feedback is appreciated)


I built this simple Tarot card app. Its something that Ive been wanting to make since I first started learning how to script and code so im SUPER happy that ive gotten to the point where I can code something like this on my own.

I basically just wrote everything out and literally threw it all together in the editor in a way that would get everything to work :crazy_face:. Im still learning so at the time, I wasn’t thinking about how neat everything was or anything. I just used comments to help myself make sense of it all. :sweat_smile:

I know that in the future, I’ll be building things with cleanliness in mind, but for this project I was just exited to get it functional.

Ive love any ideas how I can begin refactoring the code so that it looks neat and also is DRY. I haven’t refactored code before, so I guess this would be a good time for me to start learning. Any advise and guidance will be greatly appreciated :pray:


If anyone has ideas on how I could make the functionality or layout of the app better or more fun to use I will welcome that type of advise as well. Basically any and all ideas are welcome.

Thank you all. I really appreciate it :+1:

HI @tuscannypolk !

I am having trouble seeing the button at the bottom.

I would work on moving that button up so we can see it better.

I would also look into javascript imports and exports to use with the cards array.

You can’t do this with a codepen pen, but in something like codesandbox or codepen project, you can create a seperate file for the cards array and then import that array into your main js file.

Hope that helps!

1 Like

Nice, thanks a lot. I didn’t think about that! Good eye for details :+1:

It would be cool if I could have the button set in the middle of the page, and after its clicked it resumes the default position that I have it in right now. I’ll work on that with an IF statement :thinking:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.