diff --git a/src/pages/map/components/DiceModal.tsx b/src/pages/map/components/DiceModal.tsx index 97f3b001..3f52cad3 100644 --- a/src/pages/map/components/DiceModal.tsx +++ b/src/pages/map/components/DiceModal.tsx @@ -253,8 +253,6 @@ function isBright(hexColor: string): boolean { // Calculate luminance const luminance = 0.2126 * rNorm + 0.7152 * gNorm + 0.0722 * bNorm - console.log('lum', luminance) - // Return true if too bright for dark text return luminance > 0.45 } diff --git a/src/pages/map/components/PlayerIcon.tsx b/src/pages/map/components/PlayerIcon.tsx index fde6bda0..25c7427a 100644 --- a/src/pages/map/components/PlayerIcon.tsx +++ b/src/pages/map/components/PlayerIcon.tsx @@ -220,7 +220,7 @@ export default function PlayerIcon({ return () => clearInterval(interval) } // eslint-disable-next-line react-hooks/exhaustive-deps - }, [player.map_position]) + }, [player.map_position, isMoving]) // console.log({ player, cell }); if (!anchorCell) { @@ -235,9 +235,13 @@ export default function PlayerIcon({ const isStillAnimated = iconRef.current?.src.endsWith('gif') - const finalPositionTop = - isMoving || isStillAnimated ? originTop - 14 : positionTop - const finalPositionLeft = isMoving ? originLeft : positionLeft + let finalPositionTop = positionTop + let finalPositionLeft = positionLeft + + if (isMoving || isStillAnimated) { + // adjust height for animation + finalPositionTop = positionTop - 14 + } const handleClick = (event: React.MouseEvent) => { setPopupAnchor(event.currentTarget as HTMLElement)