Changes
This commit is contained in:
@@ -50,19 +50,19 @@ const Breakout = () => {
|
||||
const { enterFullscreen, exitFullscreen } = useBrowserFullscreen();
|
||||
|
||||
const getCanvasSize = useCallback(() => {
|
||||
if (typeof window === 'undefined') return { width: 480, height: 580 };
|
||||
if (typeof window === 'undefined') return { width: 560, height: 680 };
|
||||
const isMobile = window.innerWidth < 768;
|
||||
if (isMobile) {
|
||||
const maxWidth = window.innerWidth - 32;
|
||||
// Reserve space for header + fixed controls dock on mobile
|
||||
const maxHeight = window.innerHeight - 380;
|
||||
const aspectRatio = 480 / 580;
|
||||
const aspectRatio = 560 / 680;
|
||||
let width = maxWidth;
|
||||
let height = width / aspectRatio;
|
||||
if (height > maxHeight) { height = maxHeight; width = height * aspectRatio; }
|
||||
return { width: Math.floor(width), height: Math.floor(height) };
|
||||
}
|
||||
return isFullscreen ? { width: 600, height: 720 } : { width: 480, height: 580 };
|
||||
return isFullscreen ? { width: 700, height: 840 } : { width: 560, height: 680 };
|
||||
}, [isFullscreen]);
|
||||
|
||||
const [canvasSize, setCanvasSize] = useState(getCanvasSize);
|
||||
|
||||
Reference in New Issue
Block a user