Skip to content

Commit dfeffca

Browse files
committed
Merge branch 'main' into amazon-river-map
# Conflicts: # src/client/GameInfoModal.ts # src/client/PublicLobby.ts
2 parents c733171 + effce3d commit dfeffca

59 files changed

Lines changed: 1166 additions & 1298 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

index.html

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,22 @@
115115
}
116116
</style>
117117

118-
<!-- Immediate execution to prevent FOUC -->
118+
<!-- Immediate execution to prevent FOUC + apply persisted dark mode -->
119119
<script>
120-
document.documentElement.className = "preload";
120+
(function () {
121+
const root = document.documentElement;
122+
root.classList.add("preload");
123+
try {
124+
const storedDarkMode = localStorage.getItem("settings.darkMode");
125+
if (storedDarkMode === "true") {
126+
root.classList.add("dark");
127+
} else if (storedDarkMode === "false") {
128+
root.classList.remove("dark");
129+
}
130+
} catch (error) {
131+
// Ignore storage access errors.
132+
}
133+
})();
121134
</script>
122135

123136
<!-- CrazyGames SDK -->
@@ -178,7 +191,7 @@
178191
</head>
179192

180193
<body
181-
class="h-full select-none font-sans min-h-screen bg-opacity-0 bg-cover bg-center bg-fixed transition-opacity duration-300 ease-in-out flex flex-col"
194+
class="h-full select-none font-sans min-h-screen bg-black/0 bg-cover bg-center bg-fixed transition-opacity duration-300 ease-in-out flex flex-col"
182195
>
183196
<header class="l-header">
184197
<div class="l-header__content">
@@ -246,7 +259,7 @@
246259
<div class="bg-image"></div>
247260
<div
248261
id="turnstile-container"
249-
class="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[99999]"
262+
class="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-99999"
250263
></div>
251264
<gutter-ads></gutter-ads>
252265

@@ -260,7 +273,7 @@
260273
<territory-patterns-modal class="w-[20%] md:w-[15%]">
261274
<button
262275
id="territory-patterns-input-preview-button"
263-
class="w-full border p-[4px] rounded-lg flex cursor-pointer border-black/30 dark:border-gray-300/60 bg-white/70 dark:bg-[rgba(55,65,81,0.7)] justify-center"
276+
class="w-full border p-1 rounded-lg flex cursor-pointer border-black/30 dark:border-gray-300/60 bg-white/70 dark:bg-[rgba(55,65,81,0.7)] justify-center"
264277
title="Pick a pattern!"
265278
></button>
266279
</territory-patterns-modal>
@@ -318,14 +331,10 @@
318331
<button
319332
id="settings-button"
320333
title="Settings"
321-
class="fixed bottom-4 right-4 z-50 rounded-full p-2 shadow-lg transition-colors duration-300 flex items-center justify-center"
322-
style="width: 60px; height: 60px; background-color: #0075ff"
334+
class="fixed bottom-4 right-4 z-50 rounded-full p-2 shadow-lg transition-colors duration-300 flex items-center justify-center size-15 bg-(--primaryColor)"
335+
style="--primaryColor: #0075ff"
323336
>
324-
<img
325-
src="/images/SettingIconWhite.svg"
326-
alt="Settings"
327-
style="width: 52px; height: 52px"
328-
/>
337+
<img src="/images/SettingIconWhite.svg" alt="Settings" class="size-18" />
329338
</button>
330339

331340
<!-- Game components -->
@@ -334,22 +343,20 @@
334343
</div>
335344
<div id="app"></div>
336345
<div id="radialMenu" class="radial-menu"></div>
337-
<div class="flex gap-2 fixed right-[10px] top-[10px] z-50 flex-col">
346+
<div class="flex gap-2 fixed right-2.5 top-2.5 z-50 flex-col">
338347
<player-info-overlay></player-info-overlay>
339348
</div>
340349
<div
341-
class="fixed bottom-[30px] sm:bottom-auto sm:top-[20px] z-50 mx-auto max-w-max inset-x-0 items-center"
350+
class="fixed bottom-7.5 sm:bottom-auto sm:top-5 z-50 mx-auto max-w-max inset-x-0 items-center"
342351
>
343352
<heads-up-message></heads-up-message>
344353
</div>
345354

