Skip to content

Commit

Permalink
fixes eslint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromehardaway committed Feb 9, 2024
1 parent f0bd5ee commit 1614335
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/components/EmojiRain/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
import React from 'react';

const EmojiRain = () => {
// Generate unique IDs for each emoji
const emojis = Array.from({ length: 100 }).map((_, index) => ({
id: `emoji-${index}-${new Date().getTime()}-${Math.random()}`, // This generates a unique ID
emoji: '🎖️',
}));

return (
<div className="fixed top-0 left-0 w-full h-full pointer-events-none z-50 overflow-hidden">
{Array.from({ length: 100 }).map((_, index) => (
{emojis.map((emojiObj) => (
<div
key={index}
key={emojiObj.id} // Using the unique ID as key
style={{
position: "absolute",
left: `${Math.random() * 100}vw`,
top: `-${Math.random() * 100}vh`,
animation: "fall 5s linear forwards",
}}
>
🎖️
{emojiObj.emoji}
</div>
))}
</div>
Expand Down

0 comments on commit 1614335

Please sign in to comment.