Code Monkey home page Code Monkey logo

tic-tac-toe's Introduction

Javascript

 

Reactjs     CSS     Javascript

Tic Tac Toe Game

A two players tic-tac-toe game created using react and session storage database.

About Project

Online tic-tac-toe game website with scoreboard for win, loss and draw.

Development Insights

This project uses React framework and session storage for scoreboard.

Components

Board Component

Main component where actual game board is displayed and each slot of game is rendered independently to provide selection of any slot for any turn easily.

Slot Partial

This is a small yet important dynamic child part of it's parent Board Component. This partial component is use to provide easy random choice for player's tic as its creates an individual slot which doesn't depend on each other but on parent for all prop values like winner state.

MarkType Component

To use svg circles and cross for tic marks in game and all around easily; I created this jsx template where I can easily just render the required svg by passing its name as prop. Additional perk is its Highly easy to maintain any type svg icons in react project.

Modal Component

Modal Component using create react portal to show the result of each match with action choice to restart or play another round.

Custom Hooks

Session Storage Hook

I created this hook to easily store value in session storage without declaring each time session storage in different Components. It helps to store the state values easily and you can easily change them too.

Mount Transition Hook

Simply it is only for to add little delay to anything. It is Specificly used here to show modal transitions.

tic-tac-toe's People

Contributors

dependabot[bot] avatar sushantgwr87 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.