From fa9fa85b11735f6ffa34cd6260d64c3a5fd0532b 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:32:01 +0000
Subject: [PATCH] Adjust Community Animation Sizing
Ensure the CommunityAnimation component utilizes the full width and height of its container. Review and address any limitations that may have been overlooked in the current implementation.
[skip gpt_engineer]
---
.../game/animations/CommunityAnimation.tsx | 43 ++++++++++++++-----
1 file changed, 32 insertions(+), 11 deletions(-)
diff --git a/src/components/game/animations/CommunityAnimation.tsx b/src/components/game/animations/CommunityAnimation.tsx
index 4aa2002..d3aab66 100644
--- a/src/components/game/animations/CommunityAnimation.tsx
+++ b/src/components/game/animations/CommunityAnimation.tsx
@@ -2,14 +2,15 @@ import React from 'react';
import { motion } from 'framer-motion';
export const CommunityAnimation = ({ className = '' }: { className?: string }) => {
- // Create multiple community groups with members
+ // Create multiple community groups with members, now using percentages for better spacing
const groups = Array.from({ length: 3 }, (_, i) => ({
- x: 25 + i * 25, // Spread groups horizontally
+ x: 20 + i * 30, // Better horizontal distribution (20%, 50%, 80%)
y: 50, // Center vertically
members: Array.from({ length: 8 }, (_, j) => ({
id: i * 8 + j,
- initialX: Math.random() * 100,
- initialY: Math.random() * 100,
+ // Distribute initial positions across the full container
+ initialX: Math.random() * 90 + 5, // 5-95% to keep within bounds
+ initialY: Math.random() * 90 + 5, // 5-95% to keep within bounds
}))
}));
@@ -21,36 +22,56 @@ export const CommunityAnimation = ({ className = '' }: { className?: string }) =
{group.members.map((member) => (
))}
- {/* Community boundary circles */}
+ {/* Community boundary circles with improved sizing and positioning */}
))}