зеркало из
https://github.com/kodackx/disinformation-quest.git
synced 2025-10-29 12:46:03 +02:00
Fix emoji clustering in animation
Adjusted the positioning logic in the MemeAnimation component to ensure emojis spread out more evenly across the animation area, rather than clustering in the upper left corner. [skip gpt_engineer]
Этот коммит содержится в:
родитель
870b94e974
Коммит
4590de8347
@ -16,20 +16,19 @@ export const MemeAnimation = ({ className = '' }: { className?: string }) => {
|
||||
const memes: MemeSymbol[] = [];
|
||||
const symbols = ['💡', '🎯', '📱', '🔄', '🌐', '💫'];
|
||||
|
||||
// Create a 3x3 grid of meme symbols
|
||||
for (let row = 0; row < 3; row++) {
|
||||
for (let col = 0; col < 3; col++) {
|
||||
// Create a wider spread of meme symbols
|
||||
for (let i = 0; i < 9; i++) {
|
||||
const baseSymbol = symbols[Math.floor(Math.random() * symbols.length)];
|
||||
// Distribute across the full width (10-90%) and height (10-90%)
|
||||
memes.push({
|
||||
id: row * 3 + col,
|
||||
id: i,
|
||||
symbol: baseSymbol,
|
||||
x: 20 + (col * 30), // Spread across horizontally
|
||||
y: 20 + (row * 30), // Spread across vertically
|
||||
x: 10 + (Math.random() * 80), // Spread between 10% and 90% of width
|
||||
y: 10 + (Math.random() * 80), // Spread between 10% and 90% of height
|
||||
scale: 0.8 + Math.random() * 0.4,
|
||||
delay: (row * 3 + col) * 0.15 // Stagger the animations
|
||||
delay: i * 0.15 // Stagger the animations
|
||||
});
|
||||
}
|
||||
}
|
||||
return memes;
|
||||
};
|
||||
|
||||
@ -70,14 +69,14 @@ export const MemeAnimation = ({ className = '' }: { className?: string }) => {
|
||||
opacity: 1,
|
||||
x: [
|
||||
`${meme.x}%`,
|
||||
`${meme.x + (Math.random() * 40 - 20)}%`,
|
||||
`${meme.x + (Math.random() * 60 - 30)}%`
|
||||
`${meme.x + (Math.random() * 60 - 30)}%`, // Wider movement range
|
||||
`${meme.x + (Math.random() * 80 - 40)}%` // Even wider final position
|
||||
],
|
||||
y: [
|
||||
`${meme.y}%`,
|
||||
`${meme.y + (Math.random() * 40 - 20)}%`,
|
||||
`${meme.y + (Math.random() * 60 - 30)}%`
|
||||
],
|
||||
`${meme.y + (Math.random() * 60 - 30)}%`, // Wider movement range
|
||||
`${meme.y + (Math.random() * 80 - 40)}%` // Even wider final position
|
||||
]
|
||||
}}
|
||||
transition={{
|
||||
delay: meme.delay,
|
||||
|
||||
Загрузка…
x
Ссылка в новой задаче
Block a user