346355
<div
347-
class="left-0 bottom-0 sm:left-4 sm:bottom-4 w-full flex-col-reverse sm:flex-row z-50 md:w-[320px]"
348-
style="position: fixed; pointer-events: none"
356+
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"
349357
>
350358
<div
351-
class="w-full md:w-2/3 md:fixed sm:right-0 md:bottom-0 md:flex flex-col items-end"
352-
style="pointer-events: none"
359+
class="w-full md:w-2/3 md:fixed sm:right-0 md:bottom-0 md:flex flex-col items-end pointer-events-none"
353360
>
354361
<chat-display></chat-display>
355362
<events-display></events-display>
@@ -361,13 +368,13 @@
361368

362369
<!-- Footer section -->
363370
<footer
364-
class="flex justify-center px-3 py-3 md:px-6 md:py-3 bg-[var(--boxBackgroundColor)] backdrop-blur-sm"
371+
class="flex justify-center px-3 py-3 md:px-6 md:py-3 bg-(--boxBackgroundColor) backdrop-blur-xs"
365372
>
366373
<div
367-
class="flex flex-col md:flex-row flex-nowrap justify-between items-center gap-4 md:gap-0 w-full max-w-[860px] flex-1"
374+
class="flex flex-col md:flex-row flex-nowrap justify-between items-center gap-4 md:gap-0 w-full max-w-215 flex-1"
368375
>
369376
<div
370-
class="flex flex-col sm:flex-row gap-4 sm:gap-5 text-white/70 justify-center md:justify-start flex-shrink-0"
377+
class="flex flex-col sm:flex-row gap-4 sm:gap-5 text-white/70 justify-center md:justify-start shrink-0"
371378
>
372379
<a
373380
href="https://openfront.wiki/Main_Page"
@@ -392,7 +399,7 @@
392399
<span data-i18n="main.join_discord"> Discord </span>
393400
</a>
394401
</div>
395-
<div class="flex justify-center text-white/70 flex-shrink-0">
402+
<div class="flex justify-center text-white/70 shrink-0">
396403
<a
397404
href="https://github.com/openfrontio/OpenFrontIO"
398405
class="text-white/70 hover:text-white transition-colors duration-300 ease-in-out inline-flex items-center gap-2 whitespace-nowrap"
@@ -409,7 +416,7 @@
409416
</a>
410417
</div>
411418
<div
412-
class="flex flex-col sm:flex-row gap-4 sm:gap-4 text-white/70 justify-center md:justify-end flex-shrink-0"
419+
class="flex flex-col sm:flex-row gap-4 sm:gap-4 text-white/70 justify-center md:justify-end shrink-0"
413420
>
414421
<a
415422
href="/privacy-policy.html"
@@ -441,7 +448,7 @@
441448
<game-starting-modal></game-starting-modal>
442449
<game-top-bar></game-top-bar>
443450
<unit-display></unit-display>
444-
<div class="flex flex-col items-end fixed top-4 right-4 z-[1000] gap-2">
451+
<div class="flex flex-col items-end fixed top-4 right-4 z-1000 gap-2">
445452
<game-right-sidebar></game-right-sidebar>
446453
<replay-panel></replay-panel>
447454
</div>
@@ -463,16 +470,16 @@
463470
<performance-overlay></performance-overlay>
464471
<div
465472
id="language-modal"
466-
class="fixed inset-0 bg-black bg-opacity-50 z-50 hidden flex justify-center items-center"
473+
class="fixed inset-0 bg-black/50 z-50 hidden flex justify-center items-center"
467474
>
468475
<div class="bg-white rounded-lg shadow-lg p-6 w-96 max-w-full">
469476
<h2 class="text-xl font-semibold mb-4">Select Language</h2>
470477
<div
471478
id="language-list"
472-
class="space-y-2 max-h-80 overflow-y-auto"
479+
class="flex flex-col gap-2 max-h-80 overflow-y-auto"
473480
></div>
474481
<button
475-
class="mt-4 w-full bg-blue-600 hover:bg-blue-700 text-white py-2 px-4 rounded"
482+
class="mt-4 w-full bg-blue-600 hover:bg-blue-700 text-white py-2 px-4 rounded-sm"
476483
onclick="
477484
document.getElementById('language-modal').classList.add('hidden')
478485
"

0 commit comments

Comments
 (0)