Skip to content

Commit

Permalink
style: 레이싱 게임 내부의 handleSmoothlyStop()에서 더 이동해야 하는 거리에 매직넘버 적용 (CC-162)
Browse files Browse the repository at this point in the history
  • Loading branch information
minani-0621 committed Aug 19, 2024
1 parent 73e1266 commit b0c8efd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Caecae/src/components/RacingGame/RacingGame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ const RacingGame: React.FC = () => {
};

const handleSmoothlyStop = () => {
const moveMoreDistance = 500;

if (endGameTimeoutRef.current) {
clearTimeout(endGameTimeoutRef.current);
}
Expand All @@ -187,12 +189,12 @@ const RacingGame: React.FC = () => {
const currentRearX = rearRef.current?.getBoundingClientRect().x || 0;

frontAnimationControls.start({
x: currentFrontX - 500,
x: currentFrontX - moveMoreDistance,
transition: { duration: 1, ease: "easeOut" },
});

rearAnimationControls.start({
x: currentRearX - 500,
x: currentRearX - moveMoreDistance,
transition: { duration: 1, ease: "easeOut" },
});

Expand Down

0 comments on commit b0c8efd

Please sign in to comment.