-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
85 lines (76 loc) · 2.5 KB
/
index.html
File metadata and controls
85 lines (76 loc) · 2.5 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
<html>
<head>
<title>Block Ninja</title>
<link rel="stylesheet" href="styles.css">
<!-- Farcaster Mini App metadata for rich embed -->
<meta name="fc:miniapp" content='{
"version": "next",
"imageUrl": "https://blocks-ninja.vercel.app/splash.jpg",
"button": {
"title": "Play Block Ninja X",
"action": {
"type": "launch_miniapp",
"name": "Block Ninja X",
"url": "https://blocks-ninja.vercel.app",
"splashImageUrl": "https://blocks-ninja.vercel.app/splash.jpg",
"splashBackgroundColor": "#000000"
}
}
}' />
</head>
<body>
<!-- Game canvas -->
<canvas id="c"></canvas>
<!-- Gameplay HUD -->
<div class="hud">
<div class="hud__score">
<div class="score-lbl"></div>
<div class="cube-count-lbl"></div>
</div>
<div class="pause-btn">
<div></div>
</div>
<div class="slowmo">
<div class="slowmo__bar"></div>
</div>
</div>
<!-- Menu System -->
<div class="menus">
<div class="menu menu--main">
<h1>Block Ninja X</h1>
<button type="button" class="play-normal-btn">PLAY GAME</button>
<button type="button" class="play-casual-btn">CASUAL MODE</button>
<div class="credits">
Block Ninja
</div>
</div>
<div class="menu menu--pause">
<h1>Paused</h1>
<button type="button" class="resume-btn">RESUME GAME</button>
<button type="button" class="menu-btn--pause">MAIN MENU</button>
</div>
<div class="menu menu--score">
<h1>Game Over</h1>
<h2>Your Score:</h2>
<div class="final-score-lbl"></div>
<div class="high-score-lbl"></div>
<button type="button" class="play-again-btn">PLAY AGAIN</button>
<button type="button" class="menu-btn--score">MAIN MENU</button>
</div>
</div>
<script src="index.js"></script>
<!-- Farcaster Mini App SDK (ESM from CDN) -->
<script type="module">
import { sdk } from "https://cdn.jsdelivr.net/npm/@farcaster/miniapp-sdk/+esm";
window.addEventListener("DOMContentLoaded", async () => {
try {
await sdk.actions.ready(); // Tell Base app your game is ready
console.log("Farcaster Mini App ready");
} catch (err) {
// Game still works fine outside Farcaster
console.warn("Not running inside Farcaster Mini App environment:", err);
}
});
</script>
</body>
</html>