Code Monkey home page Code Monkey logo

rpsls's Introduction

Rock, Paper, Scissors - GAME ๐ŸŽฎ

This is a simple yet fun Rock, Paper, Scissors game built using React and TypeScript. The game allows users to play Rock, Paper, Scissors against the computer.

Overview

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • CSS Grid
  • Mobile-first workflow
  • TypeScript
  • React - JS library

What I learned

During the development of this project, I learned a lot about React and its ecosystem with TypeScript. Here are some of the key learnings:

  1. React Hooks: I learned how to use React hooks to manage state in my application. I used the useState , useEffect and useCallback hooks to manage the game state and handle user interactions.

  2. React Context: I learned how to use the React Context API to share state across multiple components. This was particularly useful for sharing the game state across different parts of the application.

  3. React With TypeScript: I learned more about how we can extend our react app with TypeScript :). I also learned more about how to create type and interface for React components.

  4. Animations: I learned how to create animations in React using the canvas-confetti library. This added a fun element to the game and improved the overall user experience.

Here is a code snippet of how I used the canvas-confetti library:

import confetti from 'canvas-confetti';

const Confetti = confetti.create(document.getElementById('canvas') as HTMLCanvasElement, { useWorker: true });
Confetti({ particleCount: 100, spread: 70, origin: { y: 2 } });
setTimeout(() => { myConfetti.reset(); }, 1000);

Continued development

In future projects, I plan to continue improving my skills in React and exploring more libraries for creating animations. I also want to learn more about managing state in larger applications and how to optimize performance in React.

Useful resources

Author

rpsls's People

Contributors

taboutsafredy avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.