Giter Site home page Giter Site logo

zaidkhan144 / memory-game Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 843 KB

A memory game that is going to present six trending random GIFs on screen. If your selected GIF is different from the previous ones you chose, your score will increase, and a new set of random GIFs will generate. I have created this in React and used giphy API to render GIFs.

Home Page: https://zaidkhan144.github.io/memory-game/

HTML 15.10% JavaScript 48.65% CSS 36.25%
memory-game react giphy-api gifs react-hooks random-gifs minify css

memory-game's Introduction

Suspect GIFs

A memory game where you have to avoid picking the same GIF.

Intro Page

image

Main Page

image

Installation and Setup Instructions

To make below steps work, You will need node and npm installed globally on your machine.

# Clone this repository
$ git clone https://github.com/ZaidKhan144/memory-game.git

# Enter the Git folder
$ cd memory-game

# Install dependencies
$ npm install

# Start the project
$ npm start

Tech used

  • React
  • giphy API
  • Styled Components
  • Styled Icons
  • CSS
  • React Hooks
  • ESLint - A linter tool to standardize code
  • Prettier - Code formatter
  • GitHub Pages

Reflection

This project's main goal was to get used to React Hooks.

This memory game is going to present six trending random GIFs from giphy API. If the selected GIF would be different from the previous selected one, then the score will increase by one, and a new set of random GIF will generate. And If the selected GIF is the same, the best score will be the current score, and the current score will turn to zero.

I started this project by creating a create-react-app boilerplate and then made custom React Components.

One of the main challenges I ran into was when I was kept getting an error Cannot read property 'images' of undefined when trying to render random GIFs on every click. So after playing around with the code, I realized all I needed to do was access the object's data randomly in the map method instead of just looping over the data.

At the end of the day, the technologies implemented in this project are React, React Hooks, CSS, and styled-components. I used relatively more React Components to make code much cleaner and easier to understand. I have also made this responsive to give an optimized browsing experience.

In the future, I might implement local storage functionality to store the user scores.

You can visit live version of the App here: https://zaidkhan144.github.io/memory-game/

memory-game's People

Contributors

zaidkhan144 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.