import React, { useEffect, useState } from 'react'; import { motion } from 'framer-motion'; const FLOWER_TYPES = [ // Type 1: Simple Daisy-like (color) => ( ), // Type 2: Tulip-like (color) => ( ), // Type 3: Round (color) => ( ), ]; const COLORS = ['#f472b6', '#c084fc', '#60a5fa', '#f87171', '#fbbf24']; const DigitalFlowers = () => { const [flowers, setFlowers] = useState([]); useEffect(() => { // Generate random flowers const newFlowers = Array.from({ length: 40 }).map((_, i) => ({ id: i, left: Math.random() * 100, // percentage size: 60 + Math.random() * 80, // px (Increased size from 40-100 to 60-140) delay: Math.random() * 2, // seconds type: Math.floor(Math.random() * FLOWER_TYPES.length), color: COLORS[Math.floor(Math.random() * COLORS.length)], rotation: Math.random() * 30 - 15, // degrees })); setFlowers(newFlowers); }, []); return (
{flowers.map((flower) => ( {FLOWER_TYPES[flower.type](flower.color)} ))}
); }; export default DigitalFlowers;