.calculator-container {
background-color: #fff;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
max-width: 500px;
margin: 0 auto;
padding: 20px;
}
.calculator-container h2 {
text-align: center;
color: #333;
}
.input-group {
margin-bottom: 15px;
}
.input-group label {
display: block;
color: #555;
margin-bottom: 5px;
}
.input-group input {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}
.result {
background-color: #e0f7fa;
padding: 15px;
border-radius: 5px;
margin-top: 20px;
text-align: center;
font-weight: bold;
}
.button {
display: block;
width: 100%;
background-color: #ff824c; /* Button color */
color: white;
padding: 10px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
}
.button:hover {
background-color: #4353ff; /* Updated hover color */
}
function calculateMetrics() {
const salesGoal = document.getElementById('sales-goal').value;
const dealSize = document.getElementById('deal-size').value;
const conversionRate = document.getElementById('conversion-rate').value / 100;
const visitLeadConversionRate = document.getElementById('visit-lead-conversion-rate').value / 100;
if (salesGoal && dealSize && conversionRate && visitLeadConversionRate) {
const customersNeeded = Math.round(salesGoal / dealSize);
const leadsNeeded = Math.round(customersNeeded / conversionRate);
const visitsNeeded = Math.round(leadsNeeded / visitLeadConversionRate);
document.getElementById('result').innerHTML = `
Customers Needed to Reach Goal: ${formatNumber(customersNeeded)}
Leads Needed: ${formatNumber(leadsNeeded)}
Page Visits Needed to Reach Goal: ${formatNumber(visitsNeeded)}
`;
} else {
document.getElementById('result').innerHTML = "Please fill in all fields.";
}
}
function formatNumber(num) {
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}