Adjusted the horizontal spread of emojis in the MemeAnimation component to utilize the full width of the container, ensuring a more dynamic and visually appealing distribution.
[skip gpt_engineer]
Этот коммит содержится в:
gpt-engineer-app[bot] 2024-12-15 13:18:21 +00:00
родитель f6589b4276
Коммит eaa8767e91

Просмотреть файл

@ -13,13 +13,13 @@ export const MemeAnimation = ({ className = '' }: { className?: string }) => {
useEffect(() => { useEffect(() => {
const interval = setInterval(() => { const interval = setInterval(() => {
// Add new emoji with better horizontal distribution // Add new emoji with wider 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)],
// Spread more widely across the container width (from 5% to 95%) // Use full width (0 to 100%) for positioning
x: Math.random() * 90 + 5, x: Math.random() * 100,
}; };
return [...current, newEmoji]; return [...current, newEmoji];
}); });
@ -34,7 +34,7 @@ export const MemeAnimation = ({ className = '' }: { className?: string }) => {
return ( return (
<div className={`relative w-full h-40 overflow-hidden bg-black/20 rounded-lg ${className}`}> <div className={`relative w-full h-40 overflow-hidden bg-black/20 rounded-lg ${className}`}>
{/* Background network effect */} {/* Background network effect */}
<div className="absolute inset-0 opacity-20"> <div className="absolute inset-0 w-full opacity-20">
{[...Array(20)].map((_, i) => ( {[...Array(20)].map((_, i) => (
<div <div
key={`line-${i}`} key={`line-${i}`}
@ -59,7 +59,8 @@ export const MemeAnimation = ({ className = '' }: { className?: string }) => {
🌟 🌟
</motion.div> </motion.div>
{/* Floating emojis */} {/* Floating emojis with full width container */}
<div className="absolute inset-0 w-full">
<AnimatePresence> <AnimatePresence>
{emojis.map((emoji) => ( {emojis.map((emoji) => (
<motion.div <motion.div
@ -95,5 +96,6 @@ export const MemeAnimation = ({ className = '' }: { className?: string }) => {
))} ))}
</AnimatePresence> </AnimatePresence>
</div> </div>
</div>
); );
}; };