Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
114 lines (103 loc) · 5.77 KB
/
Copy pathindex.html
File metadata and controls
114 lines (103 loc) · 5.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A memory card matching game with multiple difficulty levels and themes">
<title>Memory Card Game - Accessible Card Matching Game</title>
<link rel="stylesheet" href="style.css">
<!-- Favicon -->
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='0.9em' font-size='90'>🎮</text></svg>" />
</head>
<body>
<a href="#gameBoard" class="skip-link">Skip to game board</a>
<main class="container" role="main">
<h1 id="game-title">🎮 Memory Card Game</h1>
<section class="controls" aria-labelledby="controls-heading">
<h2 id="controls-heading" class="visually-hidden">Game Controls</h2>
<div class="difficulty" role="group" aria-labelledby="difficulty-label">
<label id="difficulty-label">Difficulty:</label>
<button class="btn-difficulty active" data-level="easy" aria-pressed="true">Easy (4x4)</button>
<button class="btn-difficulty" data-level="medium" aria-pressed="false">Medium (6x6)</button>
<button class="btn-difficulty" data-level="hard" aria-pressed="false">Hard (8x8)</button>
</div>
<div class="theme-selector">
<label for="themeSelect">Theme:</label>
<div class="theme-dropdown-wrapper">
<select id="themeSelect" class="theme-dropdown" aria-label="Select game theme">
<option value="default">🎮 Game Icons</option>
<option value="tropical">🌴 Tropical Paradise</option>
<option value="beach">🏖️ Beach Vibes</option>
<option value="sunset">🌅 Sunset Dreams</option>
</select>
<span class="theme-note" aria-hidden="true">(Starts new game)</span>
</div>
</div>
<div class="control-buttons" role="group" aria-label="Game action buttons">
<button id="soundToggle" class="btn-sound" aria-pressed="true" aria-label="Toggle sound effects">🔊 Sound On</button>
<button id="resetBtn" class="btn-reset" aria-label="Start a new game">New Game</button>
<button id="resetTotalMovesBtn" class="btn-reset-total" aria-label="Reset total moves across all tabs">Reset Total Moves</button>
</div>
</section>
<section class="stats" aria-labelledby="stats-heading" aria-live="polite">
<h2 id="stats-heading" class="visually-hidden">Game Statistics</h2>
<div class="stat-item">
<span class="label">Total Moves (All Tabs):</span>
<span id="totalMoves" aria-label="Total moves across all tabs">0</span>
</div>
<div class="stat-item">
<span class="label">Moves:</span>
<span id="moves" aria-label="Number of moves">0</span>
</div>
<div class="stat-item">
<span class="label">Time:</span>
<span id="timer" aria-label="Elapsed time">00:00</span>
</div>
<div class="stat-item">
<span class="label">Pairs:</span>
<span id="pairs" aria-label="Matched pairs">0/18</span>
</div>
</section>
<div id="gameBoard"
class="game-board"
role="grid"
aria-labelledby="game-title"
aria-describedby="game-instructions">
</div>
<div id="game-instructions" class="visually-hidden">
Memory card matching game. Use mouse or keyboard to flip cards and find matching pairs.
Press Enter or Space to flip a card when focused.
</div>
<!-- Screen reader announcements -->
<div id="sr-announcements" class="visually-hidden" role="status" aria-live="polite" aria-atomic="true"></div>
<!-- This is the SINGLE card template that will be duplicated via JavaScript -->
<div id="cardTemplate" class="card" style="display: none;" role="gridcell">
<button class="card-inner" type="button" aria-label="Card">
<div class="card-front" aria-hidden="true">?</div>
<div class="card-back" aria-hidden="true"></div>
</button>
</div>
<div id="gameOverModal"
class="modal"
role="dialog"
aria-labelledby="modal-title"
aria-describedby="modal-description"
aria-modal="true">
<div class="modal-content">
<h2 id="modal-title">🎉 Congratulations!</h2>
<p id="modal-description">You've matched all pairs!</p>
<div class="final-stats" aria-label="Final game statistics">
<p><strong>Moves:</strong> <span id="finalMoves" aria-label="Total moves">0</span></p>
<p><strong>Time:</strong> <span id="finalTime" aria-label="Total time">00:00</span></p>
</div>
<button id="playAgainBtn" class="btn-play-again" aria-label="Start a new game">Play Again</button>
</div>
</div>
</main>
<footer class="attribution" role="contentinfo">
Coded by <a href="https://LeoLinkDev.Github.io/HTML5-Profile/" target="_blank" rel="noopener noreferrer">Leo Gurdian</a> using HTML, CSS, JavaScript. January 2026.<br>
Tropical theme pictures by <a href="https://www.pexels.com/" target="_blank" rel="noopener noreferrer">Pexels</a>.
</footer>
<script src="script.js"></script>
</body>
</html>