-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
78 lines (67 loc) · 3 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dodge the Falling Objects Game</title>
<link rel="stylesheet" href="style.css">
<link rel="icon" href="assets/icon.png" type="image/x-icon">
<meta property="og:title" content="Dodge the Falling Objects">
<meta property="og:description"
content="Can you dodge all the falling objects? Test your reflexes in this exciting game!">
<meta property="og:image" content="assets/thumbnail.webp">
<meta property="og:url" content="https://yourgameurl.com">
</head>
<body>
<noscript>
<p style="color: white; text-align: center; background: red; padding: 10px;">
JavaScript is required to play this game. Please enable JavaScript in your browser settings.
</p>
</noscript>
<header>
<h1>Dodge the Falling Objects</h1>
</header>
<section id="pre-game-popup" aria-label="Game Welcome Popup">
<article id="popup-content">
<h1>Welcome to the Game of Uneasiness!</h1>
<h2>Dodge the Falling Objects</h2>
<p>Welcome to the Dodge the Falling Objects Game!</p>
<p>Instructions:</p>
<ul>
<li>Move left or right to avoid the falling objects.</li>
<li>If you touch any falling object, it's Game Over!</li>
<li>Use arrow keys (or swipe left/right on mobile) to move.</li>
</ul>
<p>Created by <a href="https://github.com/A4rmin" target="_blank">A4RMIN</a></p>
<button id="start-game-btn" aria-label="Start the game">Start Game</button>
</article>
</section>
<main id="game-container" aria-label="Game Main Container">
<h2>Dodge the Falling Objects</h2>
<output id="score" aria-live="polite" aria-label="Current Score">Score: 0</output>
<output id="countdown" class="hidden" aria-live="assertive" aria-label="Countdown Timer"></output>
<section id="game-area" aria-label="Game Play Area">
<div id="player" aria-label="Player"></div>
</section>
<section id="game-over" class="hidden" aria-live="assertive" aria-label="Game Over Message">
Game Over!
<button id="reset-button" aria-label="Restart the game">Restart</button>
</section>
<div id="pause-container">
<button id="pause-button" aria-label="Pause or Resume the game">Pause</button>
</div>
</main>
<script>
// Fallback for unhandled JS errors
window.addEventListener("error", (event) => {
alert("An unexpected error occurred. Please refresh the page.");
console.error(event.error);
});
window.addEventListener("unhandledrejection", (event) => {
alert("An unexpected error occurred. Please try again later.");
console.error(event.reason);
});
</script>
<script src="script.js"></script>
</body>
</html>