Spaces:
Running
Running
Commit ·
45ae5c9
1
Parent(s): 80ac556
updates
Browse files
frontend/src/components/PitchView.jsx
CHANGED
|
@@ -20,7 +20,7 @@ import { DraggablePlayer } from "./DraggablePlayer";
|
|
| 20 |
MAX_SCALE > 1 lets the pitch scale modestly on wide screens without badges
|
| 21 |
and labels becoming disproportionately large.
|
| 22 |
*/
|
| 23 |
-
const DESIGN_WIDTH =
|
| 24 |
const STARTERS_H = 780;
|
| 25 |
const BENCH_H = 230;
|
| 26 |
// Gap between player card wrappers in px (in design space)
|
|
@@ -71,12 +71,12 @@ export const PitchView = ({
|
|
| 71 |
|
| 72 |
const updateScale = useCallback(() => {
|
| 73 |
if (!containerRef.current) return;
|
| 74 |
-
const w =
|
| 75 |
? window.innerWidth
|
| 76 |
: containerRef.current.offsetWidth;
|
| 77 |
const next = Math.min(MAX_SCALE, w / DESIGN_WIDTH);
|
| 78 |
setScale(prev => Math.abs(prev - next) > 0.005 ? next : prev);
|
| 79 |
-
}, []);
|
| 80 |
|
| 81 |
useEffect(() => {
|
| 82 |
const handler = () => {
|
|
|
|
| 20 |
MAX_SCALE > 1 lets the pitch scale modestly on wide screens without badges
|
| 21 |
and labels becoming disproportionately large.
|
| 22 |
*/
|
| 23 |
+
const DESIGN_WIDTH = 640;
|
| 24 |
const STARTERS_H = 780;
|
| 25 |
const BENCH_H = 230;
|
| 26 |
// Gap between player card wrappers in px (in design space)
|
|
|
|
| 71 |
|
| 72 |
const updateScale = useCallback(() => {
|
| 73 |
if (!containerRef.current) return;
|
| 74 |
+
const w = isFullscreen
|
| 75 |
? window.innerWidth
|
| 76 |
: containerRef.current.offsetWidth;
|
| 77 |
const next = Math.min(MAX_SCALE, w / DESIGN_WIDTH);
|
| 78 |
setScale(prev => Math.abs(prev - next) > 0.005 ? next : prev);
|
| 79 |
+
}, [isFullscreen]);
|
| 80 |
|
| 81 |
useEffect(() => {
|
| 82 |
const handler = () => {
|