Skip to content

Commit b152214

Browse files
committed
Init new MemoryGame-JS
0 parents  commit b152214

7 files changed

Lines changed: 703 additions & 0 deletions

File tree

‎assets/sound/cardfail.mp3‎

12.2 KB
Binary file not shown.

‎assets/sound/cardflip.mp3‎

4.08 KB
Binary file not shown.

‎assets/sound/cardmatch.mp3‎

28.6 KB
Binary file not shown.

‎assets/sound/congrats.mp3‎

23.7 KB
Binary file not shown.

‎index.html‎

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Memory Card Game</title>
7+
<link rel="stylesheet" href="style.css">
8+
</head>
9+
<body>
10+
<div class="container">
11+
<h1>🎮 Memory Card Game</h1>
12+
13+
<div class="controls">
14+
<div class="difficulty">
15+
<label>Difficulty:</label>
16+
<button class="btn-difficulty" data-level="easy">Easy (4x4)</button>
17+
<button class="btn-difficulty active" data-level="medium">Medium (6x6)</button>
18+
<button class="btn-difficulty" data-level="hard">Hard (8x8)</button>
19+
</div>
20+
<button id="resetBtn" class="btn-reset">New Game</button>
21+
</div>
22+
23+
<div class="stats">
24+
<div class="stat-item">
25+
<span class="label">Moves:</span>
26+
<span id="moves">0</span>
27+
</div>
28+
<div class="stat-item">
29+
<span class="label">Time:</span>
30+
<span id="timer">00:00</span>
31+
</div>
32+
<div class="stat-item">
33+
<span class="label">Pairs:</span>
34+
<span id="pairs">0/18</span>
35+
</div>
36+
</div>
37+
38+
<div id="gameBoard" class="game-board"></div>
39+
40+
<!-- This is the SINGLE card template that will be duplicated via JavaScript -->
41+
<div id="cardTemplate" class="card" style="display: none;">
42+
<div class="card-inner">
43+
<div class="card-front">?</div>
44+
<div class="card-back"></div>
45+
</div>
46+
</div>
47+
</div>
48+
49+
<div id="gameOverModal" class="modal">
50+
<div class="modal-content">
51+
<h2>🎉 Congratulations!</h2>
52+
<p>You've matched all pairs!</p>
53+
<p class="final-stats">
54+
<strong>Moves:</strong> <span id="finalMoves"></span><br>
55+
<strong>Time:</strong> <span id="finalTime"></span>
56+
</p>
57+
<button id="playAgainBtn" class="btn-play-again">Play Again</button>
58+
</div>
59+
</div>
60+
61+
<script src="script.js"></script>
62+
</body>
63+
</html>

0 commit comments

Comments
 (0)