Fix landscape live view

This commit is contained in:
Nicolas Mowen 2024-04-06 15:33:06 -06:00
parent 5085fa7135
commit e6893145a6

View File

@ -158,9 +158,9 @@ export default function LiveCameraView({ camera }: LiveCameraViewProps) {
return "absolute left-2 right-2 top-[50%] -translate-y-[50%]"; return "absolute left-2 right-2 top-[50%] -translate-y-[50%]";
} else { } else {
if (aspect > 16 / 9) { if (aspect > 16 / 9) {
return "absolute left-0 top-[50%] -translate-y-[50%]"; return "p-2 absolute left-0 top-[50%] -translate-y-[50%]";
} else { } else {
return "absolute top-2 bottom-2 left-[50%] -translate-x-[50%]"; return "p-2 absolute top-2 bottom-2 left-[50%] -translate-x-[50%]";
} }
} }
} }
@ -209,18 +209,20 @@ export default function LiveCameraView({ camera }: LiveCameraViewProps) {
className={ className={
fullscreen fullscreen
? `fixed inset-0 bg-black z-30` ? `fixed inset-0 bg-black z-30`
: `size-full p-2 flex flex-col ${isMobile ? "landscape:flex-row" : ""}` : `size-full p-2 flex flex-col ${isMobile ? "landscape:flex-row landscape:gap-1" : ""}`
} }
> >
<div <div
className={ className={
fullscreen fullscreen
? `absolute right-32 top-1 z-40 ${isMobile ? "landscape:left-2 landscape:right-auto landscape:bottom-1 landscape:top-auto" : ""}` ? `absolute right-32 top-1 z-40 ${isMobile ? "landscape:left-2 landscape:right-auto landscape:bottom-1 landscape:top-auto" : ""}`
: `w-full h-12 flex flex-row items-center justify-between ${isMobile ? "landscape:w-min landscape:h-full landscape:flex-col" : ""}` : `w-full h-12 flex flex-row items-center justify-between ${isMobile ? "landscape:w-12 landscape:h-full landscape:flex-col" : ""}`
} }
> >
{!fullscreen ? ( {!fullscreen ? (
<div className="flex items-center gap-2"> <div
className={`flex items-center gap-2 ${isMobile ? "landscape:flex-col" : ""}`}
>
<Button <Button
className={`flex items-center gap-2.5 rounded-lg`} className={`flex items-center gap-2.5 rounded-lg`}
size="sm" size="sm"
@ -619,7 +621,7 @@ function FrigateCameraFeatures({
<Drawer> <Drawer>
<DrawerTrigger> <DrawerTrigger>
<CameraFeatureToggle <CameraFeatureToggle
className="p-2" className="p-2 landscape:size-9"
variant="primary" variant="primary"
Icon={FaCog} Icon={FaCog}
isActive={false} isActive={false}