-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add timer, play-again button and user's message
- Loading branch information
Showing
5 changed files
with
296 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,44 @@ | ||
# Matching Game | ||
|
||
This is a memory-matching game of 8 pairs of cards, and the objective is to match all the pairs by flipping the cards over. The game has a Reset button to shuffle the cards again. | ||
This is a simple web-based memory-matching game implemented in HTML, CSS, and JavaScript. | ||
|
||
## ## Technologies Used | ||
## Table of Contents | ||
|
||
- HTML | ||
- CSS | ||
- JavaScript | ||
- Font Awesome | ||
- [Description](#description) | ||
- [Game Features](#game-features) | ||
- [How to Play](#how-to-play) | ||
- [Screenshots](#screenshots) | ||
- [Installation](#installation) | ||
|
||
## Usage | ||
|
||
The game is played by clicking on cards to flip them over. If two cards match, they stay flipped over. If they do not match, they are flipped back over. The game is won when all 8 pairs have been matched. The Reset button shuffles the cards and restarts the game. | ||
## Description | ||
|
||
### Styling | ||
Matching Game is a classic memory game where the player is presented with a grid of cards, each containing an image. The goal is to find pairs of matching cards by flipping them over two at a time. The game is won when all pairs have been successfully matched. | ||
|
||
The game is styled using CSS, including styles for the game container, cards, and the Reset button. The styles include a gradient background, border radius, box shadow, and animation effects. The styles also include media queries for responsive design on different screen sizes. | ||
## Game Features | ||
|
||
- 8 pairs of cards for a total of 16 cards. | ||
- A countdown timer to add a challenge. | ||
- A "You won!" message when all pairs are matched. | ||
- A "Play Again" button to reset the game. | ||
- A "Reset" button to restart the game at any time. | ||
|
||
## How to Play | ||
|
||
1. Click on a card to reveal its image. | ||
2. Click on another card to see if it matches the first card. | ||
3. If the two cards match, they will remain face up. | ||
4. If the two cards do not match, they will be flipped face down again. | ||
5. Continue until all card pairs are matched. | ||
6. If the timer runs out before all pairs are matched, you lose the game. | ||
|
||
## Screenshots | ||
|
||
![Game Screenshot](./img/matching-game.png) | ||
|
||
## Installation | ||
|
||
1. Clone the repository to your local machine: | ||
|
||
```bash | ||
git clone https://github.com/Qassab/Matching-Game.git |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="stylesheet" href="style.css"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Lato:wght@100;300;400;700;900&display=swap" | ||
rel="stylesheet" | ||
/> | ||
<link rel="stylesheet" href="style.css" /> | ||
<title>Matching Game</title> | ||
</head> | ||
<body> | ||
<h1>Matching Game</h1> | ||
</head> | ||
<body> | ||
<h1>Matching Game</h1> | ||
|
||
<div class="container"> | ||
<ul class="cards"> | ||
|
||
</ul> | ||
<button class="btn">Reset</button> | ||
<div class="message-container"> | ||
<h2 class="message">you win</h2> | ||
<button class="btn play-again ">play again</button> | ||
</div> | ||
<div class="timer">1:00</div> | ||
|
||
<ul class="cards"></ul> | ||
<button class="btn ">Reset</button> | ||
</div> | ||
<script src="main.js"></script> | ||
</body> | ||
</html> | ||
<script src="main.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.