From 20648a514f5fc633a32b022c6d671b73a3d4a882 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 15 Dec 2024 14:48:28 +0000 Subject: [PATCH] Fix animation positioning issues Adjusted the positioning of dots (nodes) in the animation to prevent clustering in a corner and ensured that circles are displayed correctly within the main space of the container. [skip gpt_engineer] --- .../game/animations/CommunityAnimation.tsx | 92 +++++++++++-------- 1 file changed, 52 insertions(+), 40 deletions(-) diff --git a/src/components/game/animations/CommunityAnimation.tsx b/src/components/game/animations/CommunityAnimation.tsx index 3efbe2a..fe02114 100644 --- a/src/components/game/animations/CommunityAnimation.tsx +++ b/src/components/game/animations/CommunityAnimation.tsx @@ -3,18 +3,18 @@ import { motion } from 'framer-motion'; export const CommunityAnimation = ({ className = '' }: { className?: string }) => { const groups = Array.from({ length: 3 }, (_, i) => ({ - x: 25 + i * 25, // Spread groups evenly (25%, 50%, 75%) + x: 25 + i * 25, // Spread groups horizontally (25%, 50%, 75%) y: 50, // Center vertically members: Array.from({ length: 8 }, (_, j) => ({ id: i * 8 + j, - initialX: Math.random() * 80 + 10, - initialY: Math.random() * 80 + 10, + initialX: Math.random() * 100, + initialY: Math.random() * 100, })) })); return (
- {/* Background network effect similar to MemeAnimation */} + {/* Background network effect */}
{[...Array(20)].map((_, i) => (
- {/* Container for community groups with explicit positioning context */} + {/* Container for community groups */}
{groups.map((group, groupIndex) => ( - - {group.members.map((member) => ( - - ))} - +
+ {/* Circle container for each group */} - + + {/* Dots for each member */} + {group.members.map((member) => ( + + ))} +
))}