forked from openfrontio/OpenFrontIO
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
365 lines (327 loc) · 11.4 KB
/
index.html
File metadata and controls
365 lines (327 loc) · 11.4 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
<!doctype html>
<html lang="en" class="h-full preload" translate="no">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
/>
<title data-i18n="main.title">OpenFront (ALPHA)</title>
<link rel="manifest" href="/manifest.json" />
<link rel="icon" type="image/x-icon" href="/images/Favicon.svg" />
<!-- Preload styles -->
<style>
.preload {
visibility: hidden;
opacity: 0;
transition: opacity 0.5s ease-out;
}
/* iOS safe area support */
body {
padding-top: env(safe-area-inset-top);
padding-right: env(safe-area-inset-right);
padding-bottom: env(safe-area-inset-bottom);
padding-left: env(safe-area-inset-left);
}
/* Ensure full viewport height on iOS */
html,
body {
height: 100%;
height: -webkit-fill-available;
min-height: 100%;
min-height: -webkit-fill-available;
}
</style>
<!-- SEO -->
<link rel="canonical" href="https://openfront.io/" />
<meta
name="description"
content="Conquer the world in this multiplayer battle royale! Expand your nation, eliminate opponents, and dominate the map in this fast-paced IO game."
/>
<!-- Open Graph -->
<meta property="og:url" content="https://openfront.io/" />
<meta property="og:title" content="OpenFront - Battle Royale" />
<meta
property="og:description"
content="Conquer the world in this multiplayer battle royale! Expand your nation, eliminate opponents, and dominate the map in this fast-paced IO game."
/>
<meta
property="og:image"
content="https://openfront.io/images/GameplayScreenshot.png"
/>
<meta property="og:type" content="game" />
<!-- Injected from Server env -->
<script>
window.GIT_COMMIT = <%- gitCommit %>;
window.INSTANCE_ID = <%- instanceId %>;
</script>
<!-- CrazyGames SDK -->
<script
src="https://sdk.crazygames.com/crazygames-sdk-v3.js"
async
></script>
<!-- Cloudflare Turnstile -->
<script
src="https://challenges.cloudflare.com/turnstile/v0/api.js"
async
defer
></script>
<!-- Publift/Fuse ads -->
<script
async
src="https://cdn.fuseplatform.net/publift/tags/2/4121/fuse.js"
></script>
<script>
window.googletag = window.googletag || { cmd: [] };
googletag.cmd.push(function () {
googletag.pubads().set("page_url", "http://openfront.io ");
});
</script>
<!-- Analytics -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=AW-16702609763"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "AW-16702609763");
</script>
<!-- Google tag (gtag.js) -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-WQGQQ8RDN4"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "G-WQGQQ8RDN4");
</script>
</head>
<body
class="h-full select-none font-sans min-h-screen bg-cover bg-center bg-fixed transition-opacity duration-300 ease-in-out flex flex-row overflow-hidden"
>
<div
class="fixed inset-0 w-full h-full -z-50 bg-cover bg-center bg-fixed pointer-events-none brightness-[0.5]"
style="
background-image: url("/images/EuropeBackgroundBlurred.webp");
"
></div>
<!-- LEFT SIDEBAR MENU -->
<div
id="mobile-menu-backdrop"
class="lg:!hidden [.in-game_&]:hidden hidden pointer-events-none [&.open]:block [&.open]:pointer-events-auto [&.open]:fixed [&.open]:inset-0 [&.open]:bg-black/60 [&.open]:z-[40000] transition-opacity"
role="presentation"
aria-hidden="true"
></div>
<mobile-nav-bar
id="sidebar-menu"
class="peer [.in-game_&]:hidden z-[40001] fixed left-0 top-0 h-full flex flex-col justify-start overflow-visible bg-black/60 backdrop-blur-md transition-transform duration-500 ease-out transform -translate-x-full w-[80%] [&.open]:translate-x-0 lg:hidden"
role="dialog"
data-i18n-aria-label="main.menu"
aria-hidden="true"
></mobile-nav-bar>
<!-- MAIN CONTENT AREA -->
<div
class="[.in-game_&]:hidden flex-1 relative overflow-hidden h-full transition-[margin] duration-500 ease-out will-change-[margin-left] flex flex-col"
>
<!-- Desktop Top Bar -->
<desktop-nav-bar></desktop-nav-bar>
<div
id="turnstile-container"
class="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[99999]"
></div>
<gutter-ads></gutter-ads>
<!-- Main container with responsive padding -->
<main-layout class="contents">
<play-page class="contents"></play-page>
<news-modal
id="page-news"
inline
class="hidden w-full h-full page-content"
></news-modal>
<single-player-modal
id="page-single-player"
inline
class="hidden w-full h-full page-content"
></single-player-modal>
<host-lobby-modal
id="page-host-lobby"
inline
class="hidden w-full h-full page-content"
></host-lobby-modal>
<join-private-lobby-modal
id="page-join-private-lobby"
inline
class="hidden w-full h-full page-content"
></join-private-lobby-modal>
<territory-patterns-modal
id="page-item-store"
inline
class="hidden w-full h-full page-content"
></territory-patterns-modal>
<matchmaking-modal
id="page-matchmaking"
inline
class="hidden w-full h-full page-content"
></matchmaking-modal>
<user-setting
id="page-settings"
inline
class="hidden w-full h-full page-content"
></user-setting>
<stats-modal
id="page-stats"
inline
class="hidden w-full h-full page-content"
></stats-modal>
<account-modal
id="page-account"
inline
class="hidden w-full h-full page-content"
></account-modal>
<help-modal
id="page-help"
inline
class="hidden w-full h-full page-content"
></help-modal>
<language-modal
id="page-language"
inline
class="hidden w-full h-full page-content"
></language-modal>
<flag-input-modal
id="flag-input-modal"
inline
class="hidden w-full h-full page-content"
></flag-input-modal>
</main-layout>
<!-- Desktop Footer -->
<page-footer></page-footer>
<!-- Global Modals -->
<territory-patterns-modal
id="territory-patterns-modal"
></territory-patterns-modal>
</div>
<!-- Game components -->
<div id="app"></div>
<div
class="left-0 bottom-0 sm:left-4 sm:bottom-4 w-full flex-col-reverse sm:flex-row z-50 md:w-[320px] fixed pointer-events-none"
>
<div
class="w-full md:w-2/3 md:fixed sm:right-0 md:bottom-0 md:flex flex-col items-end pointer-events-none"
>
<chat-display></chat-display>
<events-display></events-display>
</div>
<div>
<control-panel></control-panel>
</div>
</div>
<!-- Game modals and overlays -->
<emoji-table></emoji-table>
<build-menu></build-menu>
<win-modal></win-modal>
<game-starting-modal></game-starting-modal>
<unit-display></unit-display>
<div class="flex flex-col items-end fixed top-4 right-4 z-1000 gap-2">
<game-right-sidebar></game-right-sidebar>
<replay-panel></replay-panel>
</div>
<settings-modal></settings-modal>
<player-panel></player-panel>
<spawn-timer></spawn-timer>
<immunity-timer></immunity-timer>
<game-info-modal></game-info-modal>
<alert-frame></alert-frame>
<chat-modal></chat-modal>
<multi-tab-modal></multi-tab-modal>
<game-left-sidebar></game-left-sidebar>
<performance-overlay></performance-overlay>
<player-info-overlay></player-info-overlay>
<leader-board></leader-board>
<team-stats></team-stats>
<heads-up-message></heads-up-message>
<!-- Scripts -->
<script>
// Remove preload class after everything is loaded
window.addEventListener("load", function () {
requestAnimationFrame(() => {
document.documentElement.classList.remove("preload");
});
});
// Fallback: remove preload class after timeout in case DOMContentLoaded never fires
setTimeout(function () {
document.documentElement.classList.remove("preload");
}, 3000);
</script>
<script>
// Fallback sidebar toggle so hamburger works even if module bundle fails to load
window.__toggleSidebar = function (e) {
try {
const sidebar = document.getElementById("sidebar-menu");
const backdrop = document.getElementById("mobile-menu-backdrop");
if (!sidebar || !backdrop) return;
const isOpen = sidebar.classList.contains("open");
if (isOpen) {
sidebar.classList.remove("open");
backdrop.classList.remove("open");
document.documentElement.classList.remove("overflow-hidden");
sidebar.setAttribute("aria-hidden", "true");
sidebar.removeAttribute("aria-modal");
backdrop.setAttribute("aria-hidden", "true");
} else {
sidebar.classList.add("open");
backdrop.classList.add("open");
document.documentElement.classList.add("overflow-hidden");
sidebar.setAttribute("aria-hidden", "false");
sidebar.setAttribute("aria-modal", "true");
backdrop.setAttribute("aria-hidden", "false");
}
const hb = document.getElementById("hamburger-btn");
if (hb) hb.setAttribute("aria-expanded", (!isOpen).toString());
} catch (err) {
console.error("Toggle failed", err);
}
};
// Wire up the hamburger button inline
const hamburger = document.getElementById("hamburger-btn");
if (hamburger) {
hamburger.onclick = window.__toggleSidebar;
hamburger.setAttribute("aria-expanded", "false");
}
// Wire up backdrop click to close menu
const backdrop = document.getElementById("mobile-menu-backdrop");
if (backdrop) {
backdrop.onclick = function (e) {
const sidebar = document.getElementById("sidebar-menu");
if (sidebar && sidebar.classList.contains("open")) {
window.__toggleSidebar(e);
}
};
}
// Wire up Escape key to close menu
document.addEventListener("keydown", function (e) {
if (e.key === "Escape" || e.key === "Esc") {
const sidebar = document.getElementById("sidebar-menu");
if (sidebar && sidebar.classList.contains("open")) {
window.__toggleSidebar(e);
}
}
});
</script>
<!-- Analytics -->
<script
defer
src="https://static.cloudflareinsights.com/beacon.min.js"
data-cf-beacon='{"token": "03d93e6fefb349c28ee69b408fa25a13"}'
></script>
<script type="module" src="/src/client/Main.ts"></script>
</body>
</html>