This is a solution to the Rock, Paper, Scissors challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout for the game depending on their device's screen size
- Play Rock, Paper, Scissors against the computer
- Maintain the state of the score after refreshing the browser (optional)
- Bonus: Play Rock, Paper, Scissors, Lizard, Spock against the computer (optional)
![Screenshot 2023-08-21 at 4 15 52 PM](https://private-user-images.githubusercontent.com/123577810/262177901-7e13d388-f277-4f9a-b0b9-fe492a8cfc74.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTgyNjI2ODEsIm5iZiI6MTcxODI2MjM4MSwicGF0aCI6Ii8xMjM1Nzc4MTAvMjYyMTc3OTAxLTdlMTNkMzg4LWYyNzctNGY5YS1iMGI5LWZlNDkyYThjZmM3NC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYxM1QwNzA2MjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05MTk4OWEwZDU0NDExZTEyMjcyYzIwZjJmYmQ1ZTdiNTNkOGM2MTQ5NDZkNWEwZmQwZmY0ZmRkMWQ4ZjU5ZDJkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9._u_vnwJmuI4y89E0_ElDRGUfJz8VUJR_iWe4AUVOQg4)
![Screenshot 2023-08-21 at 4 16 23 PM](https://private-user-images.githubusercontent.com/123577810/262177933-9bc28de5-1e0f-47eb-a5ba-c1525d320d81.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTgyNjI2ODEsIm5iZiI6MTcxODI2MjM4MSwicGF0aCI6Ii8xMjM1Nzc4MTAvMjYyMTc3OTMzLTliYzI4ZGU1LTFlMGYtNDdlYi1hNWJhLWMxNTI1ZDMyMGQ4MS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYxM1QwNzA2MjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hNjEwMWUwOGQ1NDUzMjBhNzY2MGVlYmY2NDQxMjcwYTRiN2FkMjNlMmY5YzYyNDVkNGMwZDVjZmVhMjZmYzdmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Jzz9ZPdRg7vzWAx_z6K69_9jorYaoCEtguJVwsaIPQA)
- Solution URL: Solution
- Live Site URL: Deployment
Like always, I tried breaking everything down to components from the mockups. Started with the header down to the triangle of choices then moved onto the next page. Finished the mobile version first and made sure all styling was correct. I then moved on to the tablet/desktop and refactored any code at the end.
- React - JS library
- FramerMotion - For Animations
- TailwindCSS - For styles
- Flexbox
- Mobile-first workflow
This was my first TypeScript project, and I faced numerous challenges while trying to assign accurate types to my functions and props. Over time, however, understanding TypeScript and its usage became much easier. One question that frequently crossed my mind during this project was, "Should I create a single interface for all props/functions in the parent component and pass it down? Or is it more effective to develop separate interfaces for each child component?" The answer largely depended on the project's structure and a range of other factors.
I also learned the value of refactoring code after its completion, rather than before. I found myself spending a considerable amount of time reworking my refactored code midway through the project.
Adding linear gradient colors to borders was also weird due to tailwind.
- Learned how to use interfaces properly (hopefully lol)
- Using typescript with useStates
- Refactor code after you finish not before
- Seperate interfaces into a seperate file to keep code clean
- Learned a bit about framer motion, enhancing user experience
- Implement Lizard and Spock options
- Was also thinking about adding a form of currency so you can bet if you win.
- Since there's betting maybe add something the user can buy
- Auth to save money progress
- Website - Tommy Nguyen
- Frontend Mentor - @TommieeN
- LinkedIn - Tommy Nguyen