From aeeb2e97061fd56ffa81203e6eaa401e8fe3439a Mon Sep 17 00:00:00 2001 From: Dan Bastin Date: Mon, 24 Feb 2025 11:22:32 -0500 Subject: [PATCH] center popups --- .../_sharedcomponents/Popup/Popup.tsx | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/app/_components/_sharedcomponents/Popup/Popup.tsx b/src/app/_components/_sharedcomponents/Popup/Popup.tsx index b1c5bc0e..b67d887a 100644 --- a/src/app/_components/_sharedcomponents/Popup/Popup.tsx +++ b/src/app/_components/_sharedcomponents/Popup/Popup.tsx @@ -15,7 +15,6 @@ const overlayStyle = { width: '100%', height: '100%', pointerEvents: 'none', - backgroundColor: 'rgba(0, 0, 0, 0.3)', display: 'flex', zIndex: 10, }; @@ -30,36 +29,37 @@ const focusHandlerStyle = (type: PopupType, data: PopupData, index: number, play }); export const getPopupPosition = (type: PopupType, data: PopupData, index: number, playerName:string, containCards?:boolean) => { - const basePosition = { + return { position: 'absolute', left:'50%', - marginTop: '150px', - transform: `translate(0px, ${index * 50}px)`, + top: '50%', + transform: 'translate(-50%, -50%)', + width: '80%' }; - const pilePosition = { - position: 'absolute', - left: containCards ? '-23%' : '-30.5%', - width: '100%', - } + // const pilePosition = { + // position: 'absolute', + // left: containCards ? '-23%' : '-30.5%', + // width: '100%', + // } - if (type === 'pile') { - if (data.uuid === `${playerName}-discard`) { - return { - ...pilePosition, - bottom: '400px', - } as const; - } - return { - ...pilePosition, - top: '350px', - } as const; - } + // if (type === 'pile') { + // if (data.uuid === `${playerName}-discard`) { + // return { + // ...pilePosition, + // bottom: '400px', + // } as const; + // } + // return { + // ...pilePosition, + // top: '350px', + // } as const; + // } - return { - ...basePosition, - top: '150px', - } as const; + // return { + // ...basePosition, + // top: '150px', + // } as const; } const PopupShell: React.FC = () => {