This commit is contained in:
legop3
2026-01-21 13:13:08 -05:00
parent bcfb2946cf
commit e2f94720ec
3 changed files with 19 additions and 12 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -11,7 +11,7 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="Multi Roomba Rover" /> <meta name="apple-mobile-web-app-title" content="Multi Roomba Rover" />
<title>Multi Roomba Rover</title> <title>Multi Roomba Rover</title>
<script type="module" crossorigin src="/assets/index-Do17t9B2.js"></script> <script type="module" crossorigin src="/assets/index-YY17Fmk4.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-HhAzSaxc.css"> <link rel="stylesheet" crossorigin href="/assets/index-HhAzSaxc.css">
</head> </head>
<body> <body>
+11 -4
View File
@@ -137,6 +137,11 @@ export default function VideoTile({
if (auxActive) labels.push('Aux motors'); if (auxActive) labels.push('Aux motors');
return labels.length ? labels : fallbackLabels; return labels.length ? labels : fallbackLabels;
}, [fallbackLabels, limiterCaps, limiterGroups, overcurrentLimiter]); }, [fallbackLabels, limiterCaps, limiterGroups, overcurrentLimiter]);
const overlayLabels = useMemo(() => {
if (overcurrentLabels?.length) return overcurrentLabels;
if (overlayVisible) return ['Overcurrent'];
return [];
}, [overcurrentLabels, overlayVisible]);
const scheduleRestart = useCallback(() => { const scheduleRestart = useCallback(() => {
clearTimeout(restartTimer.current); clearTimeout(restartTimer.current);
@@ -464,9 +469,10 @@ export default function VideoTile({
/> />
<HudChatInput compact={mobileHud} /> <HudChatInput compact={mobileHud} />
<OvercurrentOverlay <OvercurrentOverlay
labels={overcurrentLabels} labels={overlayLabels}
fill={overlayFill} fill={overlayFill}
opacity={overlayOpacity} opacity={overlayOpacity}
visible={overlayVisible}
compact={mobileHud} compact={mobileHud}
/> />
<LowBatteryOverlay charge={batteryCharge} config={batteryConfig} compact={mobileHud} /> <LowBatteryOverlay charge={batteryCharge} config={batteryConfig} compact={mobileHud} />
@@ -768,8 +774,9 @@ const OVERCURRENT_LABELS = {
sideBrush: 'Side brush', sideBrush: 'Side brush',
}; };
function OvercurrentOverlay({ labels, fill = 0, opacity = 1, compact = false }) { function OvercurrentOverlay({ labels, fill = 0, opacity = 1, visible = false, compact = false }) {
if (!labels?.length) return null; if (!visible && !labels?.length) return null;
const displayLabels = labels?.length ? labels : ['Overcurrent'];
const containerClass = compact ? 'p-2' : 'p-4'; const containerClass = compact ? 'p-2' : 'p-4';
const textClass = compact ? 'text-lg' : 'text-4xl'; const textClass = compact ? 'text-lg' : 'text-4xl';
const subTextClass = compact ? 'text-xs' : 'text-xl'; const subTextClass = compact ? 'text-xs' : 'text-xl';
@@ -785,7 +792,7 @@ function OvercurrentOverlay({ labels, fill = 0, opacity = 1, compact = false })
</div> </div>
<div className={`relative z-10 text-center font-semibold text-white animate-pulse ${textClass}`}> <div className={`relative z-10 text-center font-semibold text-white animate-pulse ${textClass}`}>
<div>OVERCURRENT</div> <div>OVERCURRENT</div>
<div className={`mt-0 font-medium text-white ${subTextClass}`}>{labels.join(', ')}</div> <div className={`mt-0 font-medium text-white ${subTextClass}`}>{displayLabels.join(', ')}</div>
</div> </div>
</div> </div>
); );