Spaces:
Running
Running
<html lang="en-GB"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>UK Property Project Calculator | SamPlanning</title> | |
<script src="https://cdn.tailwindcss.com"></script> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
<script> | |
tailwind.config = { | |
theme: { | |
extend: { | |
colors: { | |
primary: '#1d4ed8', | |
secondary: '#10b981', | |
accent: '#f59e0b', | |
}, | |
fontFamily: { | |
sans: ['Inter', 'sans-serif'], | |
}, | |
} | |
} | |
} | |
</script> | |
<style> | |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap'); | |
body { | |
font-family: 'Inter', sans-serif; | |
} | |
.input-highlight { | |
box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.2); | |
} | |
.input-highlight:focus { | |
box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.5); | |
} | |
.results-card { | |
transition: all 0.3s ease; | |
} | |
.results-card:hover { | |
transform: translateY(-2px); | |
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); | |
} | |
.tab-active { | |
border-bottom: 3px solid #1d4ed8; | |
font-weight: 600; | |
color: #1d4ed8; | |
} | |
</style> | |
</head> | |
<body class="bg-gray-50"> | |
<header class="bg-white shadow-sm"> | |
<div class="container mx-auto px-4 py-6"> | |
<div class="flex justify-between items-center"> | |
<div class="flex items-center"> | |
<div class="w-10 h-10 bg-primary rounded-full flex items-center justify-center text-white font-bold text-xl mr-3">SP</div> | |
<h1 class="text-xl font-bold text-gray-800">SamPlanning</h1> | |
</div> | |
<nav class="hidden md:flex space-x-8"> | |
<a href="#" class="text-gray-600 hover:text-primary">Services</a> | |
<a href="#" class="text-gray-600 hover:text-primary">Projects</a> | |
<a href="#" class="text-gray-600 hover:text-primary">About</a> | |
<a href="#" class="text-primary font-medium">Calculator</a> | |
</nav> | |
<button class="md:hidden text-gray-600"> | |
<i class="fas fa-bars text-2xl"></i> | |
</button> | |
</div> | |
</div> | |
</header> | |
<main class="container mx-auto px-4 py-8 md:py-12"> | |
<div class="max-w-4xl mx-auto"> | |
<div class="text-center mb-10"> | |
<h2 class="text-3xl md:text-4xl font-bold text-gray-900 mb-4">UK Property Project Calculator</h2> | |
<p class="text-lg text-gray-600 max-w-2xl mx-auto">Estimate costs, potential value and ROI for your domestic project in under 2 minutes</p> | |
</div> | |
<div class="bg-white rounded-xl shadow-md overflow-hidden mb-10"> | |
<div class="flex border-b"> | |
<button id="homeowner-tab" class="tab-active flex-1 py-4 px-6 text-center font-medium">Homeowner</button> | |
<button id="landlord-tab" class="flex-1 py-4 px-6 text-center font-medium text-gray-600">Landlord</button> | |
<button id="developer-tab" class="flex-1 py-4 px-6 text-center font-medium text-gray-600">Developer</button> | |
</div> | |
<div class="p-6 md:p-8"> | |
<div class="grid grid-cols-1 md:grid-cols-2 gap-8"> | |
<div> | |
<h3 class="text-xl font-semibold text-gray-800 mb-6">Project Details</h3> | |
<div class="mb-6"> | |
<label for="project-type" class="block text-sm font-medium text-gray-700 mb-2">Project Type</label> | |
<select id="project-type" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:input-highlight"> | |
<option value="extension">Extension</option> | |
<option value="loft">Loft Conversion</option> | |
<option value="hmo">HMO Conversion</option> | |
<option value="newbuild">New Build</option> | |
<option value="refurb">Full Refurbishment</option> | |
</select> | |
</div> | |
<div class="mb-6"> | |
<label for="location" class="block text-sm font-medium text-gray-700 mb-2">Location (Postcode Area)</label> | |
<input type="text" id="location" placeholder="e.g. SW1, M1, B1" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:input-highlight"> | |
</div> | |
<div class="mb-6"> | |
<label for="current-value" class="block text-sm font-medium text-gray-700 mb-2">Current Property Value (£)</label> | |
<input type="number" id="current-value" placeholder="e.g. 350000" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:input-highlight"> | |
</div> | |
<div class="mb-6"> | |
<label for="size" class="block text-sm font-medium text-gray-700 mb-2">Project Size (sq ft)</label> | |
<input type="number" id="size" placeholder="e.g. 500" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:input-highlight"> | |
</div> | |
<div class="mb-6"> | |
<label for="quality" class="block text-sm font-medium text-gray-700 mb-2">Finish Quality</label> | |
<select id="quality" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:input-highlight"> | |
<option value="basic">Basic</option> | |
<option value="standard" selected>Standard</option> | |
<option value="premium">Premium</option> | |
<option value="luxury">Luxury</option> | |
</select> | |
</div> | |
</div> | |
<div> | |
<h3 class="text-xl font-semibold text-gray-800 mb-6">Financial Details</h3> | |
<div class="mb-6"> | |
<label for="build-cost" class="block text-sm font-medium text-gray-700 mb-2">Estimated Build Cost (£)</label> | |
<div class="relative"> | |
<input type="number" id="build-cost" placeholder="e.g. 50000" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:input-highlight"> | |
<button id="cost-calculator-btn" class="absolute right-3 top-3 text-primary text-sm font-medium">Calculate for me</button> | |
</div> | |
</div> | |
<div class="mb-6"> | |
<label for="fees" class="block text-sm font-medium text-gray-700 mb-2">Professional Fees (£)</label> | |
<input type="number" id="fees" placeholder="e.g. 10000" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:input-highlight"> | |
</div> | |
<div class="mb-6"> | |
<label for="finance-cost" class="block text-sm font-medium text-gray-700 mb-2">Finance Cost (if applicable) (£)</label> | |
<input type="number" id="finance-cost" placeholder="e.g. 5000" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:input-highlight"> | |
</div> | |
<div class="mb-6"> | |
<label for="rental-income" class="block text-sm font-medium text-gray-700 mb-2">Expected Rental Income (£/month)</label> | |
<input type="number" id="rental-income" placeholder="e.g. 1200" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:input-highlight"> | |
</div> | |
<div class="flex justify-end"> | |
<button id="calculate-btn" class="bg-primary hover:bg-blue-700 text-white font-medium py-3 px-8 rounded-lg transition duration-300"> | |
Calculate ROI | |
</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div id="results-section" class="hidden"> | |
<h3 class="text-2xl font-semibold text-gray-800 mb-6">Your Project Results</h3> | |
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-10"> | |
<div class="results-card bg-white p-6 rounded-xl shadow-sm border-l-4 border-primary"> | |
<h4 class="text-lg font-medium text-gray-700 mb-3">Total Project Cost</h4> | |
<p id="total-cost" class="text-3xl font-bold text-gray-900 mb-2">£0</p> | |
<p class="text-sm text-gray-500">Including build, fees & finance</p> | |
</div> | |
<div class="results-card bg-white p-6 rounded-xl shadow-sm border-l-4 border-secondary"> | |
<h4 class="text-lg font-medium text-gray-700 mb-3">End Value / Annual Rent</h4> | |
<p id="end-value" class="text-3xl font-bold text-gray-900 mb-2">£0</p> | |
<p id="rental-display" class="text-sm text-gray-500 hidden">Potential annual rental income</p> | |
<p id="value-display" class="text-sm text-gray-500">Estimated property value after works</p> | |
</div> | |
<div class="results-card bg-white p-6 rounded-xl shadow-sm border-l-4 border-accent"> | |
<h4 class="text-lg font-medium text-gray-700 mb-3">Profit on Sale</h4> | |
<p id="profit" class="text-3xl font-bold text-gray-900 mb-2">£0</p> | |
<p class="text-sm text-gray-500">After deducting all costs</p> | |
</div> | |
</div> | |
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-10"> | |
<div class="bg-white p-6 rounded-xl shadow-sm"> | |
<h4 class="text-lg font-medium text-gray-700 mb-4">ROI Metrics</h4> | |
<div class="space-y-4"> | |
<div> | |
<div class="flex justify-between mb-1"> | |
<span class="text-sm font-medium text-gray-700">Gross Yield</span> | |
<span id="gross-yield" class="text-sm font-medium text-gray-900">0%</span> | |
</div> | |
<div class="w-full bg-gray-200 rounded-full h-2"> | |
<div id="gross-yield-bar" class="bg-secondary h-2 rounded-full" style="width: 0%"></div> | |
</div> | |
</div> | |
<div> | |
<div class="flex justify-between mb-1"> | |
<span class="text-sm font-medium text-gray-700">Profit Margin</span> | |
<span id="profit-margin" class="text-sm font-medium text-gray-900">0%</span> | |
</div> | |
<div class="w-full bg-gray-200 rounded-full h-2"> | |
<div id="profit-margin-bar" class="bg-primary h-2 rounded-full" style="width: 0%"></div> | |
</div> | |
</div> | |
<div> | |
<div class="flex justify-between mb-1"> | |
<span class="text-sm font-medium text-gray-700">Payback Period</span> | |
<span id="payback-period" class="text-sm font-medium text-gray-900">0 years</span> | |
</div> | |
<div class="w-full bg-gray-200 rounded-full h-2"> | |
<div id="payback-bar" class="bg-accent h-2 rounded-full" style="width: 0%"></div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="bg-white p-6 rounded-xl shadow-sm"> | |
<h4 class="text-lg font-medium text-gray-700 mb-4">Cost Breakdown</h4> | |
<div class="space-y-3"> | |
<div class="flex justify-between"> | |
<span class="text-sm text-gray-600">Build Cost</span> | |
<span id="build-cost-display" class="text-sm font-medium text-gray-900">£0</span> | |
</div> | |
<div class="flex justify-between"> | |
<span class="text-sm text-gray-600">Professional Fees</span> | |
<span id="fees-display" class="text-sm font-medium text-gray-900">£0</span> | |
</div> | |
<div class="flex justify-between"> | |
<span class="text-sm text-gray-600">Finance Costs</span> | |
<span id="finance-display" class="text-sm font-medium text-gray-900">£0</span> | |
</div> | |
<div class="border-t border-gray-200 my-2"></div> | |
<div class="flex justify-between"> | |
<span class="text-sm font-medium text-gray-700">Total Cost</span> | |
<span id="total-cost-display" class="text-sm font-medium text-gray-900">£0</span> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="bg-primary-50 border border-primary-100 rounded-xl p-6 md:p-8 mb-10"> | |
<div class="flex flex-col md:flex-row items-center"> | |
<div class="md:w-2/3 mb-6 md:mb-0 md:pr-8"> | |
<h3 class="text-xl font-semibold text-gray-800 mb-3">Get a Detailed Assessment</h3> | |
<p class="text-gray-600 mb-4">Our calculator provides estimates based on averages. For a precise assessment tailored to your specific project, book a consultation with one of our experts.</p> | |
<ul class="space-y-2 text-gray-700"> | |
<li class="flex items-start"> | |
<i class="fas fa-check-circle text-secondary mt-1 mr-2"></i> | |
<span>Accurate local cost data</span> | |
</li> | |
<li class="flex items-start"> | |
<i class="fas fa-check-circle text-secondary mt-1 mr-2"></i> | |
<span>Planning permission guidance</span> | |
</li> | |
<li class="flex items-start"> | |
<i class="fas fa-check-circle text-secondary mt-1 mr-2"></i> | |
<span>Optimised design solutions</span> | |
</li> | |
</ul> | |
</div> | |
<div class="md:w-1/3 w-full"> | |
<button id="book-consultation-btn" class="w-full bg-primary hover:bg-blue-700 text-white font-medium py-3 px-6 rounded-lg transition duration-300"> | |
Book Consultation | |
</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</main> | |
<footer class="bg-gray-800 text-white py-12"> | |
<div class="container mx-auto px-4"> | |
<div class="grid grid-cols-1 md:grid-cols-4 gap-8"> | |
<div> | |
<h3 class="text-lg font-semibold mb-4">SamPlanning</h3> | |
<p class="text-gray-400">UK property project specialists helping homeowners, landlords and developers maximise their returns.</p> | |
</div> | |
<div> | |
<h3 class="text-lg font-semibold mb-4">Services</h3> | |
<ul class="space-y-2 text-gray-400"> | |
<li><a href="#" class="hover:text-white">Planning Applications</a></li> | |
<li><a href="#" class="hover:text-white">Project Management</a></li> | |
<li><a href="#" class="hover:text-white">Cost Consultancy</a></li> | |
<li><a href="#" class="hover:text-white">HMO Conversions</a></li> | |
</ul> | |
</div> | |
<div> | |
<h3 class="text-lg font-semibold mb-4">Contact</h3> | |
<ul class="space-y-2 text-gray-400"> | |
<li class="flex items-start"> | |
<i class="fas fa-phone-alt mt-1 mr-2 text-gray-300"></i> | |
<span>020 1234 5678</span> | |
</li> | |
<li class="flex items-start"> | |
<i class="fas fa-envelope mt-1 mr-2 text-gray-300"></i> | |
<span>[email protected]</span> | |
</li> | |
<li class="flex items-start"> | |
<i class="fas fa-map-marker-alt mt-1 mr-2 text-gray-300"></i> | |
<span>London, UK</span> | |
</li> | |
</ul> | |
</div> | |
<div> | |
<h3 class="text-lg font-semibold mb-4">Legal</h3> | |
<ul class="space-y-2 text-gray-400"> | |
<li><a href="#" class="hover:text-white">Privacy Policy</a></li> | |
<li><a href="#" class="hover:text-white">Terms of Service</a></li> | |
<li><a href="#" class="hover:text-white">Cookies</a></li> | |
</ul> | |
</div> | |
</div> | |
<div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-400"> | |
<p>© 2023 SamPlanning. All rights reserved.</p> | |
</div> | |
</div> | |
</footer> | |
<script> | |
// Tab switching functionality | |
const homeownerTab = document.getElementById('homeowner-tab'); | |
const landlordTab = document.getElementById('landlord-tab'); | |
const developerTab = document.getElementById('developer-tab'); | |
const tabs = [homeownerTab, landlordTab, developerTab]; | |
tabs.forEach(tab => { | |
tab.addEventListener('click', () => { | |
tabs.forEach(t => t.classList.remove('tab-active', 'text-primary')); | |
tabs.forEach(t => t.classList.add('text-gray-600')); | |
tab.classList.add('tab-active', 'text-primary'); | |
tab.classList.remove('text-gray-600'); | |
// Update the form based on selected tab | |
updateFormForUserType(tab.id); | |
}); | |
}); | |
function updateFormForUserType(tabId) { | |
const rentalIncomeField = document.getElementById('rental-income'); | |
const rentalDisplay = document.getElementById('rental-display'); | |
const valueDisplay = document.getElementById('value-display'); | |
if (tabId === 'landlord-tab') { | |
rentalIncomeField.placeholder = "e.g. 2500"; | |
rentalDisplay.classList.remove('hidden'); | |
valueDisplay.classList.add('hidden'); | |
} else { | |
rentalIncomeField.placeholder = "e.g. 1200"; | |
rentalDisplay.classList.add('hidden'); | |
valueDisplay.classList.remove('hidden'); | |
} | |
} | |
// Cost calculator button | |
document.getElementById('cost-calculator-btn').addEventListener('click', () => { | |
const projectType = document.getElementById('project-type').value; | |
const size = parseFloat(document.getElementById('size').value) || 0; | |
const quality = document.getElementById('quality').value; | |
// Basic cost estimation logic | |
let costPerSqFt; | |
switch(quality) { | |
case 'basic': | |
costPerSqFt = 120; | |
break; | |
case 'standard': | |
costPerSqFt = 180; | |
break; | |
case 'premium': | |
costPerSqFt = 250; | |
break; | |
case 'luxury': | |
costPerSqFt = 350; | |
break; | |
default: | |
costPerSqFt = 180; | |
} | |
// Adjust for project type | |
if (projectType === 'loft') costPerSqFt *= 1.2; | |
if (projectType === 'hmo') costPerSqFt *= 0.9; | |
if (projectType === 'newbuild') costPerSqFt *= 0.85; | |
const estimatedCost = Math.round(size * costPerSqFt); | |
if (estimatedCost > 0) { | |
document.getElementById('build-cost').value = estimatedCost; | |
// Estimate professional fees as 15% of build cost | |
document.getElementById('fees').value = Math.round(estimatedCost * 0.15); | |
} | |
}); | |
// Main calculation function | |
document.getElementById('calculate-btn').addEventListener('click', calculateROI); | |
function calculateROI() { | |
const currentValue = parseFloat(document.getElementById('current-value').value) || 0; | |
const buildCost = parseFloat(document.getElementById('build-cost').value) || 0; | |
const fees = parseFloat(document.getElementById('fees').value) || 0; | |
const financeCost = parseFloat(document.getElementById('finance-cost').value) || 0; | |
const rentalIncome = parseFloat(document.getElementById('rental-income').value) || 0; | |
const projectType = document.getElementById('project-type').value; | |
const size = parseFloat(document.getElementById('size').value) || 0; | |
// Calculate total cost | |
const totalCost = buildCost + fees + financeCost; | |
// Estimate end value based on project type and size | |
let valueIncrease; | |
switch(projectType) { | |
case 'extension': | |
valueIncrease = size * 500; // £500/sq ft value increase | |
break; | |
case 'loft': | |
valueIncrease = size * 600; | |
break; | |
case 'hmo': | |
valueIncrease = currentValue * 0.3; // 30% increase for HMO conversion | |
break; | |
case 'newbuild': | |
valueIncrease = size * 700; | |
break; | |
case 'refurb': | |
valueIncrease = currentValue * 0.25; | |
break; | |
default: | |
valueIncrease = size * 500; | |
} | |
const endValue = currentValue + valueIncrease; | |
// Calculate profit | |
const profit = endValue - currentValue - totalCost; | |
// Calculate ROI metrics | |
const grossYield = rentalIncome > 0 ? ((rentalIncome * 12) / (currentValue + totalCost)) * 100 : 0; | |
const profitMargin = (profit / totalCost) * 100; | |
const paybackPeriod = rentalIncome > 0 ? totalCost / (rentalIncome * 12) : 0; | |
// Update results display | |
document.getElementById('total-cost').textContent = `£${totalCost.toLocaleString()}`; | |
document.getElementById('end-value').textContent = `£${endValue.toLocaleString()}`; | |
document.getElementById('profit').textContent = `£${profit.toLocaleString()}`; | |
document.getElementById('gross-yield').textContent = `${grossYield.toFixed(1)}%`; | |
document.getElementById('profit-margin').textContent = `${profitMargin.toFixed(1)}%`; | |
document.getElementById('payback-period').textContent = `${paybackPeriod.toFixed(1)} years`; | |
// Update progress bars | |
document.getElementById('gross-yield-bar').style.width = `${Math.min(grossYield, 30)}%`; | |
document.getElementById('profit-margin-bar').style.width = `${Math.min(profitMargin, 100)}%`; | |
document.getElementById('payback-bar').style.width = `${Math.min(paybackPeriod * 10, 100)}%`; | |
// Update cost breakdown | |
document.getElementById('build-cost-display').textContent = `£${buildCost.toLocaleString()}`; | |
document.getElementById('fees-display').textContent = `£${fees.toLocaleString()}`; | |
document.getElementById('finance-display').textContent = `£${financeCost.toLocaleString()}`; | |
document.getElementById('total-cost-display').textContent = `£${totalCost.toLocaleString()}`; | |
// Show results section | |
document.getElementById('results-section').classList.remove('hidden'); | |
// Scroll to results | |
document.getElementById('results-section').scrollIntoView({ behavior: 'smooth' }); | |
} | |
// Book consultation button | |
document.getElementById('book-consultation-btn').addEventListener('click', () => { | |
alert('Thank you for your interest! A SamPlanning representative will contact you shortly to schedule your consultation.'); | |
}); | |
</script> | |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Samik1994/roi-calculator" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
</html> |