* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Pacifico', cursive;
background-color: #f0f8ff;
color: #333;
padding: 20px;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
background: #ffefd5;
padding: 30px;
border-radius: 15px;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
width: 100%;
max-width: 400px;
text-align: center;
}
header h1 {
color: #ff6347;
font-size: 2.5rem;
margin-bottom: 10px;
}
header p {
font-size: 1.2rem;
color: #555;
}
.input-section {
margin: 20px 0;
}
input {
width: 80%;
padding: 10px;
font-size: 1.2rem;
border-radius: 10px;
border: 2px solid #ff6347;
margin-right: 10px;
outline: none;
}
button {
padding: 10px 20px;
background-color: #ff6347;
border: none;
border-radius: 10px;
font-size: 1.2rem;
color: #fff;
cursor: pointer;
}
button:hover {
background-color: #e55347;
}
.result {
margin-top: 20px;
}
h2 {
font-size: 2rem;
color: #ff6347;
}
h3 {
font-size: 1.5rem;
color: #555;
margin-top: 10px;
}
p {
font-size: 1.2rem;
color: #333;
margin-top: 5px;
}
function calculateNumerology() {
const mobileNumber = document.getElementById('mobileNumber').value;
const resultElement = document.getElementById('numerologyResult');
const meaningElement = document.getElementById('numerologyMeaning');
const descriptionElement = document.getElementById('numerologyDescription');
if (mobileNumber.length === 0) {
resultElement.textContent = '-';
meaningElement.textContent = 'Numerology Description';
descriptionElement.textContent = '-';
return;
}
// Remove non-digit characters
const number = mobileNumber.replace(/\D/g, '');
if (number.length < 1) {
resultElement.textContent = "Invalid Input";
meaningElement.textContent = "Please enter a valid number.";
descriptionElement.textContent = "-";
return;
}
let numerologyNumber = 0;
// Sum all digits
for (let i = 0; i < number.length; i++) {
numerologyNumber += parseInt(number[i]);
}
// Reduce the number to a single digit (numerology principle)
while (numerologyNumber > 9) {
numerologyNumber = numerologyNumber.toString().split('').reduce((sum, num) => sum + parseInt(num), 0);
}
// Display result
resultElement.textContent = numerologyNumber;
// Meaning based on numerology number
let meaning = '';
let description = '';
switch (numerologyNumber) {
case 1:
meaning = 'Leadership, Independence, Self-reliance';
description = 'Number 1 is associated with leadership and new beginnings. People with this number are usually independent and self-motivated.';
break;
case 2:
meaning = 'Cooperation, Balance, Sensitivity';
description = 'Number 2 is associated with harmony, relationships, and partnerships. People with this number are diplomatic and compassionate.';
break;
case 3:
meaning = 'Creativity, Expression, Optimism';
description = 'Number 3 is associated with creativity, communication, and artistic expression. People with this number are often imaginative and optimistic.';
break;
case 4:
meaning = 'Discipline, Stability, Hard Work';
description = 'Number 4 is associated with practicality, responsibility, and building solid foundations. People with this number are reliable and hardworking.';
break;
case 5:
meaning = 'Freedom, Adventure, Change';
description = 'Number 5 is associated with adventure, freedom, and versatility. People with this number are often energetic and love variety in their lives.';
break;
case 6:
meaning = 'Love, Care, Responsibility';
description = 'Number 6 is associated with family, love, and nurturing. People with this number are often caretakers and emotionally sensitive.';
break;
case 7:
meaning = 'Introspection, Wisdom, Spirituality';
description = 'Number 7 is associated with deep thinking, introspection, and spirituality. People with this number are often analytical and wise.';
break;
case 8:
meaning = 'Power, Ambition, Material Success';
description = 'Number 8 is associated with success, wealth, and ambition. People with this number are often goal-oriented and determined.';
break;
case 9:
meaning = 'Compassion, Humanitarianism, Completion';
description = 'Number 9 is associated with compassion, humanitarian efforts, and the completion of cycles. People with this number are often selfless and empathetic.';
break;
default:
meaning = 'Unknown';
description = 'An error occurred.';
}
meaningElement.textContent = meaning;
descriptionElement.textContent = description;
}