mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-25 18:02:43 +00:00
fe89713f46
## Description: **Fix UI spacing and border radius across multiple screen sizes** - Fix events panel missing right margin on wide screens - Fix incorrect border radius on events panel and control panel at various breakpoints - Remove border radius from attack/boat elements on small screens - Show running attacks above the events panel on mobile - Add left/right margin to the homepage on tablet-sized screens - Adjust lobby card spacing on mobile Previous <img width="410" height="124" alt="Screenshot 2026-03-07 203244" src="https://github.com/user-attachments/assets/d3feb9fe-97a3-44d0-9aba-db04062f9911" /> After <img width="417" height="117" alt="Screenshot 2026-03-07 203255" src="https://github.com/user-attachments/assets/31b88145-8e92-40db-b9cc-f2a00754f900" /> Previous <img width="828" height="123" alt="Screenshot 2026-03-07 203320" src="https://github.com/user-attachments/assets/4e162cf5-7d82-4e87-9dd9-9ab1d3782f23" /> After <img width="820" height="126" alt="Screenshot 2026-03-07 203337" src="https://github.com/user-attachments/assets/a25121aa-603c-41c7-b335-406a38a62cf9" /> Previous <img width="961" height="102" alt="Screenshot 2026-03-07 203353" src="https://github.com/user-attachments/assets/22ba9770-88a3-4f49-aeb6-6d875006946b" /> After <img width="954" height="78" alt="Screenshot 2026-03-07 203403" src="https://github.com/user-attachments/assets/0d4e3b19-de1c-4211-b1e3-bd935025de33" /> Previous <img width="557" height="154" alt="Screenshot 2026-03-07 203450" src="https://github.com/user-attachments/assets/2cc8a747-3e68-4449-9746-62fcbca76510" /> After <img width="602" height="146" alt="Screenshot 2026-03-07 203421" src="https://github.com/user-attachments/assets/bae399a3-8969-4b7a-a77c-c73c4f775ca0" /> Previous <img width="727" height="889" alt="Screenshot 2026-03-07 204707" src="https://github.com/user-attachments/assets/bc53febf-9beb-4195-a994-858333f30f24" /> After <img width="725" height="799" alt="Screenshot 2026-03-07 204714" src="https://github.com/user-attachments/assets/9d600212-73ae-4566-b1c5-df83e8edb8e9" /> Previous <img width="658" height="890" alt="Screenshot 2026-03-07 204633" src="https://github.com/user-attachments/assets/6c935fcc-3e46-4706-8c9a-9840cc469b60" /> After <img width="656" height="798" alt="Screenshot 2026-03-07 204639" src="https://github.com/user-attachments/assets/8e490f29-cf50-4c1f-a97e-f550fd4f9a13" /> ## Please complete the following: - [X] I have added screenshots for all UI updates - [X] I process any text displayed to the user through translateText() and I've added it to the en.json file - [X] I have added relevant tests to the test directory - [X] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: FloPinguin
147 lines
6.2 KiB
TypeScript
147 lines
6.2 KiB
TypeScript
import { LitElement, html } from "lit";
|
|
import { customElement } from "lit/decorators.js";
|
|
|
|
@customElement("play-page")
|
|
export class PlayPage extends LitElement {
|
|
createRenderRoot() {
|
|
return this;
|
|
}
|
|
|
|
render() {
|
|
return html`
|
|
<div
|
|
id="page-play"
|
|
class="flex flex-col gap-2 w-full px-0 lg:px-4 lg:my-auto min-h-0"
|
|
>
|
|
<token-login class="absolute"></token-login>
|
|
|
|
<!-- Mobile: Fixed top bar -->
|
|
<div
|
|
class="lg:hidden fixed left-0 right-0 top-0 z-40 pt-[env(safe-area-inset-top)] bg-[color-mix(in_oklab,var(--frenchBlue)_75%,black)] border-b border-white/10"
|
|
>
|
|
<div
|
|
class="grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center h-14 px-2 gap-2"
|
|
>
|
|
<button
|
|
id="hamburger-btn"
|
|
class="col-start-1 justify-self-start h-10 shrink-0 aspect-[4/3] flex text-white/90 rounded-md items-center justify-center transition-colors"
|
|
data-i18n-aria-label="main.menu"
|
|
aria-expanded="false"
|
|
aria-controls="sidebar-menu"
|
|
aria-haspopup="dialog"
|
|
data-i18n-title="main.menu"
|
|
>
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
fill="none"
|
|
viewBox="0 0 24 24"
|
|
stroke-width="1.5"
|
|
stroke="currentColor"
|
|
class="size-8"
|
|
>
|
|
<path
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"
|
|
/>
|
|
</svg>
|
|
</button>
|
|
|
|
<div
|
|
class="col-start-2 flex items-center justify-center text-[#2563eb] min-w-0"
|
|
>
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
viewBox="0 0 1364 259"
|
|
fill="currentColor"
|
|
class="h-6 w-auto drop-shadow-[0_0_10px_rgba(37,99,235,0.3)] shrink-0"
|
|
>
|
|
<path
|
|
d="M0,174V51h15.24v-17.14h16.81v-16.98h16.96V0h1266v17.23h17.13v16.81h16.98v16.96h14.88v123h-15.13v17.08h-17.08v17.08h-16.9v17.04H324.9v16.86h-16.9v16.95h-102v-17.12h-17.07v-17.05H48.73v-17.05h-16.89v-16.89H14.94v-16.89H0ZM1297.95,17.35H65.9v16.7h-17.08v17.08h-14.5v123.08h14.85v16.9h17.08v17.08h139.9v17.08h17.08v16.36h67.9v-16.72h17.08v-17.07h989.88v-17.07h17.08v-16.9h14.44V50.8h-14.75v-17.08h-16.9v-16.37Z"
|
|
/>
|
|
<path
|
|
d="M189.1,154.78v17.07h-16.9v16.75h-51.07v-16.42h-16.9v-17.07h-16.97v-84.88h16.63v-17.07h16.9v-16.84h51.07v16.5h17.07v17.07h16.7v84.89h-16.54ZM137.87,53.1v17.15h-16.6v84.86h16.97v16.61h16.89v-16.97h16.6v-84.86h-16.97v-16.79h-16.89Z"
|
|
/>
|
|
<path
|
|
d="M273.91,104.06v-16.73h50.92v16.45h16.85v68.05h-16.44v17.06h-50.96v16.88h16.4v16.96h-67.28v-16.61h16.33v-101.86h-16.38v-16.98h33.4v16.63c6.12,0,11.72,0,17.31,0,0,22.56,0,45.13,0,67.75h33.59v-67.61h-33.73Z"
|
|
/>
|
|
<path
|
|
d="M631.12,188.64v-16.36h16.53V53.2h-16.25v-16.86h118.33v33.29h-16.65v-16.36h-50.72v50.44h33.36v-16.35h16.99v50.25h-16.6v-16.33h-33.73v50.65h16.37v16.72h-67.63Z"
|
|
/>
|
|
<path
|
|
d="M596.78,103.8v84.94h-33.54v-84.39h-34.03v84.25h-33.85v-101.29h84.5v16.49h16.93Z"
|
|
/>
|
|
<path
|
|
d="M1107.12,188.71v-84.34h-34.03v84.37h-33.7v-101.41h84.42v16.41h16.86v84.96h-33.54Z"
|
|
/>
|
|
<path
|
|
d="M988.1,171.78v16.87h-67.88v-16.38h-16.87v-68.06h16.38v-16.87h68.06v16.38h16.87v68.06h-16.55ZM970.78,104.35h-33.39v67.38h33.39v-67.38Z"
|
|
/>
|
|
<path
|
|
d="M460.77,155.38v16.49h-16.58v16.83h-68.05v-16.5h-16.83v-68.05h16.49v-16.83h68.05v16.49h16.83v34.06h-67.31v33.82h33.47v-16.31h33.92ZM393.39,104.18v16.56h33.3v-16.56h-33.3Z"
|
|
/>
|
|
<path
|
|
d="M1209.13,172h-16.9v-67.9h-16.96v-16.9h16.68v-17.08h16.9v-16.82h16.9v33.58h50.98v16.91h-50.4v67.96h16.48v-16.43h50.95v16.54h-16.55v16.76h-68.08v-16.6Z"
|
|
/>
|
|
<path
|
|
d="M834.91,120.94v16.96h-16.65v33.88h16.41v16.96h-67.29v-16.63h16.34v-67.87h-16.4v-16.97h50.42v33.81h17.3l-.14-.14Z"
|
|
/>
|
|
<path
|
|
d="M835.05,121.08v-33.75h33.76v16.43h16.85v33.96h-33.43v-16.79c-6.13,0-11.73,0-17.32,0,0,0,.14.14.14.14Z"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
|
|
<div
|
|
aria-hidden="true"
|
|
class="col-start-3 justify-self-end h-10 shrink-0 aspect-[4/3]"
|
|
></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div
|
|
class="w-full pb-4 lg:pb-0 flex flex-col gap-4 sm:-mx-4 sm:w-[calc(100%+2rem)] lg:mx-0 lg:w-full lg:grid lg:grid-cols-[2fr_1fr] lg:gap-4"
|
|
>
|
|
<!-- Mobile: spacer for fixed top bar -->
|
|
<div
|
|
class="lg:hidden h-[calc(env(safe-area-inset-top)+56px)] lg:col-span-2 -mb-4"
|
|
></div>
|
|
|
|
<!-- Username: left col -->
|
|
<div
|
|
class="px-2 py-2 bg-[color-mix(in_oklab,var(--frenchBlue)_75%,black)] border-y border-white/10 overflow-visible lg:flex lg:items-center lg:gap-x-2 lg:h-[60px] lg:p-3 lg:relative lg:z-20 lg:border-y-0 lg:rounded-xl"
|
|
>
|
|
<div class="flex items-center gap-2 min-w-0 w-full">
|
|
<username-input
|
|
class="flex-1 min-w-0 h-10 lg:h-[50px]"
|
|
></username-input>
|
|
<pattern-input
|
|
id="pattern-input-mobile"
|
|
show-select-label
|
|
adaptive-size
|
|
class="shrink-0 lg:hidden"
|
|
></pattern-input>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Skin + flag: right col -->
|
|
<div class="hidden lg:flex h-[60px] gap-2">
|
|
<pattern-input
|
|
id="pattern-input-desktop"
|
|
show-select-label
|
|
class="flex-1 h-full"
|
|
></pattern-input>
|
|
<flag-input
|
|
id="flag-input-desktop"
|
|
show-select-label
|
|
class="flex-1 h-full"
|
|
></flag-input>
|
|
</div>
|
|
</div>
|
|
|
|
<game-mode-selector></game-mode-selector>
|
|
</div>
|
|
`;
|
|
}
|
|
}
|