import { useState, useEffect, useRef } from 'react';
import { Sparkles, Brain, Cloud, Moon, Sun, Wind } from 'lucide-react';
export default function MoodEffectsApp() {
const [currentMood, setCurrentMood] = useState('calm');
const [isTransitioning, setIsTransitioning] = useState(false);
const [isPressed, setIsPressed] = useState(false);
const [dropPosition, setDropPosition] = useState({ x: 50, y: 50 });
// Add new water drop refs
const bowlRef = useRef(null);
const dropRef = useRef(null);
const moodEffects = {
calm: {
background: 'bg-gradient-to-br from-blue-200 to-purple-200',
icon: ,
pattern: 'floating-particles',
},
energetic: {
background: 'bg-gradient-to-br from-yellow-200 to-red-200',
icon: ,
pattern: 'rising-particles',
},
focused: {
background: 'bg-gradient-to-br from-emerald-200 to-teal-200',
icon: ,
pattern: 'network-grid',
},
dreamy: {
background: 'bg-gradient-to-br from-indigo-200 to-purple-200',
icon: ,
pattern: 'starry-night',
},
dynamic: {
background: 'bg-gradient-to-br from-pink-200 to-orange-200',
icon: ,
pattern: 'swirling-wind',
}
};
const handleMoodChange = (mood) => {
setIsTransitioning(true);
setTimeout(() => {
setCurrentMood(mood);
setIsTransitioning(false);
}, 500);
};
const handleBowlPress = (e) => {
if (!bowlRef.current) return;
const bowl = bowlRef.current.getBoundingClientRect();
const x = ((e.touches?.[0]?.clientX || e.clientX) - bowl.left) / bowl.width * 100;
const y = ((e.touches?.[0]?.clientY || e.clientY) - bowl.top) / bowl.height * 100;
setIsPressed(true);
setDropPosition({ x, y });
// Create ripple effect
const ripple = document.createElement('div');
ripple.className = 'ripple absolute rounded-full bg-white/30';
ripple.style.left = `${x}%`;
ripple.style.top = `${y}%`;
bowlRef.current.appendChild(ripple);
setTimeout(() => {
ripple.remove();
setIsPressed(false);
}, 1000);
};
return (
{/* Dynamic Background Effects */}
{/* Add Water Bowl */}
{/* Glass Highlight */}
{/* Water Drop */}
{/* Bowl Surface Reflection */}
{/* Content */}
{moodEffects[currentMood].icon}
{Object.keys(moodEffects).map((mood) => (
))}
{/* Add new styles */}
);
}
const BackgroundEffect = ({ pattern }) => {
const [particles, setParticles] = useState([]);
useEffect(() => {
const generateParticles = () => {
return Array.from({ length: 50 }, (_, i) => ({
id: i,
x: Math.random() * 100,
y: Math.random() * 100,
size: Math.random() * 4 + 1,
speed: Math.random() * 2 + 0.5,
}));
};
setParticles(generateParticles());
}, [pattern]);
return (
{particles.map((particle) => (
))}
);
};