Numerology Calculator
Numerology Calculator
Enter your birth date to find your Life Path Number
Your Life Path Number will appear here.
/* styles.css */
body {
margin: 0;
padding: 0;
font-family: 'Montserrat', sans-serif;
background-color: #f0f8ff;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
flex-direction: column;
}
.calculator {
background: linear-gradient(to right, #ff7e5f, #feb47b);
border-radius: 15px;
padding: 30px;
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
text-align: center;
width: 80%;
max-width: 400px;
}
h1 {
color: #fff;
font-size: 2rem;
font-weight: 600;
margin-bottom: 15px;
}
p {
color: #fff;
font-size: 1rem;
margin-bottom: 25px;
}
.input-group {
margin-bottom: 20px;
color: #fff;
}
input {
padding: 10px;
font-size: 1rem;
border-radius: 5px;
border: none;
width: 100%;
box-sizing: border-box;
}
input:focus {
outline: none;
border: 2px solid #ff7e5f;
}
.btn-container button {
background-color: #ff7e5f;
color: #fff;
padding: 10px 20px;
font-size: 1rem;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
.btn-container button:hover {
background-color: #feb47b;
}
.result {
margin-top: 20px;
font-size: 1.2rem;
color: #fff;
font-weight: bold;
background-color: #2e2e2e;
padding: 10px;
border-radius: 5px;
}
// script.js
function calculateNumerology() {
// Get birthdate value from the input field
let birthdate = document.getElementById("birthdate").value;
if (birthdate) {
// Extract day, month, and year from the date
let birthDateObj = new Date(birthdate);
let day = birthDateObj.getDate();
let month = birthDateObj.getMonth() + 1; // Month is zero-indexed
let year = birthDateObj.getFullYear();
// Calculate the Life Path Number by adding digits
let sum = day + month + year;
// Reduce to a single digit (Life Path Number)
sum = reduceToSingleDigit(sum);
// Display the result
document.getElementById("life-path-result").textContent = "Your Life Path Number is: " + sum;
} else {
alert("Please enter a valid birthdate.");
}
}
function reduceToSingleDigit(num) {
while (num >= 10) {
num = num.toString().split('').reduce((acc, digit) => acc + parseInt(digit), 0);
}
return num;
}