From 3a481d3d16979fe4bcc956ad3f35a78f93214736 Mon Sep 17 00:00:00 2001 From: Demonessica <37988730+Demonessica@users.noreply.github.com> Date: Tue, 27 May 2025 20:29:52 -0700 Subject: [PATCH] Main menu UI cleanup (#857) ## Description: - Fixes right side of the username box not being aligned with the rest of the menu by fully hiding the news button - Styled news button to match flag button (although a style more like the secondary buttons would be better IMO, this is more of a temp fix) - Invalid username popup no longer vertically shifts the rest of the menu ![image](https://github.com/user-attachments/assets/451d0184-3f0f-44af-9b2c-a93f9dc38e49) I uhhh kinda forgot how branches work and ended up pushing some changes to the public lobby button to the same branch: ![image](https://github.com/user-attachments/assets/cee68ac3-361a-4185-a5c5-70602dbbb040) ![image](https://github.com/user-attachments/assets/fb9067e7-6e28-464e-b50e-dcd2ba5afdc3) ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: Demonessica --------- Co-authored-by: evanpelle --- src/client/PublicLobby.ts | 65 +++++++++++++++-------------- src/client/UsernameInput.ts | 2 +- src/client/components/NewsButton.ts | 47 +++++---------------- src/client/index.html | 11 +++-- 4 files changed, 54 insertions(+), 71 deletions(-) diff --git a/src/client/PublicLobby.ts b/src/client/PublicLobby.ts index 1a59f77ea..ee3069504 100644 --- a/src/client/PublicLobby.ts +++ b/src/client/PublicLobby.ts @@ -100,47 +100,50 @@ export class PublicLobby extends LitElement { diff --git a/src/client/UsernameInput.ts b/src/client/UsernameInput.ts index 39b94d73d..1f699da06 100644 --- a/src/client/UsernameInput.ts +++ b/src/client/UsernameInput.ts @@ -47,7 +47,7 @@ export class UsernameInput extends LitElement { /> ${this.validationError ? html`
${this.validationError}
` diff --git a/src/client/components/NewsButton.ts b/src/client/components/NewsButton.ts index 2fda8e1ac..52ecf5479 100644 --- a/src/client/components/NewsButton.ts +++ b/src/client/components/NewsButton.ts @@ -1,4 +1,4 @@ -import { LitElement, css, html } from "lit"; +import { LitElement, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import megaphone from "../../../resources/images/Megaphone.svg"; import { NewsModal } from "../NewsModal"; @@ -9,38 +9,6 @@ export class NewsButton extends LitElement { @property({ type: Boolean }) hidden = false; - static styles = css` - .news-button { - opacity: 0.75; - transition: opacity 0.2s ease; - width: 40px; - height: 40px; - display: flex; - align-items: center; - justify-content: center; - padding: 0; - margin: 0; - border: none; - background: none; - cursor: pointer; - } - - .news-button:hover { - opacity: 1; - } - - .news-button img { - width: 24px; - height: 24px; - display: block; - margin-left: 12px; - } - - .hidden { - display: none !important; - } - `; - private handleClick() { const newsModal = document.querySelector("news-modal") as NewsModal; if (newsModal) { @@ -50,9 +18,16 @@ export class NewsButton extends LitElement { render() { return html` -
-
`; diff --git a/src/client/index.html b/src/client/index.html index 35454680e..5d1985adb 100644 --- a/src/client/index.html +++ b/src/client/index.html @@ -99,6 +99,11 @@ display: none; } } + + /* display:none if child has class parent-hidden since we can't use shadow DOM in Lit due to Tailwind */ + *:has(> .parent-hidden) { + display: none; + } @@ -223,12 +228,12 @@
- - + +
- +