This commit is contained in:
Ryan Barlow
2026-03-21 23:31:30 +00:00
parent e1a4c36ddc
commit 9da1e76fd3
4 changed files with 14 additions and 13 deletions
+1 -1
View File
@@ -277,7 +277,7 @@
>
<!-- Bottom HUD: contents on mobile, fixed on desktop -->
<div
class="contents sm:flex sm:fixed sm:bottom-0 sm:left-[calc(50%-250px)] sm:z-[200] sm:flex-col sm:pointer-events-none sm:w-[500px] min-[1200px]:mb-4"
class="contents sm:flex sm:fixed sm:bottom-0 sm:inset-x-0 sm:mx-auto sm:z-[200] sm:flex-col sm:pointer-events-none sm:w-[500px] min-[1200px]:mb-4"
data-draggable="bottom-hud"
style="padding-bottom: env(safe-area-inset-bottom)"
>
+11 -7
View File
@@ -148,7 +148,7 @@ export class DraggableController {
}
private handlePointerDown(e: PointerEvent): void {
if (this._locked) return;
if (this._locked || e.button !== 0) return;
const target = e.target as HTMLElement;
if (target.closest("button, input, select, textarea, a, [data-no-drag]")) {
return;
@@ -322,12 +322,16 @@ export class DraggableController {
}
private save(): void {
const data = {
locked: this._locked,
x: this._offsetX,
y: this._offsetY,
};
localStorage.setItem(this.storageKey, JSON.stringify(data));
try {
const data = {
locked: this._locked,
x: this._offsetX,
y: this._offsetY,
};
localStorage.setItem(this.storageKey, JSON.stringify(data));
} catch {
// Quota exceeded or storage unavailable — position won't persist
}
}
private load(): void {
+1 -4
View File
@@ -5,11 +5,8 @@ import { DraggableController } from "../DraggableController";
/**
* Non-wrapper element: place inside a panel and it renders a lock/reset
* toolbar on the right side. Drag behaviour is applied to the nearest
* toolbar on the outside edge. Drag behaviour is applied to the nearest
* ancestor with a matching `data-draggable` attribute.
*
* The toolbar is always visible so it contributes to the panel's bounding
* rect for collision detection.
*/
@customElement("draggable-panel")
export class DraggablePanel extends LitElement {
@@ -519,7 +519,7 @@ export class PlayerInfoOverlay extends LitElement implements Layer {
return html`
<div
class="fixed top-0 left-0 right-0 sm:left-[calc(50%-250px)] sm:right-auto z-[1001]"
class="fixed top-0 inset-x-0 sm:mx-auto sm:w-[500px] z-[1001]"
style="margin-top: ${this.barOffset}px;"
@click=${() => this.hide()}
@contextmenu=${(e: MouseEvent) => e.preventDefault()}