Cosmic Zodiac Insights
Cosmic Zodiac Insights
Discover Your Cosmic Blueprint
Enter your birth date to reveal your zodiac sign, personality traits, daily horoscope, and compatibility insights
Personality Traits
${signObj.traits}
Strengths
${signObj.strengths}
Weaknesses
${signObj.weaknesses}
Today's Horoscope
${message}
Compatibility
Best matches: ${compatData.good.join(", ")}
Challenging matches: ${compatData.bad.join(", ")}
Your Element: ${signObj.element}
${getElementDescription(signObj.element)}
Advice for ${signObj.sign}
${getAdvice(signObj.sign)}
Famous ${signObj.sign}s
${getFamousExamples(signObj.sign)}
`;
document.getElementById('resultsContainer').innerHTML = resultHTML;
// Save for future visits
localStorage.setItem("lastZodiac", signObj.sign);
localStorage.setItem("lastDate", new Date().toDateString());
// Scroll to results
document.getElementById('resultsContainer').scrollIntoView({ behavior: 'smooth' });
}
function getElementDescription(element) {
const descriptions = {
"Fire": "Fire signs are passionate, dynamic, and temperamental. They're full of energy and enthusiasm, with a strong will and determination. You bring warmth and inspiration to those around you.",
"Earth": "Earth signs are grounded, practical, and reliable. You value stability and security, with a strong connection to the material world. Your sensible approach to life provides a solid foundation.",
"Air": "Air signs are intellectual, communicative, and social. You thrive on ideas, relationships, and mental stimulation. Your ability to see all perspectives makes you an excellent problem-solver.",
"Water": "Water signs are emotional, intuitive, and deeply sensitive. You experience life through feelings and have strong psychic abilities. Your empathy and compassion nurture those in your circle."
};
return descriptions[element] || "Your element influences how you experience and interact with the world.";
}
function getAdvice(sign) {
const advice = {
"Aries": "Channel your energy into focused action. Take the lead but remember to listen to others. Your courage inspires those around you.",
"Taurus": "Embrace change while maintaining your stability. Your persistence will pay off, but flexibility opens new doors. Enjoy life's sensual pleasures.",
"Gemini": "Balance your many interests with focused attention. Your curiosity is a gift - share your discoveries. Communication builds bridges.",
"Cancer": "Honor your emotional depth while establishing healthy boundaries. Your nurturing nature is a gift to others. Create a sanctuary for yourself.",
"Leo": "Share your spotlight generously. Your confidence inspires others. Creative expression brings you joy and fulfillment.",
"Virgo": "Balance your analytical mind with compassion for imperfections. Your attention to detail solves problems others miss. Service brings meaning.",
"Libra": "Trust your ability to find balance in challenging situations. Your diplomacy creates harmony. Beauty nourishes your soul.",
"Scorpio": "Transform challenges into strengths. Your intensity creates deep connections. Share your powerful insights with discretion.",
"Sagittarius": "Let your optimism guide you toward new horizons. Your philosophical nature seeks meaning in all experiences. Adventure expands your perspective.",
"Capricorn": "Your discipline builds lasting success. Balance ambition with moments of relaxation. Your reliability makes you a pillar of strength.",
"Aquarius": "Your innovative ideas can change the world. Balance your visionary nature with practical steps. Community connections enrich your life.",
"Pisces": "Your intuition is your superpower. Balance spiritual pursuits with grounded action. Creative expression heals and inspires."
};
return advice[sign] || "Follow your heart while staying grounded in reality. The universe supports your journey.";
}
function getFamousExamples(sign) {
const examples = {
"Aries": "Lady Gaga, Robert Downey Jr., Mariah Carey, Elton John",
"Taurus": "Adele, Dwayne Johnson, George Clooney, Cher",
"Gemini": "Kanye West, Angelina Jolie, Johnny Depp, Naomi Campbell",
"Cancer": "Tom Hanks, Princess Diana, Meryl Streep, Selena Gomez",
"Leo": "Barack Obama, Jennifer Lopez, Madonna, Chris Hemsworth",
"Virgo": "BeyoncΓ©, Keanu Reeves, Cameron Diaz, Zendaya",
"Libra": "Will Smith, Kim Kardashian, Bruno Mars, Serena Williams",
"Scorpio": "Julia Roberts, Ryan Reynolds, Katy Perry, Leonardo DiCaprio",
"Sagittarius": "Taylor Swift, Brad Pitt, Miley Cyrus, Jay-Z",
"Capricorn": "Michelle Obama, LeBron James, Kate Middleton, Denzel Washington",
"Aquarius": "Oprah Winfrey, Harry Styles, Cristiano Ronaldo, Shakira",
"Pisces": "Rihanna, Albert Einstein, Justin Bieber, Elizabeth Taylor"
};
return examples[sign] || "Many influential people share your zodiac sign!";
}
function showNotification(message, type) {
// Create notification element
const notification = document.createElement('div');
notification.textContent = message;
notification.style.cssText = `
position: fixed;
top: 20px;
right: 20px;
padding: 15px 20px;
border-radius: 10px;
color: white;
font-weight: 500;
z-index: 1000;
box-shadow: 0 5px 15px rgba(0,0,0,0.3);
transition: transform 0.3s ease, opacity 0.3s ease;
transform: translateX(100%);
opacity: 0;
`;
if (type === 'error') {
notification.style.background = 'linear-gradient(45deg, #ff6b6b, #ff8e8e)';
} else {
notification.style.background = 'linear-gradient(45deg, var(--primary), var(--secondary))';
}
document.body.appendChild(notification);
// Animate in
setTimeout(() => {
notification.style.transform = 'translateX(0)';
notification.style.opacity = '1';
}, 100);
// Remove after 3 seconds
setTimeout(() => {
notification.style.transform = 'translateX(100%)';
notification.style.opacity = '0';
setTimeout(() => {
document.body.removeChild(notification);
}, 300);
}, 3000);
}
// Initialize the app
document.addEventListener('DOMContentLoaded', function() {
createStars();
// Set up event listeners
document.getElementById('revealBtn').addEventListener('click', findZodiac);
// Auto-load user's last sign
const saved = localStorage.getItem("lastZodiac");
if (saved) {
const signObj = zodiacData.find(z => z.sign === saved);
if (signObj) {
// Set the date input to a default value for demo purposes
const today = new Date();
const defaultDate = new Date(today.getFullYear() - 25, 3, 15);
document.getElementById('birthDate').valueAsDate = defaultDate;
// Display the result after a short delay
setTimeout(() => {
displayResult(signObj);
}, 500);
}
}
});