diff --git a/frontend/src/components/ui/TrainingTab.tsx b/frontend/src/components/ui/TrainingTab.tsx index 22909b6..3656a26 100644 --- a/frontend/src/components/ui/TrainingTab.tsx +++ b/frontend/src/components/ui/TrainingTab.tsx @@ -4746,19 +4746,24 @@ export default function TrainingTab(props: { bottomReservePx: 138, } - const imageStageStyle = { - aspectRatio: `${frameLayoutSize.width} / ${frameLayoutSize.height}`, + const imageStageStyle = imageExpanded + ? ({ + '--image-stage-max-h': `${imageStageLimits.baseDvh}dvh`, + '--image-stage-max-h-sm': `${imageStageLimits.smDvh}dvh`, + } as CSSProperties & Record) + : ({ + aspectRatio: `${frameLayoutSize.width} / ${frameLayoutSize.height}`, - '--image-stage-max-h': `${imageStageLimits.baseDvh}dvh`, - '--image-stage-max-h-sm': `${imageStageLimits.smDvh}dvh`, - '--image-stage-max-h-lg': `min(calc(100dvh - ${imageStageLimits.bottomReservePx}px - env(safe-area-inset-bottom)), ${imageStageLimits.lgDvh}dvh, ${imageStageLimits.lgPx}px)`, + '--image-stage-max-h': `${imageStageLimits.baseDvh}dvh`, + '--image-stage-max-h-sm': `${imageStageLimits.smDvh}dvh`, + '--image-stage-max-h-lg': `min(${imageStageLimits.lgDvh}dvh, ${imageStageLimits.lgPx}px)`, - '--image-stage-w': `${imageStageLimits.baseDvh * imageAspectRatio}dvh`, - '--image-stage-w-sm': `${imageStageLimits.smDvh * imageAspectRatio}dvh`, - '--image-stage-w-lg': `min(${imageStageLimits.lgDvh * imageAspectRatio}dvh, ${Math.round( - imageStageLimits.lgPx * imageAspectRatio - )}px)`, - } as CSSProperties & Record + '--image-stage-w': `${imageStageLimits.baseDvh * imageAspectRatio}dvh`, + '--image-stage-w-sm': `${imageStageLimits.smDvh * imageAspectRatio}dvh`, + '--image-stage-w-lg': `min(${imageStageLimits.lgDvh * imageAspectRatio}dvh, ${Math.round( + imageStageLimits.lgPx * imageAspectRatio + )}px)`, + } as CSSProperties & Record) const imageStageHeightClass = [ 'max-h-[var(--image-stage-max-h)]', @@ -4872,7 +4877,7 @@ export default function TrainingTab(props: {
{/* Mitte */} -
+
e.preventDefault()} onDragStart={(e) => e.preventDefault()} className={[ - 'block h-auto min-h-0 max-h-full max-w-full rounded-md object-contain', + imageExpanded + ? 'block h-full w-full min-h-0 rounded-md object-contain' + : 'block h-auto min-h-0 max-h-full max-w-full rounded-md object-contain', 'select-none', 'transition-opacity duration-500 ease-out will-change-opacity motion-reduce:transition-none', frameImageLoaded ? 'opacity-100' : 'opacity-0',