import React, { useState } from "react"; const HoroscopeApp = () => { const [selectedSign, setSelectedSign] = useState("taurus"); const [selectedGender, setSelectedGender] = useState("female"); const [selectedPeriod, setSelectedPeriod] = useState("today"); const [selectedCategory, setSelectedCategory] = useState("love"); const [isDarkMode, setIsDarkMode] = useState(false); const zodiacSigns = [ { id: "taurus", name: "Taurus", dates: "April 20 - May 20", emoji: "🐂", imageFile: "TAURUS.png", }, { id: "sagittarius", name: "Sagittarius", dates: "Nov 22 - Dec 21", emoji: "🏹", imageFile: "SAGITTARIUS.png", }, { id: "pisces", name: "Pisces", dates: "Feb 19 - Mar 20", emoji: "🐠", imageFile: "PISCES.png", }, { id: "libra", name: "Libra", dates: "Sep 23 - Oct 22", emoji: "⚖️", imageFile: "LIBRA.png", }, { id: "gemini", name: "Gemini", dates: "May 21 - Jun 20", emoji: "👯", imageFile: "GEMINI.png", }, { id: "leo", name: "Leo", dates: "Jul 23 - Aug 22", emoji: "🦁", imageFile: "LEO.png", }, { id: "virgo", name: "Virgo", dates: "Aug 23 - Sep 22", emoji: "👸", imageFile: "VIRGO.png", }, { id: "aquarius", name: "Aquarius", dates: "Jan 20 - Feb 18", emoji: "🏺", imageFile: "AQUARIUS.png", }, { id: "aries", name: "Aries", dates: "Mar 21 - Apr 19", emoji: "🐏", imageFile: "ARIES.png", }, { id: "cancer", name: "Cancer", dates: "Jun 21 - Jul 22", emoji: "🦀", imageFile: "CANCER.png", }, { id: "scorpio", name: "Scorpio", dates: "Oct 23 - Nov 21", emoji: "🦂", imageFile: "SCORPIO.png", }, { id: "capricorn", name: "Capricorn", dates: "Dec 22 - Jan 19", emoji: "🐐", imageFile: "CAPRICORN.png", }, ]; const periods = [ { id: "today", name: "Today" }, { id: "week", name: "Week" }, { id: "month", name: "Month" }, { id: "year", name: "Year" }, ]; const categories = [ { id: "love", name: "Love", icon: "💖" }, { id: "health", name: "Health", icon: "🌟" }, { id: "relationship", name: "Relationship", icon: "👥" }, { id: "finance", name: "Finance", icon: "💰" }, ]; const horoscopeContent = { love: { today: "Love is in the air today! Your romantic side is highlighted, making it a perfect day for expressing your feelings.", week: "This week brings romantic opportunities and deepening connections with your loved ones.", month: "A month of passionate encounters and meaningful relationships awaits you.", year: "This year will be transformative for your love life, bringing lasting happiness.", }, health: { today: "Your energy levels are high today. Focus on maintaining balance between work and rest.", week: "Pay attention to your physical wellbeing this week. Small changes can make big differences.", month: "This month emphasizes the importance of mental and physical health harmony.", year: "A year of wellness and vitality lies ahead. Make health your priority.", }, relationship: { today: "Relationships flourish under today's cosmic energy. Communication is key to success.", week: "Strengthen your bonds with family and friends through meaningful conversations.", month: "Social connections expand this month, bringing new friendships and opportunities.", year: "Your social circle will grow significantly, enriching your life in unexpected ways.", }, finance: { today: "Financial opportunities present themselves today. Stay alert for new possibilities.", week: "This week favors careful financial planning and smart investments.", month: "Money matters require attention this month. Budget wisely for future security.", year: "Financial growth and stability are highlighted throughout this year.", }, }; const luckyData = { colors: [ "Green", "Blue", "Purple", "Gold", "Silver", "Red", "Pink", "Orange", "Yellow", "Turquoise", "Violet", "Indigo", ], numbers: [1, 3, 7, 9, 11, 13, 21, 23, 27, 33, 42, 77], stones: [ "Emerald", "Sapphire", "Ruby", "Diamond", "Amethyst", "Topaz", "Opal", "Pearl", "Garnet", "Aquamarine", "Citrine", "Turquoise", ], moods: [ "Optimistic", "Energetic", "Peaceful", "Confident", "Creative", "Adventurous", "Romantic", "Focused", "Joyful", "Balanced", "Inspired", "Harmonious", ], }; const getImagePath = (sign) => { if (!sign.imageFile) return null; return `/img/${selectedGender}/${sign.imageFile}`; }; const getCurrentSign = () => { return zodiacSigns.find((sign) => sign.id === selectedSign); }; const getHoroscopeText = () => { return horoscopeContent[selectedCategory][selectedPeriod]; }; const getLuckyElement = (type) => { const data = luckyData[type]; return data[Math.floor(Math.random() * data.length)]; }; const getPeriodTitle = () => { const titles = { today: "Horoscope for Today", week: "Horoscope for This Week", month: "Horoscope for This Month", year: "Horoscope for This Year", }; return titles[selectedPeriod]; }; const toggleTheme = () => { setIsDarkMode(!isDarkMode); }; return (
{/* Header Controls */}
{/* Theme Toggle */} {/* App Icon - Visible on mobile */}
🔮
{/* Gender Selection */}
{/* App Title - Hidden on mobile */}
🔮

Horoscope App

{/* Zodiac Signs Grid - Single Row */}
{zodiacSigns.map((sign) => (
setSelectedSign(sign.id)} className="flex flex-col items-center cursor-pointer transition-all duration-300 hover:scale-105 flex-shrink-0 py-1" >
{getImagePath(sign) ? ( {sign.name} { e.target.style.display = "none"; e.target.nextSibling.style.display = "block"; }} /> ) : null} {sign.emoji}

{sign.name}

))}
{/* Period Selection */}
{periods.map((period) => ( ))}
{/* Category Selection */}
{categories.map((category) => ( ))}
{/* Horoscope Content */}
{getImagePath(getCurrentSign()) ? ( {getCurrentSign()?.name} { e.target.style.display = "none"; e.target.nextSibling.style.display = "block"; }} /> ) : null} {getCurrentSign()?.emoji}

{getPeriodTitle()} 📈

{getCurrentSign()?.emoji} {getCurrentSign()?.name}

{getCurrentSign()?.name} ({getCurrentSign()?.dates})

{getHoroscopeText()}

{/* Lucky Elements */}
🍀

Lucky Color

{getLuckyElement("colors")}

🔢

Lucky Number

{getLuckyElement("numbers")}

💎

Lucky Stone

{getLuckyElement("stones")}

Mood

{getLuckyElement("moods")}

{/* Footer */}

✨ Discover your daily horoscope and unlock the secrets of the stars ✨

); }; export default HoroscopeApp;