tweak new UI

This commit is contained in:
Brian Beck 2026-03-12 17:31:10 -07:00
parent fecf646d90
commit 6acccfa2a8
39 changed files with 106 additions and 71 deletions

View file

@ -27,6 +27,8 @@
font-size: 22px;
padding-top: 8px;
padding-bottom: 8px;
background: rgba(27, 79, 135, 0.7);
box-shadow: inset 0 0 10px rgba(4, 40, 71, 0.5);
}
.ButtonGroup .IconButton svg {
@ -34,7 +36,14 @@
}
.ButtonGroup .IconButton[data-active="true"] {
background: rgb(5, 114, 177);
background: rgba(0, 101, 203, 0.8);
box-shadow:
inset 0 2px 3px rgba(8, 189, 255, 0.5),
inset 0 -2px 6px rgba(0, 18, 40, 0.5);
}
.ButtonGroup .IconButton[data-active="true"] svg {
opacity: 1;
}
.ButtonGroup .IconButton:not(:first-child) {
@ -159,13 +168,10 @@
font-size: 18px;
font-weight: 500;
padding: 4px 8px;
border-top: 1px solid rgba(255, 255, 255, 0.3);
border-left: 1px solid rgba(255, 255, 255, 0.3);
border-right: 1px solid rgba(200, 200, 200, 0.3);
border-bottom: 1px solid rgba(200, 200, 200, 0.3);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
border-radius: 5px;
background: rgba(3, 82, 147, 0.6);
background: rgba(0, 98, 179, 0.8);
border: 1px solid rgba(255, 255, 255, 0.4);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
color: #fff;
cursor: pointer;
transform: translate(0, 0);
@ -175,9 +181,9 @@
}
.IconButton svg {
opacity: 0.8;
flex: 0 0 auto;
pointer-events: none;
opacity: 0.6;
transition: opacity 0.2s;
}
@ -187,11 +193,23 @@
}
@media (hover: hover) {
.IconButton {
border-top: 1px solid rgba(255, 255, 255, 0.3);
border-left: 1px solid rgba(255, 255, 255, 0.3);
border-right: 1px solid rgba(200, 200, 200, 0.3);
border-bottom: 1px solid rgba(200, 200, 200, 0.3);
background: rgba(3, 82, 147, 0.6);
}
.IconButton:not(:disabled):hover {
background: rgba(0, 98, 179, 0.8);
border-color: rgba(255, 255, 255, 0.4);
}
.IconButton svg {
opacity: 0.6;
}
.IconButton:not(:disabled):hover svg {
opacity: 1;
}

View file

@ -57,6 +57,7 @@ import {
LuPanelTopOpen,
} from "react-icons/lu";
import styles from "./MapInspector.module.css";
import { useTouchDevice } from "./useTouchDevice";
function createLazy(
name: string,
@ -112,10 +113,11 @@ export function MapInspector() {
const { missionName, missionType } = currentMission;
const [mapInfoOpen, setMapInfoOpen] = useState(false);
const [serverBrowserOpen, setServerBrowserOpen] = useState(false);
const [sidebarOpen, setSidebarOpen] = useState(true);
const [sidebarOpen, setSidebarOpen] = useState(false);
const [choosingMap, setChoosingMap] = useState(false);
const [missionLoadingProgress, setMissionLoadingProgress] = useState(0);
const [showLoadingIndicator, setShowLoadingIndicator] = useState(true);
const isTouch = useTouchDevice();
const changeMission = useCallback(
(mission: CurrentMission) => {
@ -130,8 +132,11 @@ export function MapInspector() {
engineStore.getState().setRecording(null);
gameEntityStore.getState().endStreaming();
setCurrentMission(mission);
if (isTouch) {
setSidebarOpen(false);
}
},
[setCurrentMission, clearFogEnabledOverride],
[clearFogEnabledOverride, setCurrentMission, isTouch],
);
usePublicWindowAPI({ onChangeMission: changeMission });
@ -169,6 +174,20 @@ export function MapInspector() {
}
}, [recording]);
// Close the sidebar when a live server connection is established.
const gameStatus = useLiveSelector((s) => s.gameStatus);
useEffect(() => {
if (gameStatus === "connected" && isTouch) {
setSidebarOpen(false);
}
}, [gameStatus, isTouch]);
useEffect(() => {
if (recording && isTouch) {
setSidebarOpen(false);
}
}, [isTouch, recording]);
const loadingProgress = missionLoadingProgress;
const isLoading = loadingProgress < 1;

View file

@ -2,7 +2,7 @@
position: relative;
display: flex;
align-items: center;
margin: 10px 10px 10px 4px;
margin: 10px 10px 10px 8px;
z-index: 2;
}
@ -196,3 +196,9 @@
background: rgba(0, 0, 0, 0.5);
z-index: 1;
}
@media (max-width: 899px) {
.InputWrapper {
margin-left: 4px;
}
}

View file

@ -203,4 +203,8 @@
.Table td {
max-width: 200px;
}
.CloseButton {
margin-left: auto;
}
}

View file

@ -60,24 +60,8 @@
min-width: 28px;
min-height: 28px;
padding: 2px;
/* display: flex;
align-items: center;
justify-content: center;
margin-right: 12px;
padding: 6px;
font-size: 18px;
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 3px;
background: rgba(255, 255, 255, 0.05);
color: rgba(255, 255, 255, 0.6);
cursor: pointer; */
}
/* .ActionButton:hover {
background: rgba(255, 255, 255, 0.1);
color: #fff;
} */
.EjectIcon {
font-size: 21px;
margin-top: -0.5px;
@ -87,4 +71,8 @@
.Metadata {
display: none;
}
.MissionInfo {
margin-left: 0;
}
}