Samik1994 commited on
Commit
eb1a1aa
·
verified ·
1 Parent(s): 46ab53e

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +489 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Roi Calculator
3
- emoji: 🐨
4
- colorFrom: yellow
5
- colorTo: indigo
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: roi-calculator
3
+ emoji: 🐳
4
+ colorFrom: gray
5
+ colorTo: gray
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,489 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en-GB">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>UK Property Project Calculator | SamPlanning</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <script>
10
+ tailwind.config = {
11
+ theme: {
12
+ extend: {
13
+ colors: {
14
+ primary: '#1d4ed8',
15
+ secondary: '#10b981',
16
+ accent: '#f59e0b',
17
+ },
18
+ fontFamily: {
19
+ sans: ['Inter', 'sans-serif'],
20
+ },
21
+ }
22
+ }
23
+ }
24
+ </script>
25
+ <style>
26
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
27
+
28
+ body {
29
+ font-family: 'Inter', sans-serif;
30
+ }
31
+
32
+ .input-highlight {
33
+ box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.2);
34
+ }
35
+
36
+ .input-highlight:focus {
37
+ box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.5);
38
+ }
39
+
40
+ .results-card {
41
+ transition: all 0.3s ease;
42
+ }
43
+
44
+ .results-card:hover {
45
+ transform: translateY(-2px);
46
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
47
+ }
48
+
49
+ .tab-active {
50
+ border-bottom: 3px solid #1d4ed8;
51
+ font-weight: 600;
52
+ color: #1d4ed8;
53
+ }
54
+ </style>
55
+ </head>
56
+ <body class="bg-gray-50">
57
+ <header class="bg-white shadow-sm">
58
+ <div class="container mx-auto px-4 py-6">
59
+ <div class="flex justify-between items-center">
60
+ <div class="flex items-center">
61
+ <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>
62
+ <h1 class="text-xl font-bold text-gray-800">SamPlanning</h1>
63
+ </div>
64
+ <nav class="hidden md:flex space-x-8">
65
+ <a href="#" class="text-gray-600 hover:text-primary">Services</a>
66
+ <a href="#" class="text-gray-600 hover:text-primary">Projects</a>
67
+ <a href="#" class="text-gray-600 hover:text-primary">About</a>
68
+ <a href="#" class="text-primary font-medium">Calculator</a>
69
+ </nav>
70
+ <button class="md:hidden text-gray-600">
71
+ <i class="fas fa-bars text-2xl"></i>
72
+ </button>
73
+ </div>
74
+ </div>
75
+ </header>
76
+
77
+ <main class="container mx-auto px-4 py-8 md:py-12">
78
+ <div class="max-w-4xl mx-auto">
79
+ <div class="text-center mb-10">
80
+ <h2 class="text-3xl md:text-4xl font-bold text-gray-900 mb-4">UK Property Project Calculator</h2>
81
+ <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>
82
+ </div>
83
+
84
+ <div class="bg-white rounded-xl shadow-md overflow-hidden mb-10">
85
+ <div class="flex border-b">
86
+ <button id="homeowner-tab" class="tab-active flex-1 py-4 px-6 text-center font-medium">Homeowner</button>
87
+ <button id="landlord-tab" class="flex-1 py-4 px-6 text-center font-medium text-gray-600">Landlord</button>
88
+ <button id="developer-tab" class="flex-1 py-4 px-6 text-center font-medium text-gray-600">Developer</button>
89
+ </div>
90
+
91
+ <div class="p-6 md:p-8">
92
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
93
+ <div>
94
+ <h3 class="text-xl font-semibold text-gray-800 mb-6">Project Details</h3>
95
+
96
+ <div class="mb-6">
97
+ <label for="project-type" class="block text-sm font-medium text-gray-700 mb-2">Project Type</label>
98
+ <select id="project-type" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:input-highlight">
99
+ <option value="extension">Extension</option>
100
+ <option value="loft">Loft Conversion</option>
101
+ <option value="hmo">HMO Conversion</option>
102
+ <option value="newbuild">New Build</option>
103
+ <option value="refurb">Full Refurbishment</option>
104
+ </select>
105
+ </div>
106
+
107
+ <div class="mb-6">
108
+ <label for="location" class="block text-sm font-medium text-gray-700 mb-2">Location (Postcode Area)</label>
109
+ <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">
110
+ </div>
111
+
112
+ <div class="mb-6">
113
+ <label for="current-value" class="block text-sm font-medium text-gray-700 mb-2">Current Property Value (£)</label>
114
+ <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">
115
+ </div>
116
+
117
+ <div class="mb-6">
118
+ <label for="size" class="block text-sm font-medium text-gray-700 mb-2">Project Size (sq ft)</label>
119
+ <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">
120
+ </div>
121
+
122
+ <div class="mb-6">
123
+ <label for="quality" class="block text-sm font-medium text-gray-700 mb-2">Finish Quality</label>
124
+ <select id="quality" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:input-highlight">
125
+ <option value="basic">Basic</option>
126
+ <option value="standard" selected>Standard</option>
127
+ <option value="premium">Premium</option>
128
+ <option value="luxury">Luxury</option>
129
+ </select>
130
+ </div>
131
+ </div>
132
+
133
+ <div>
134
+ <h3 class="text-xl font-semibold text-gray-800 mb-6">Financial Details</h3>
135
+
136
+ <div class="mb-6">
137
+ <label for="build-cost" class="block text-sm font-medium text-gray-700 mb-2">Estimated Build Cost (£)</label>
138
+ <div class="relative">
139
+ <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">
140
+ <button id="cost-calculator-btn" class="absolute right-3 top-3 text-primary text-sm font-medium">Calculate for me</button>
141
+ </div>
142
+ </div>
143
+
144
+ <div class="mb-6">
145
+ <label for="fees" class="block text-sm font-medium text-gray-700 mb-2">Professional Fees (£)</label>
146
+ <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">
147
+ </div>
148
+
149
+ <div class="mb-6">
150
+ <label for="finance-cost" class="block text-sm font-medium text-gray-700 mb-2">Finance Cost (if applicable) (£)</label>
151
+ <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">
152
+ </div>
153
+
154
+ <div class="mb-6">
155
+ <label for="rental-income" class="block text-sm font-medium text-gray-700 mb-2">Expected Rental Income (£/month)</label>
156
+ <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">
157
+ </div>
158
+
159
+ <div class="flex justify-end">
160
+ <button id="calculate-btn" class="bg-primary hover:bg-blue-700 text-white font-medium py-3 px-8 rounded-lg transition duration-300">
161
+ Calculate ROI
162
+ </button>
163
+ </div>
164
+ </div>
165
+ </div>
166
+ </div>
167
+ </div>
168
+
169
+ <div id="results-section" class="hidden">
170
+ <h3 class="text-2xl font-semibold text-gray-800 mb-6">Your Project Results</h3>
171
+
172
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-10">
173
+ <div class="results-card bg-white p-6 rounded-xl shadow-sm border-l-4 border-primary">
174
+ <h4 class="text-lg font-medium text-gray-700 mb-3">Total Project Cost</h4>
175
+ <p id="total-cost" class="text-3xl font-bold text-gray-900 mb-2">£0</p>
176
+ <p class="text-sm text-gray-500">Including build, fees & finance</p>
177
+ </div>
178
+
179
+ <div class="results-card bg-white p-6 rounded-xl shadow-sm border-l-4 border-secondary">
180
+ <h4 class="text-lg font-medium text-gray-700 mb-3">End Value / Annual Rent</h4>
181
+ <p id="end-value" class="text-3xl font-bold text-gray-900 mb-2">£0</p>
182
+ <p id="rental-display" class="text-sm text-gray-500 hidden">Potential annual rental income</p>
183
+ <p id="value-display" class="text-sm text-gray-500">Estimated property value after works</p>
184
+ </div>
185
+
186
+ <div class="results-card bg-white p-6 rounded-xl shadow-sm border-l-4 border-accent">
187
+ <h4 class="text-lg font-medium text-gray-700 mb-3">Profit on Sale</h4>
188
+ <p id="profit" class="text-3xl font-bold text-gray-900 mb-2">£0</p>
189
+ <p class="text-sm text-gray-500">After deducting all costs</p>
190
+ </div>
191
+ </div>
192
+
193
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-10">
194
+ <div class="bg-white p-6 rounded-xl shadow-sm">
195
+ <h4 class="text-lg font-medium text-gray-700 mb-4">ROI Metrics</h4>
196
+ <div class="space-y-4">
197
+ <div>
198
+ <div class="flex justify-between mb-1">
199
+ <span class="text-sm font-medium text-gray-700">Gross Yield</span>
200
+ <span id="gross-yield" class="text-sm font-medium text-gray-900">0%</span>
201
+ </div>
202
+ <div class="w-full bg-gray-200 rounded-full h-2">
203
+ <div id="gross-yield-bar" class="bg-secondary h-2 rounded-full" style="width: 0%"></div>
204
+ </div>
205
+ </div>
206
+ <div>
207
+ <div class="flex justify-between mb-1">
208
+ <span class="text-sm font-medium text-gray-700">Profit Margin</span>
209
+ <span id="profit-margin" class="text-sm font-medium text-gray-900">0%</span>
210
+ </div>
211
+ <div class="w-full bg-gray-200 rounded-full h-2">
212
+ <div id="profit-margin-bar" class="bg-primary h-2 rounded-full" style="width: 0%"></div>
213
+ </div>
214
+ </div>
215
+ <div>
216
+ <div class="flex justify-between mb-1">
217
+ <span class="text-sm font-medium text-gray-700">Payback Period</span>
218
+ <span id="payback-period" class="text-sm font-medium text-gray-900">0 years</span>
219
+ </div>
220
+ <div class="w-full bg-gray-200 rounded-full h-2">
221
+ <div id="payback-bar" class="bg-accent h-2 rounded-full" style="width: 0%"></div>
222
+ </div>
223
+ </div>
224
+ </div>
225
+ </div>
226
+
227
+ <div class="bg-white p-6 rounded-xl shadow-sm">
228
+ <h4 class="text-lg font-medium text-gray-700 mb-4">Cost Breakdown</h4>
229
+ <div class="space-y-3">
230
+ <div class="flex justify-between">
231
+ <span class="text-sm text-gray-600">Build Cost</span>
232
+ <span id="build-cost-display" class="text-sm font-medium text-gray-900">£0</span>
233
+ </div>
234
+ <div class="flex justify-between">
235
+ <span class="text-sm text-gray-600">Professional Fees</span>
236
+ <span id="fees-display" class="text-sm font-medium text-gray-900">£0</span>
237
+ </div>
238
+ <div class="flex justify-between">
239
+ <span class="text-sm text-gray-600">Finance Costs</span>
240
+ <span id="finance-display" class="text-sm font-medium text-gray-900">£0</span>
241
+ </div>
242
+ <div class="border-t border-gray-200 my-2"></div>
243
+ <div class="flex justify-between">
244
+ <span class="text-sm font-medium text-gray-700">Total Cost</span>
245
+ <span id="total-cost-display" class="text-sm font-medium text-gray-900">£0</span>
246
+ </div>
247
+ </div>
248
+ </div>
249
+ </div>
250
+
251
+ <div class="bg-primary-50 border border-primary-100 rounded-xl p-6 md:p-8 mb-10">
252
+ <div class="flex flex-col md:flex-row items-center">
253
+ <div class="md:w-2/3 mb-6 md:mb-0 md:pr-8">
254
+ <h3 class="text-xl font-semibold text-gray-800 mb-3">Get a Detailed Assessment</h3>
255
+ <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>
256
+ <ul class="space-y-2 text-gray-700">
257
+ <li class="flex items-start">
258
+ <i class="fas fa-check-circle text-secondary mt-1 mr-2"></i>
259
+ <span>Accurate local cost data</span>
260
+ </li>
261
+ <li class="flex items-start">
262
+ <i class="fas fa-check-circle text-secondary mt-1 mr-2"></i>
263
+ <span>Planning permission guidance</span>
264
+ </li>
265
+ <li class="flex items-start">
266
+ <i class="fas fa-check-circle text-secondary mt-1 mr-2"></i>
267
+ <span>Optimised design solutions</span>
268
+ </li>
269
+ </ul>
270
+ </div>
271
+ <div class="md:w-1/3 w-full">
272
+ <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">
273
+ Book Consultation
274
+ </button>
275
+ </div>
276
+ </div>
277
+ </div>
278
+ </div>
279
+ </div>
280
+ </main>
281
+
282
+ <footer class="bg-gray-800 text-white py-12">
283
+ <div class="container mx-auto px-4">
284
+ <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
285
+ <div>
286
+ <h3 class="text-lg font-semibold mb-4">SamPlanning</h3>
287
+ <p class="text-gray-400">UK property project specialists helping homeowners, landlords and developers maximise their returns.</p>
288
+ </div>
289
+ <div>
290
+ <h3 class="text-lg font-semibold mb-4">Services</h3>
291
+ <ul class="space-y-2 text-gray-400">
292
+ <li><a href="#" class="hover:text-white">Planning Applications</a></li>
293
+ <li><a href="#" class="hover:text-white">Project Management</a></li>
294
+ <li><a href="#" class="hover:text-white">Cost Consultancy</a></li>
295
+ <li><a href="#" class="hover:text-white">HMO Conversions</a></li>
296
+ </ul>
297
+ </div>
298
+ <div>
299
+ <h3 class="text-lg font-semibold mb-4">Contact</h3>
300
+ <ul class="space-y-2 text-gray-400">
301
+ <li class="flex items-start">
302
+ <i class="fas fa-phone-alt mt-1 mr-2 text-gray-300"></i>
303
+ <span>020 1234 5678</span>
304
+ </li>
305
+ <li class="flex items-start">
306
+ <i class="fas fa-envelope mt-1 mr-2 text-gray-300"></i>
307
+ <span>[email protected]</span>
308
+ </li>
309
+ <li class="flex items-start">
310
+ <i class="fas fa-map-marker-alt mt-1 mr-2 text-gray-300"></i>
311
+ <span>London, UK</span>
312
+ </li>
313
+ </ul>
314
+ </div>
315
+ <div>
316
+ <h3 class="text-lg font-semibold mb-4">Legal</h3>
317
+ <ul class="space-y-2 text-gray-400">
318
+ <li><a href="#" class="hover:text-white">Privacy Policy</a></li>
319
+ <li><a href="#" class="hover:text-white">Terms of Service</a></li>
320
+ <li><a href="#" class="hover:text-white">Cookies</a></li>
321
+ </ul>
322
+ </div>
323
+ </div>
324
+ <div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-400">
325
+ <p>© 2023 SamPlanning. All rights reserved.</p>
326
+ </div>
327
+ </div>
328
+ </footer>
329
+
330
+ <script>
331
+ // Tab switching functionality
332
+ const homeownerTab = document.getElementById('homeowner-tab');
333
+ const landlordTab = document.getElementById('landlord-tab');
334
+ const developerTab = document.getElementById('developer-tab');
335
+
336
+ const tabs = [homeownerTab, landlordTab, developerTab];
337
+
338
+ tabs.forEach(tab => {
339
+ tab.addEventListener('click', () => {
340
+ tabs.forEach(t => t.classList.remove('tab-active', 'text-primary'));
341
+ tabs.forEach(t => t.classList.add('text-gray-600'));
342
+
343
+ tab.classList.add('tab-active', 'text-primary');
344
+ tab.classList.remove('text-gray-600');
345
+
346
+ // Update the form based on selected tab
347
+ updateFormForUserType(tab.id);
348
+ });
349
+ });
350
+
351
+ function updateFormForUserType(tabId) {
352
+ const rentalIncomeField = document.getElementById('rental-income');
353
+ const rentalDisplay = document.getElementById('rental-display');
354
+ const valueDisplay = document.getElementById('value-display');
355
+
356
+ if (tabId === 'landlord-tab') {
357
+ rentalIncomeField.placeholder = "e.g. 2500";
358
+ rentalDisplay.classList.remove('hidden');
359
+ valueDisplay.classList.add('hidden');
360
+ } else {
361
+ rentalIncomeField.placeholder = "e.g. 1200";
362
+ rentalDisplay.classList.add('hidden');
363
+ valueDisplay.classList.remove('hidden');
364
+ }
365
+ }
366
+
367
+ // Cost calculator button
368
+ document.getElementById('cost-calculator-btn').addEventListener('click', () => {
369
+ const projectType = document.getElementById('project-type').value;
370
+ const size = parseFloat(document.getElementById('size').value) || 0;
371
+ const quality = document.getElementById('quality').value;
372
+
373
+ // Basic cost estimation logic
374
+ let costPerSqFt;
375
+
376
+ switch(quality) {
377
+ case 'basic':
378
+ costPerSqFt = 120;
379
+ break;
380
+ case 'standard':
381
+ costPerSqFt = 180;
382
+ break;
383
+ case 'premium':
384
+ costPerSqFt = 250;
385
+ break;
386
+ case 'luxury':
387
+ costPerSqFt = 350;
388
+ break;
389
+ default:
390
+ costPerSqFt = 180;
391
+ }
392
+
393
+ // Adjust for project type
394
+ if (projectType === 'loft') costPerSqFt *= 1.2;
395
+ if (projectType === 'hmo') costPerSqFt *= 0.9;
396
+ if (projectType === 'newbuild') costPerSqFt *= 0.85;
397
+
398
+ const estimatedCost = Math.round(size * costPerSqFt);
399
+
400
+ if (estimatedCost > 0) {
401
+ document.getElementById('build-cost').value = estimatedCost;
402
+
403
+ // Estimate professional fees as 15% of build cost
404
+ document.getElementById('fees').value = Math.round(estimatedCost * 0.15);
405
+ }
406
+ });
407
+
408
+ // Main calculation function
409
+ document.getElementById('calculate-btn').addEventListener('click', calculateROI);
410
+
411
+ function calculateROI() {
412
+ const currentValue = parseFloat(document.getElementById('current-value').value) || 0;
413
+ const buildCost = parseFloat(document.getElementById('build-cost').value) || 0;
414
+ const fees = parseFloat(document.getElementById('fees').value) || 0;
415
+ const financeCost = parseFloat(document.getElementById('finance-cost').value) || 0;
416
+ const rentalIncome = parseFloat(document.getElementById('rental-income').value) || 0;
417
+ const projectType = document.getElementById('project-type').value;
418
+ const size = parseFloat(document.getElementById('size').value) || 0;
419
+
420
+ // Calculate total cost
421
+ const totalCost = buildCost + fees + financeCost;
422
+
423
+ // Estimate end value based on project type and size
424
+ let valueIncrease;
425
+
426
+ switch(projectType) {
427
+ case 'extension':
428
+ valueIncrease = size * 500; // £500/sq ft value increase
429
+ break;
430
+ case 'loft':
431
+ valueIncrease = size * 600;
432
+ break;
433
+ case 'hmo':
434
+ valueIncrease = currentValue * 0.3; // 30% increase for HMO conversion
435
+ break;
436
+ case 'newbuild':
437
+ valueIncrease = size * 700;
438
+ break;
439
+ case 'refurb':
440
+ valueIncrease = currentValue * 0.25;
441
+ break;
442
+ default:
443
+ valueIncrease = size * 500;
444
+ }
445
+
446
+ const endValue = currentValue + valueIncrease;
447
+
448
+ // Calculate profit
449
+ const profit = endValue - currentValue - totalCost;
450
+
451
+ // Calculate ROI metrics
452
+ const grossYield = rentalIncome > 0 ? ((rentalIncome * 12) / (currentValue + totalCost)) * 100 : 0;
453
+ const profitMargin = (profit / totalCost) * 100;
454
+ const paybackPeriod = rentalIncome > 0 ? totalCost / (rentalIncome * 12) : 0;
455
+
456
+ // Update results display
457
+ document.getElementById('total-cost').textContent = `£${totalCost.toLocaleString()}`;
458
+ document.getElementById('end-value').textContent = `£${endValue.toLocaleString()}`;
459
+ document.getElementById('profit').textContent = `£${profit.toLocaleString()}`;
460
+
461
+ document.getElementById('gross-yield').textContent = `${grossYield.toFixed(1)}%`;
462
+ document.getElementById('profit-margin').textContent = `${profitMargin.toFixed(1)}%`;
463
+ document.getElementById('payback-period').textContent = `${paybackPeriod.toFixed(1)} years`;
464
+
465
+ // Update progress bars
466
+ document.getElementById('gross-yield-bar').style.width = `${Math.min(grossYield, 30)}%`;
467
+ document.getElementById('profit-margin-bar').style.width = `${Math.min(profitMargin, 100)}%`;
468
+ document.getElementById('payback-bar').style.width = `${Math.min(paybackPeriod * 10, 100)}%`;
469
+
470
+ // Update cost breakdown
471
+ document.getElementById('build-cost-display').textContent = `£${buildCost.toLocaleString()}`;
472
+ document.getElementById('fees-display').textContent = `£${fees.toLocaleString()}`;
473
+ document.getElementById('finance-display').textContent = `£${financeCost.toLocaleString()}`;
474
+ document.getElementById('total-cost-display').textContent = `£${totalCost.toLocaleString()}`;
475
+
476
+ // Show results section
477
+ document.getElementById('results-section').classList.remove('hidden');
478
+
479
+ // Scroll to results
480
+ document.getElementById('results-section').scrollIntoView({ behavior: 'smooth' });
481
+ }
482
+
483
+ // Book consultation button
484
+ document.getElementById('book-consultation-btn').addEventListener('click', () => {
485
+ alert('Thank you for your interest! A SamPlanning representative will contact you shortly to schedule your consultation.');
486
+ });
487
+ </script>
488
+ <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>
489
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Create a responsive, UK-focused cost & ROI calculator that lets homeowners, landlords and small developers estimate: • total build cost for a domestic project (extension, loft-conversion, HMO conversion, new-build) • likely end value or annual rental income • headline ROI metrics (profit on sale, gross yield, payback period) The tool must feel authoritative, quick, and lead users toward booking a consultation with SamPlanning.