.zodiac-app {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
max-width: 800px;
margin: 20px auto;
padding: 25px;
border: 2px solid #d4af37;
border-radius: 12px;
background-color: #fffaf0;
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.zodiac-header {
text-align: center;
color: #b30000;
margin-bottom: 30px;
}
.zodiac-calculator-box {
background: #ffffff;
padding: 20px;
border-radius: 8px;
border: 1px solid #e0e0e0;
margin-bottom: 30px;
}
.input-group {
margin-bottom: 20px;
}
.input-group label {
display: block;
font-weight: bold;
margin-bottom: 8px;
color: #333;
}
.input-group input {
width: 100%;
padding: 12px;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 16px;
box-sizing: border-box;
}
.calc-btn {
background-color: #b30000;
color: white;
border: none;
padding: 15px 25px;
font-size: 18px;
font-weight: bold;
border-radius: 6px;
cursor: pointer;
width: 100%;
transition: background 0.3s;
}
.calc-btn:hover {
background-color: #8b0000;
}
#zodiacResult {
margin-top: 25px;
padding: 20px;
border-radius: 8px;
display: none;
animation: fadeIn 0.5s;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.result-title {
font-size: 24px;
color: #b30000;
margin-bottom: 10px;
font-weight: bold;
}
.result-element {
font-size: 18px;
color: #555;
font-style: italic;
margin-bottom: 15px;
}
.result-traits {
line-height: 1.6;
color: #333;
}
.article-section {
margin-top: 40px;
line-height: 1.8;
color: #444;
}
.article-section h2 {
color: #b30000;
border-bottom: 2px solid #d4af37;
padding-bottom: 5px;
}
.zodiac-table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
}
.zodiac-table th, .zodiac-table td {
border: 1px solid #ddd;
padding: 10px;
text-align: left;
}
.zodiac-table th {
background-color: #b30000;
color: white;
}
.disclaimer {
font-size: 12px;
color: #777;
margin-top: 10px;
}
What is the Chinese Zodiac?
The Chinese Zodiac, known as Shengxiao, is a repeating cycle of 12 years, with each year represented by an animal and its reputed attributes. Unlike the Western zodiac which is based on solar months, the Chinese system is based on the lunar calendar. The 12 animals are: Rat, Ox, Tiger, Rabbit, Dragon, Snake, Horse, Goat, Monkey, Rooster, Dog, and Pig.
The Five Elements of the Zodiac
In addition to the animal signs, the Chinese Zodiac incorporates five elements: Wood, Fire, Earth, Metal, and Water. These elements rotate every two years, meaning a full cycle of the zodiac takes 60 years (12 animals × 5 elements). Your specific element is determined by the last digit of your birth year.
| Last Digit of Year |
Element |
Characteristics |
| 0 or 1 |
Metal |
Persistence, Strength, Determination |
| 2 or 3 |
Water |
Creativity, Persuasion, Communication |
| 4 or 5 |
Wood |
Growth, Generosity, Flexibility |
| 6 or 7 |
Fire |
Passion, Leadership, Dynamism |
| 8 or 9 |
Earth |
Stability, Reliability, Practicality |
Why Calculate Your Sign?
In Chinese culture, your zodiac sign is believed to influence your personality, career success, and romantic compatibility. Many people use the "Calculate My Chinese Zodiac" tool to better understand their inner strengths and potential challenges for the coming year. For example, the Dragon is seen as powerful and lucky, while the Dog is renowned for loyalty and honesty.
function calculateMyZodiac() {
var yearStr = document.getElementById('birthYear').value;
var year = parseInt(yearStr);
var resultDiv = document.getElementById('zodiacResult');
if (!year || year 2100) {
resultDiv.style.display = 'block';
resultDiv.style.backgroundColor = '#f8d7da';
resultDiv.innerHTML = 'Please enter a valid birth year between 1900 and 2100.';
return;
}
var animals = [
"Rat", "Ox", "Tiger", "Rabbit", "Dragon", "Snake",
"Horse", "Goat", "Monkey", "Rooster", "Dog", "Pig"
];
var animalTraits = {
"Rat": "Quick-witted, resourceful, versatile, and kind.",
"Ox": "Diligent, dependable, strong, and determined.",
"Tiger": "Brave, confident, competitive, and unpredictable.",
"Rabbit": "Quiet, elegant, kind, and responsible.",
"Dragon": "Confident, intelligent, enthusiastic, and powerful.",
"Snake": "Enigmatic, intelligent, wise, and private.",
"Horse": "Animated, active, energetic, and optimistic.",
"Goat": "Gentle, shy, sympathetic, and creative.",
"Monkey": "Sharp, smart, curious, and mischievous.",
"Rooster": "Observant, hardworking, courageous, and talented.",
"Dog": "Lovely, honest, prudent, and loyal.",
"Pig": "Compassionate, generous, diligent, and calm."
};
// Calculation: 1900 was the year of the Metal Rat
var animalIndex = (year – 1900) % 12;
if (animalIndex < 0) animalIndex += 12;
var animal = animals[animalIndex];
// Element calculation based on the last digit
var lastDigit = year % 10;
var element = "";
var elementColor = "";
if (lastDigit === 0 || lastDigit === 1) { element = "Metal"; elementColor = "#b5b5b5"; }
else if (lastDigit === 2 || lastDigit === 3) { element = "Water"; elementColor = "#3498db"; }
else if (lastDigit === 4 || lastDigit === 5) { element = "Wood"; elementColor = "#27ae60"; }
else if (lastDigit === 6 || lastDigit === 7) { element = "Fire"; elementColor = "#e74c3c"; }
else if (lastDigit === 8 || lastDigit === 9) { element = "Earth"; elementColor = "#d35400"; }
var output = '
You are a ' + element + ' ' + animal + '!
';
output += '
Element: ' + element + '
';
output += '
Key Traits: ' + animalTraits[animal] + '
';
output += 'The ' + animal + ' is part of the ' + (animalIndex + 1) + ' position in the 12-year cycle.';
resultDiv.style.display = 'block';
resultDiv.style.backgroundColor = '#fff';
resultDiv.style.border = '2px solid ' + elementColor;
resultDiv.innerHTML = output;
}