Numerology Name Calculator
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Roboto', sans-serif;
background-color: #f0f8ff;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.container {
text-align: center;
background: linear-gradient(to right, #ff7e5f, #feb47b);
border-radius: 10px;
padding: 40px;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.calculator {
max-width: 500px;
margin: 0 auto;
background: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
h1 {
font-size: 2rem;
color: #333;
margin-bottom: 20px;
}
input {
width: 100%;
padding: 10px;
margin: 10px 0;
border: 2px solid #ff7e5f;
border-radius: 5px;
font-size: 1rem;
}
button {
background-color: #ff7e5f;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
font-size: 1rem;
cursor: pointer;
transition: 0.3s ease;
}
button:hover {
background-color: #feb47b;
}
#result {
margin-top: 20px;
font-size: 1.2rem;
color: #333;
}
#numerologyNumber {
font-weight: bold;
font-size: 1.5rem;
color: #ff7e5f;
}
@media (max-width: 600px) {
.container {
padding: 20px;
}
h1 {
font-size: 1.5rem;
}
input, button {
font-size: 1rem;
}
#result {
font-size: 1rem;
}
}
// A function to calculate the numerology number based on the name
function calculateNumerology() {
const name = document.getElementById('nameInput').value.trim();
if (!name) {
document.getElementById('result').style.display = 'none';
return;
}
const sum = getNumerologySum(name);
const numerologyNumber = sum % 9 === 0 ? 9 : sum % 9; // The number should always be between 1 and 9.
const meaning = getMeaning(numerologyNumber);
document.getElementById('numerologyNumber').innerText = numerologyNumber;
document.getElementById('meaning').innerText = meaning;
document.getElementById('result').style.display = 'block';
}
// A function to calculate the numerology sum
function getNumerologySum(name) {
const letterValues = {
A: 1, B: 2, C: 3, D: 4, E: 5, F: 6, G: 7, H: 8, I: 9,
J: 1, K: 2, L: 3, M: 4, N: 5, O: 6, P: 7, Q: 8, R: 9,
S: 1, T: 2, U: 3, V: 4, W: 5, X: 6, Y: 7, Z: 8
};
let sum = 0;
name = name.toUpperCase().replace(/[^A-Z]/g, ''); // Remove non-letter characters and convert to uppercase
for (let i = 0; i < name.length; i++) {
sum += letterValues[name[i]] || 0;
}
return sum;
}
// A function to get the meaning of the numerology number
function getMeaning(number) {
const meanings = {
1: "You are a leader, independent, and have a strong will.",
2: "You are diplomatic, gentle, and a natural peacemaker.",
3: "You are creative, artistic, and expressive.",
4: "You are hardworking, practical, and disciplined.",
5: "You are adventurous, curious, and always seeking change.",
6: "You are caring, responsible, and family-oriented.",
7: "You are spiritual, intellectual, and analytical.",
8: "You are ambitious, powerful, and materialistically driven.",
9: "You are compassionate, generous, and humanitarian."
};
return meanings[number] || "Unknown meaning";
}