mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 01:21:20 -04:00
gsw
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -11,8 +11,8 @@
|
|||||||
<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-Jqrwroia.js"></script>
|
<script type="module" crossorigin src="/assets/index-CmQgqYSs.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-x5WpGgIW.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-Vt8gngD9.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|||||||
@@ -757,21 +757,21 @@ const OVERCURRENT_LABELS = {
|
|||||||
function OvercurrentOverlay({ motors, fill = 0, compact = false }) {
|
function OvercurrentOverlay({ motors, fill = 0, compact = false }) {
|
||||||
if (!motors?.length) return null;
|
if (!motors?.length) return null;
|
||||||
const safeLabels = motors.map((name) => OVERCURRENT_LABELS[name] || name);
|
const safeLabels = motors.map((name) => OVERCURRENT_LABELS[name] || name);
|
||||||
const containerClass = compact ? 'p-2' : 'p-4';
|
const containerClass = compact ? 'w-[12rem] h-[3.5rem]' : 'w-[20rem] h-[7rem]';
|
||||||
const sizeClass = compact ? 'min-w-[10rem] min-h-[3rem]' : 'min-w-[18rem] min-h-[6rem]';
|
const padClass = compact ? 'px-2 py-1' : 'px-4 py-2';
|
||||||
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';
|
||||||
const safeFill = Math.max(0, Math.min(1, fill));
|
const safeFill = Math.max(0, Math.min(1, fill));
|
||||||
const fillWidth = `${Math.round(safeFill * 100)}%`;
|
const fillWidth = `${Math.round(safeFill * 100)}%`;
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`pointer-events-none absolute flex items-center justify-center bg-red-900/50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 ${containerClass} ${sizeClass}`}
|
className={`pointer-events-none absolute flex items-center justify-center bg-red-900/50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 ${containerClass}`}
|
||||||
>
|
>
|
||||||
<div className="relative h-full w-full">
|
<div className="relative h-full w-full">
|
||||||
<div className="absolute inset-0 overflow-hidden">
|
<div className="absolute inset-0 overflow-hidden">
|
||||||
<div className="h-full bg-red-700/60" style={{ width: fillWidth }} />
|
<div className="h-full bg-red-700/60" style={{ width: fillWidth }} />
|
||||||
</div>
|
</div>
|
||||||
<div className={`relative z-10 flex h-full w-full flex-col items-center justify-center text-center font-semibold text-white animate-pulse ${textClass}`}>
|
<div className={`relative z-10 flex h-full w-full flex-col items-center justify-center text-center font-semibold text-white animate-pulse ${textClass} ${padClass}`}>
|
||||||
<div>OVERCURRENT</div>
|
<div>OVERCURRENT</div>
|
||||||
<div className={`mt-0 font-medium text-white ${subTextClass}`}>{safeLabels.join(', ')}</div>
|
<div className={`mt-0 font-medium text-white ${subTextClass}`}>{safeLabels.join(', ')}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user