зеркало из
https://github.com/kodackx/disinformation-quest.git
synced 2025-10-29 12:46:03 +02:00
Improve emoji distribution in animation
Adjusted the positioning of emojis in the MemeAnimation component to spread them horizontally, ensuring they cover the full width of the animation container. [skip gpt_engineer]
Этот коммит содержится в:
родитель
c2730a5541
Коммит
f6589b4276
@ -13,19 +13,20 @@ export const MemeAnimation = ({ className = '' }: { className?: string }) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const interval = setInterval(() => {
|
const interval = setInterval(() => {
|
||||||
// Add new emoji
|
// Add new emoji with better horizontal distribution
|
||||||
setEmojis(current => {
|
setEmojis(current => {
|
||||||
const newEmoji = {
|
const newEmoji = {
|
||||||
id: Date.now(),
|
id: Date.now(),
|
||||||
symbol: symbols[Math.floor(Math.random() * symbols.length)],
|
symbol: symbols[Math.floor(Math.random() * symbols.length)],
|
||||||
x: Math.random() * 80 + 10, // Random x position between 10% and 90%
|
// Spread more widely across the container width (from 5% to 95%)
|
||||||
|
x: Math.random() * 90 + 5,
|
||||||
};
|
};
|
||||||
return [...current, newEmoji];
|
return [...current, newEmoji];
|
||||||
});
|
});
|
||||||
|
|
||||||
// Clean up old emojis
|
// Clean up old emojis
|
||||||
setEmojis(current => current.filter(emoji => Date.now() - emoji.id < 3000));
|
setEmojis(current => current.filter(emoji => Date.now() - emoji.id < 3000));
|
||||||
}, 300); // Add new emoji every 300ms
|
}, 300);
|
||||||
|
|
||||||
return () => clearInterval(interval);
|
return () => clearInterval(interval);
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
Загрузка…
x
Ссылка в новой задаче
Block a user