Zodiac Sign Finder /* General Reset */ * { margin: 0; padding: 0; box-sizing: border-box; } /* Body Styling */ body { font-family: 'Arial', sans-serif; background: linear-gradient(135deg, #8B5E3C, #3C2A21); color: #FFF; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; text-align: center; } h1 { font-size: 2.5em; margin-bottom: 20px; } p { font-size: 1.2em; margin-bottom: 20px; } label { font-size: 1.2em; } input[type="date"] { font-size: 1em; padding: 10px; border: 1px solid #ddd; border-radius: 5px; margin: 10px 0 20px; } button { font-size: 1.2em; padding: 10px 20px; border: none; border-radius: 5px; background-color: #190810; color: white; cursor: pointer; transition: background-color 0.3s; } button:hover { background-color: #444; } #result { margin-top: 30px; font-size: 1.5em; color: #FFD700; } .zodiacDetails { background: #3C2A21; border-radius: 10px; padding: 20px; margin-top: 20px; box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.3); } .zodiacDetails img { width: 80px; height: 80px; object-fit: contain; margin-bottom: 15px; } .zodiacDetails h2 { font-size: 1.5em; margin: 10px 0; } .zodiacDetails p { font-size: 1em; color: #DDD; } Zodiac Sign Finder Enter your birthdate to discover your zodiac sign and its traits! Birthdate: Find My Sign function findZodiac() { const dateInput = document.getElementById("dateInput").value; if (!dateInput) { alert("Please select your birthdate!"); return; } const birthDate = new Date(dateInput); const month = birthDate.getMonth() + 1; // 0-indexed const day = birthDate.getDate(); let zodiac = ""; let description = ""; if ((month === 3 && day >= 21) || (month === 4 && day <= 19)) { zodiac = "Aries"; description = "Energetic and adventurous, Aries is known for their dynamic personality!"; } else if ((month === 4 && day >= 20) || (month === 5 && day <= 20)) { zodiac = "Taurus"; description = "Grounded and reliable, Taurus enjoys the finer things in life."; } else if ((month === 5 && day >= 21) || (month === 6 && day <= 20)) { zodiac = "Gemini"; description = "Versatile and sociable, Gemini thrives on communication and creativity."; } else if ((month === 6 && day >= 21) || (month === 7 && day <= 22)) { zodiac = "Cancer"; description = "Emotional and nurturing, Cancer values family and deep connections."; } else if ((month === 7 && day >= 23) || (month === 8 && day <= 22)) { zodiac = "Leo"; description = "Charismatic and confident, Leo shines in the spotlight!"; } else if ((month === 8 && day >= 23) || (month === 9 && day <= 22)) { zodiac = "Virgo"; description = "Detail-oriented and analytical, Virgo strives for perfection."; } else if ((month === 9 && day >= 23) || (month === 10 && day <= 22)) { zodiac = "Libra"; description = "Balanced and harmonious, Libra values beauty and justice."; } else if ((month === 10 && day >= 23) || (month === 11 && day <= 21)) { zodiac = "Scorpio"; description = "Passionate and intense, Scorpio is a master of transformation."; } else if ((month === 11 && day >= 22) || (month === 12 && day <= 21)) { zodiac = "Sagittarius"; description = "Adventurous and optimistic, Sagittarius seeks knowledge and freedom."; } else if ((month === 12 && day >= 22) || (month === 1 && day <= 19)) { zodiac = "Capricorn"; description = "Ambitious and disciplined, Capricorn strives for success."; } else if ((month === 1 && day >= 20) || (month === 2 && day <= 18)) { zodiac = "Aquarius"; description = "Innovative and independent, Aquarius is a true visionary."; } else if ((month === 2 && day >= 19) || (month === 3 && day <= 20)) { zodiac = "Pisces"; description = "Compassionate and artistic, Pisces connects deeply with others."; } document.getElementById("result").innerHTML = ` <div class="zodiacDetails"> <h2>Your Zodiac Sign: ${zodiac}</h2> <p>${description}</p> </div> `; }
No comments:
Post a Comment