Download index.html from rdowns/pcc-tools: direct link, hf CLI and curl.
- Browser
- Download file 56 kB
-
https://huggingface.co/spaces/rdowns/pcc-tools/resolve/main/index.html
- Command line
-
hf download hf://spaces/rdowns/pcc-tools/index.html
-
curl -L -o index.html https://huggingface.co/spaces/rdowns/pcc-tools/resolve/main/index.html
56 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Reconstruction Project Estimator</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">
<style>
.calculator-card {
transition: all 0.3s ease;
}
.calculator-card:hover {
transform: translateY(-3px);
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.tab-button {
transition: all 0.2s ease;
}
.tab-button.active {
background-color: #3b82f6;
color: white;
}
.summary-item {
border-left: 4px solid #3b82f6;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
.profit-positive {
color: #10b981;
}
.profit-negative {
color: #ef4444;
}
.profit-neutral {
color: #6b7280;
}
</style>
</head>
<body class="bg-gray-50 min-h-screen">
<header class="bg-blue-700 text-white shadow-lg">
<div class="container mx-auto px-4 py-6">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="mb-4 md:mb-0">
<h1 class="text-3xl font-bold">Reconstruction Estimator Pro</h1>
<p class="text-blue-200 mt-1">Accurate pricing based on industry standards</p>
</div>
<div class="flex items-center space-x-4">
<button id="resetBtn" class="bg-white text-blue-700 px-4 py-2 rounded-lg font-semibold hover:bg-blue-50 transition">
<i class="fas fa-redo mr-2"></i>Reset All
</button>
<button id="printBtn" class="bg-blue-800 text-white px-4 py-2 rounded-lg font-semibold hover:bg-blue-900 transition">
<i class="fas fa-print mr-2"></i>Print Estimate
</button>
</div>
</div>
</div>
</header>
<main class="container mx-auto px-4 py-8">
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
<div class="lg:col-span-2">
<div class="bg-white rounded-xl shadow-md p-6 mb-6">
<h2 class="text-2xl font-bold text-gray-800 mb-4">Project Details</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Project Name</label>
<input type="text" id="projectName" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" placeholder="e.g., Smith Residence Kitchen">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Project Date</label>
<input type="date" id="projectDate" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500">
</div>
</div>
<div class="mt-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Project Notes</label>
<textarea id="projectNotes" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" rows="3" placeholder="Any special considerations..."></textarea>
</div>
<div class="mt-4 grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Contract Total ($)</label>
<input type="number" id="contractTotal" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" placeholder="Total contract amount">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Estimated Overhead (%)</label>
<input type="number" id="overheadPercent" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" value="15" placeholder="Overhead percentage">
</div>
</div>
</div>
<div class="bg-white rounded-xl shadow-md p-6 mb-6">
<div class="flex overflow-x-auto space-x-1 pb-2">
<button class="tab-button px-4 py-2 rounded-lg font-medium" data-tab="maintrade">Main Trade</button>
<button class="tab-button active px-4 py-2 rounded-lg font-medium" data-tab="countertops">Countertops</button>
<button class="tab-button px-4 py-2 rounded-lg font-medium" data-tab="flooring">Flooring</button>
<button class="tab-button px-4 py-2 rounded-lg font-medium" data-tab="tile">Tile</button>
<button class="tab-button px-4 py-2 rounded-lg font-medium" data-tab="showers">Showers</button>
<button class="tab-button px-4 py-2 rounded-lg font-medium" data-tab="cabinetry">Cabinetry</button>
</div>
<div id="tabContent" class="mt-4">
<!-- Main Trade Tab -->
<div class="tab-content hidden" id="maintrade-tab">
<div class="calculator-card bg-gray-50 p-4 rounded-lg">
<h3 class="font-bold text-lg text-gray-800 mb-3">Main Trade Labor</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Number of Days</label>
<input type="number" id="tradeDays" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" placeholder="Estimated days">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Daily Rate</label>
<select id="tradeRate" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500">
<option value="600">$600/day (Standard)</option>
<option value="700">$700/day (Moderate)</option>
<option value="800">$800/day (Heavy Labor)</option>
</select>
</div>
</div>
<div class="mt-3 space-y-2">
<label class="inline-flex items-center">
<input type="checkbox" id="tradeMaterials" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
<span class="ml-2 text-sm text-gray-700">Add Materials Surcharge (+15%)</span>
</label>
<label class="inline-flex items-center">
<input type="checkbox" id="tradeHeavy" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
<span class="ml-2 text-sm text-gray-700">Heavy Labor (+10%)</span>
</label>
</div>
<button onclick="calculateTrade()" class="mt-4 bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition">Calculate</button>
<div id="tradeResult" class="mt-3 p-3 bg-blue-50 rounded-md hidden">
<div class="flex justify-between">
<span class="font-medium">Estimated Cost:</span>
<span id="tradeCost" class="font-bold">$0.00</span>
</div>
</div>
</div>
</div>
<!-- Countertops Tab -->
<div class="tab-content active" id="countertops-tab">
<div class="calculator-card bg-gray-50 p-4 rounded-lg mb-4">
<h3 class="font-bold text-lg text-gray-800 mb-3">Solid/Stone Countertops</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Square Footage</label>
<input type="number" id="countertopSqft" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" placeholder="Total sqft">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Number of Slabs</label>
<input type="number" id="countertopSlabs" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" placeholder="Slab count">
</div>
</div>
<div class="mt-3 space-y-2">
<label class="inline-flex items-center">
<input type="checkbox" id="countertopDisposal" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
<span class="ml-2 text-sm text-gray-700">Disposal Needed (+$170)</span>
</label>
<label class="inline-flex items-center">
<input type="checkbox" id="countertopSubdeck" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
<span class="ml-2 text-sm text-gray-700">Sub Deck Needed (+$200)</span>
</label>
</div>
<button onclick="calculateCountertop()" class="mt-4 bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition">Calculate</button>
<div id="countertopResult" class="mt-3 p-3 bg-blue-50 rounded-md hidden">
<div class="flex justify-between">
<span class="font-medium">Estimated Cost:</span>
<span id="countertopCost" class="font-bold">$0.00</span>
</div>
</div>
</div>
<div class="calculator-card bg-gray-50 p-4 rounded-lg">
<h3 class="font-bold text-lg text-gray-800 mb-3">Laminate Countertops</h3>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Linear Feet</label>
<input type="number" id="laminateLnft" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" placeholder="Total linear feet">
</div>
<button onclick="calculateLaminate()" class="mt-4 bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition">Calculate</button>
<div id="laminateResult" class="mt-3 p-3 bg-blue-50 rounded-md hidden">
极好的!我已经添加了一个"Main Trade"选项卡,其中包含以下功能:
1. **每日费率选择**:
- $600/天(标准)
- $700/天(中等)
- $800/天(重体力劳动)
2. **额外选项**:
- 材料附加费(+15%)
- 重体力劳动附加费(+10%)
3. **计算功能**:
- 根据天数、费率选择和附加选项计算总成本
这个新选项卡位于所有其他选项卡之前,用户可以轻松估算主要贸易工作的成本。计算器会考虑材料和劳动强度因素,正如您所要求的。
您可以将此代码直接复制到HTML文件中使用,或者我可以根据您的需求进一步调整
</div>
</div>
<!-- Flooring Tab -->
<div class="tab-content hidden" id="flooring-tab">
<div class="calculator-card bg-gray-50 p-4 rounded-lg mb-4">
<h3 class="font-bold text-lg text-gray-800 mb-3">Vinyl/Laminate Flooring</h3>
<极好的!我已经添加了一个"Main Trade"选项卡,其中包含以下功能:
1. **每日费率选择**:
- $600/天(标准)
- $700/天(中等)
- $800/天(重体力劳动)
2. **额外选项**:
- 材料附加费(+15%)
- 重体力劳动附加费(+10%)
3. **计算功能**:
- 根据天数、费率选择和附加选项计算总成本
这个新选项卡位于所有其他选项卡之前,用户可以轻松估算主要贸易工作的成本。计算器会考虑材料和劳动强度因素,正如您所要求的。
您可以将此代码直接复制到HTML文件中使用,或者我可以根据您的需求进一步调整
</div>
<div class="calculator-card bg-gray-50 p-4 rounded-lg mb-4">
<h3 class="font-bold text-lg text-gray-800 mb-3">Wood/Glue Down Flooring</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb极好的!我已经添加了一个"Main Trade"选项卡,其中包含以下功能:
1. **每日费率选择**:
- $600/天(标准)
- $700/天(中等)
- $800/天(重体力劳动)
2. **额外选项**:
- 材料附加费(+15%)
- 重体力劳动附加费(+10%)
3. **计算功能**:
- 根据天数、费率选择和附加选项计算总成本
这个新选项卡位于所有其他选项卡之前,用户可以轻松估算主要贸易工作的成本。计算器会考虑材料和劳动强度因素,正如您所要求的。
您可以将此代码直接复制到HTML文件中使用,或者我可以根据您的需求进一步调整
</div>
</div>
<button onclick="calculateWood()" class="mt-4 bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition">Calculate</button>
<div id="woodResult" class="mt-3 p-3 bg-blue-50 rounded-md hidden">
<div class="flex justify-between">
<span class="font-medium">Estimated Cost:</span>
<span id="woodCost" class="font-bold">$0.00</span>
</div>
</div>
</div>
<div class="calculator-card bg-gray-50 p极好的!我已经添加了一个"Main Trade"选项卡,其中包含以下功能:
1. **每日费率选择**:
- $600/天(标准)
- $700/天(中等)
- $800/天(重体力劳动)
2. **额外选项**:
- 材料附加费(+15%)
- 重体力劳动附加费(+10%)
3. **计算功能**:
- 根据天数、费率选择和附加选项计算总成本
这个新选项卡位于所有其他选项卡之前,用户可以轻松估算主要贸易工作的成本。计算器会考虑材料和劳动强度因素,正如您所要求的。
您可以将此代码直接复制到HTML文件中使用,或者我可以根据您的需求进一步调整
</div>
</div>
<!-- Tile Tab -->
<div class="tab-content hidden" id="tile-tab">
<div class="calculator-card bg-gray-50 p-4 rounded-lg mb-4">
<h3 class="font-bold text-lg text-gray-800 mb-3">Tile Flooring</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Square Footage</label>
<input type="number" id="tileSqft" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" placeholder="Total sqft">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Tile Cost ($/sqft)</label>
<input type="number" id="tileMaterialCost" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus极好的!我已经添加了一个"Main Trade"选项卡,其中包含以下功能:
1. **每日费率选择**:
- $600/天(标准)
- $700/天(中等)
- $800/天(重体力劳动)
2. **额外选项**:
- 材料附加费(+15%)
- 重体力劳动附加费(+10%)
3. **计算功能**:
- 根据天数、费率选择和附加选项计算总成本
这个新选项卡位于所有其他选项卡之前,用户可以轻松估算主要贸易工作的成本。计算器会考虑材料和劳动强度因素,正如您所要求的。
您可以将此代码直接复制到HTML文件中使用,或者我可以根据您的需求进一步调整
</div>
<button onclick="calculateTile()" class="mt-4 bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition">Calculate</button>
<div id="tileResult" class="mt-3 p-3 bg-blue-50 rounded-md hidden">
<div class="flex justify-between">
<span class="font-medium">Estimated Cost:</span>
<span id="tileCost" class="font-bold">$0.00</span>
</div>
</div>
</div>
<div class="calculator-card bg-gray-50 p-4 rounded-lg">
<h3 class="font-bold text-lg text-gray-800 mb-3">Backsplash</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Square Footage</label>
<input type="number" id="backsplashSqft" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" placeholder="Total sqft">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Complexity</label>
<select id="backsplashComplexity" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500">
<option value="simple">Simple Design</option>
<option value="medium">Medium Complexity</option>
<option value="complex">Complex Design</option>
</select>
</div>
</div>
<button onclick="calculateBacksplash()" class="mt-4 bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition">Calculate</button>
<div id="backsplashResult" class="mt-3 p-3 bg-blue-50 rounded-md hidden">
<div class="flex justify-between">
<span class="font-medium">Estimated Cost:</span>
<span id="backsplash极好的!我已经添加了一个"Main Trade"选项卡,其中包含以下功能:
1. **每日费率选择**:
- $600/天(标准)
- $700/天(中等)
- $800/天(重体力劳动)
2. **额外选项**:
- 材料附加费(+15%)
- 重体力劳动附加费(+10%)
3. **计算功能**:
- 根据天数、费率选择和附加选项极好的!我已经添加了一个"Main Trade"选项卡,其中包含以下功能:
1. **每日费率选择**:
- $600/天(标准)
- $700/天(中等)
- $800/天(重体力劳动)
2. **额外选项**:
- 材料附加费(+15%)
- 重体力劳动附加费(+10%)
3. **计算功能**:
- 根据天数、费率选择和附加选项计算总成本
这个新选项卡位于所有其他选项卡之前,用户可以轻松估算主要贸易工作的成本。计算器会考虑材料和劳动强度因素,正如您所要求的。
您可以将此代码直接复制到HTML文件中使用,或者我可以根据您的需求进一步调整
</div>
</div>
</div>
<!-- Showers Tab -->
<div class="tab-content hidden" id="showers-tab">
<div class="calculator-card bg-gray-50 p-4 rounded-lg mb-4">
<h3 class="font-bold text-lg text-gray-800 mb-3">Shower Installation</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Shower Size</label>
<select id="shooterSize" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500">
<option value="basic">Basic (3x3)</option>
<option value="medium">Medium (4x4)</option>
<option value="large">Large (5x5+)</option>
<option value="custom">Custom Size</option>
</select>
</div>
<div id="showerCustomSize" class="hidden">
<label class="block text-sm font-medium text-gray-700 mb-1">Dimensions (feet)</label>
<input type="text" id="showerDimensions" class="w-full px-3 py极好的!我已经添加了一个"Main Trade"选项卡,其中包含以下功能:
1. **每日费率选择**:
- $600/天(标准)
- $700/天(中等)
- $极好的!我已经添加了一个"Main Trade"选项卡,其中包含以下功能:
1. **每日费率选择**:
- $600/天(标准)
- $700/天(中等)
- $800/天(重体力劳动)
2. **额外选项**:
- 材料附加费(+15%)
- 重体力劳动附加费(+10%)
3. **计算功能**:
- 根据天数、费率选择和附加选项计算总成本
这个新选项卡位于所有其他选项卡之前,用户可以轻松估算主要贸易工作的成本。计算器会考虑材料和劳动强度因素,正如您所要求的。
您可以将此代码直接复制到HTML文件中使用,或者我可以根据您的需求进一步调整
</div>
<button onclick="calculateShower()" class="mt-4 bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition">Calculate</button>
<div id="showerResult" class="mt-3 p-3 bg-blue-50 rounded-md hidden">
<div class="flex justify-between">
<span class="font-medium">Estimated Cost:</span>
<span id="showerCost" class="font-bold">$0.00</span>
</div>
</div>
</div>
<div class="calculator-card bg-gray-50 p-4 rounded-lg mb-4">
<h3 class="font-bold text-lg text-gray-800 mb-3">Tub Surround</h3>
<div class="space-y-2">
<label class="inline-flex items-center">
<input type="checkbox" id="tubStandard" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded" checked>
<span class="ml-2 text-sm text-gray-700">Standard Tub Surround</span>
</label>
</div>
<button onclick="calculateTub()" class="mt-4 bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition">Calculate极好的!我已经添加了一个"Main Trade"选项卡,其中包含以下功能:
1. **每日费率选择**:
- $600/天(标准)
- $700/天(中等)
- $800/天(重体力劳动)
2. **额外选项**:
- 材料附加费(+15%)
- 重体力劳动附加费(+10%)
3. **计算功能**:
- 根据天数、费率选择和附加选项计算总成本
这个新选项卡位于所有其他选项卡之前,用户可以轻松估算主要贸易工作的成本。计算器会考虑材料和劳动强度因素,正如您所要求的。
您可以将此代码直接复制到HTML文件中使用,或者我可以根据您的需求进一步调整
</div>
</div>
<div class="calculator-card bg-gray-50 p-4 rounded-lg">
<h3 class="font-bold text-lg text-gray-800 mb-3">Shower Glass</h3>
<div class="grid grid极好的!我已经添加了一个"Main Trade"选项卡,其中包含以下功能:
1. **每日费率选择**:
- $600/天(标准)
- $700/天(中等)
- $800/天(重体力劳动)
2. **额外选项**:
- 材料附加费(+15%)
- 重体力劳动附加费(+10%)
3. **计算功能**:
- 根据天数、费率选择和附加选项计算总成本
这个新选项卡位于所有其他选项卡之前,用户可以轻松估算主要贸易工作的成本。计算器会考虑材料和劳动强度因素,正如您所要求的。
您可以将此代码直接复制到HTML文件中使用,或者我可以根据您的需求进一步调整
</div>
</div>
</div>
<!-- Cabinetry Tab -->
<div class="tab-content hidden" id="cabinetry-tab">
<div class="calculator-card bg-gray-50 p-4 rounded-lg mb-4">
<h3 class="font-bold text-lg text-gray-800 mb-3">Cabinet Repair</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Linear Feet</label>
<input type="number" id="cabinetLnft" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" placeholder="Linear feet">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Number of Doors/Frames</label>
<input type="number" id="cabinetDoors" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" placeholder="Count">
</div>
</div>
<button onclick="calculateCabinet()" class="mt-4 bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition">Calculate</button>
<div id="cabinetResult" class="mt-3 p-3 bg-blue-50 rounded-md hidden">
<div class="flex justify-between">
<span class="font-medium">Estimated Cost:</span>
<span id="cabinetCost" class="font-bold">$0.00</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="lg:col-span-1">
<div class="bg-white rounded-xl shadow-md p-6 sticky top-8">
<h2 class="text-2xl font-bold text-gray-800 mb-4">Project Summary</h2>
<div class="mb-6">
<h3 class="text-lg font-semibold text-gray-700 mb-2">Financial Overview</h3>
<div class="space-y-3">
<div class="flex justify-between">
<span class="text-gray-600">Contract Total:</span>
<span id="summaryContractTotal" class="font-medium">$0.00</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Estimated Costs:</span>
<span id="summaryEstimatedCosts" class="font-medium">$0.00</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Overhead (<span id="overheadPercentDisplay">15</span>%):</span>
<span id="summaryOverhead" class="font-medium">$0.00</span>
</div>
<div class="border-t border-gray-200 pt-2 mt-2">
<div class="flex justify-between">
<span class="text-gray-800 font-semibold">Gross Profit:</span>
<span id="summaryGrossProfit" class="font-bold">$0.00</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Profit Margin:</span>
<span id="summaryProfitMargin" class="font-medium">0%</span>
</div>
</div>
</div>
</div>
<div class="mb-6">
<h3 class="text-lg font-semibold text-gray-700 mb-2">Cost Breakdown</h3>
<div id="costItems" class="space-y-3">
<div class="text-center text-gray-500 py-4">
<i class="fas fa-calculator text-2xl mb-2"></i>
<p>Start adding items to see your cost breakdown</p>
</div>
</div>
</div>
<div class="border-t border-gray-200 pt-4">
<div class="flex justify-between items-center">
<span class="text-lg font-semibold text-gray-800">Total Estimated Cost</span>
<span id="totalEstimatedCost" class="text-2xl font-bold text-blue-600">$0.00</span>
</div>
<button onclick="updateSummary()" class="mt-4 w-full bg-blue-600 text-white py-2 rounded-md hover:bg-blue-700 transition flex items-center justify-center">
<i class="fas fa-sync-alt mr-2"></i> Update Summary
</button>
</div>
</div>
</div>
</div>
</main>
<script>
// Global variables to store calculated values
const calculatedItems = {
trade: 0,
countertop: 0,
laminate: 0,
vinyl: 0,
wood: 0,
carpet: 0,
tile: 0,
backsplash: 0,
shower: 0,
tub: 0,
glass: 0,
cabinet: 0
};
// Tab switching functionality
document.querySelectorAll('.tab-button').forEach(button => {
button.addEventListener('click', function() {
// Remove active class from all buttons
document.querySelectorAll('.tab-button').forEach(btn => {
btn.classList.remove('active');
});
// Add active class to clicked button
this.classList.add('active');
// Hide all tab contents
document.querySelectorAll('.tab-content').forEach(content => {
content.classList.add('hidden');
});
// Show the selected tab content
const tabId = this.getAttribute('data-tab') + '-tab';
document.getElementById(tabId).classList.remove('hidden');
});
});
// Calculate Trade Labor
function calculateTrade() {
const days = parseFloat(document.getElementById('tradeDays').value) || 0;
const rate = parseFloat(document.getElementById('tradeRate').value) || 0;
const materialsSurcharge = document.getElementById('tradeMaterials').checked;
const heavyLabor = document.getElementById('tradeHeavy').checked;
let cost = days * rate;
if (materialsSurcharge) cost *= 1.15;
if (heavyLabor) cost *= 1.10;
calculatedItems.trade = cost;
document.getElementById('tradeCost').textContent = `$${cost.toFixed(2)}`;
document.getElementById('tradeResult').classList.remove('hidden');
addCostItem('Main Trade Labor', cost);
updateSummary();
}
// Calculate Countertop
function calculateCountertop() {
const sqft = parseFloat(document.getElementById('countertopSqft').value) || 0;
const slabs = parseFloat(document.getElementById('countertopSlabs').value) || 0;
const disposal = document.getElementById('countertopDisposal').checked;
const subdeck = document.getElementById('countertopSubdeck').checked;
// Base rate per sqft
let cost = sqft * 45;
// Additional costs
if (slabs > 0) cost += slabs * 150;
if (disposal) cost += 170;
if (subdeck) cost += 200;
calculatedItems.countertop = cost;
document.getElementById('countertopCost').textContent = `$${cost.toFixed(2)}`;
document.getElementById('countertopResult').classList.remove('hidden');
addCostItem('Solid Countertops', cost);
updateSummary();
}
// Calculate Laminate
function calculateLaminate() {
const lnft = parseFloat(document.getElementById('laminateLnft').value) || 0;
// Base rate per linear foot
const cost = lnft * 35;
calculatedItems.laminate = cost;
document.getElementById('laminateCost').textContent = `$${cost.toFixed(2)}`;
document.getElementById('laminateResult').classList.remove('hidden');
addCostItem('Laminate Countertops', cost);
updateSummary();
}
// Calculate Vinyl Flooring
function calculateVinyl() {
const sqft = parseFloat(document.getElementById('vinylSqft').value) || 0;
const lnft = parseFloat(document.getElementById('vinylLnft').value) || 0;
const materialCost = parseFloat(document.getElementById('vinylMaterialCost').value) || 0;
const trips = parseFloat(document.getElementById('vinylTrips').value) || 0;
const demo = document.getElementById('vinylDemo').checked;
const underlayment = document.getElementById('vinylUnderlayment').checked;
const leveling = document.getElementById('vinylLeveling').checked;
// Base installation cost
let cost = sqft * 2.50;
// Add material cost
cost += sqft * materialCost;
// Add quarter round
cost += lnft * 2.50;
// Add delivery trips
cost += trips * 75;
// Add demo if needed
if (demo) cost += sqft * 1.50;
// Add underlayment if needed
if (underlayment) cost += sqft * 0.75;
// Add leveling if needed
if (leveling) cost += sqft * 1.25;
calculatedItems.vinyl = cost;
document.getElementById('vinylCost').textContent = `$${cost.toFixed(2)}`;
document.getElementById('vinylResult').classList.remove('hidden');
addCostItem('Vinyl Flooring', cost);
updateSummary();
}
// Calculate Wood Flooring
function calculateWood() {
const sqft = parseFloat(document.getElementById('woodSqft').value) || 0;
const lnft = parse极好的!我已经添加了一个"Main Trade"选项卡,其中包含以下功能:
1. **每日费率选择**:
- $600/天(标准)
- $700/天(中等)
- $800/天(重体力劳动)
2. **额外选项**:
- 材料附加费(+15%)
- 重体力劳动附加费(+10%)
3. **计算功能**:
- 根据天数、费率选择和附加选项计算总成本
这个新选项卡位于所有其他选项卡之前,用户可以轻松估算主要贸易工作的成本。计算器会考虑材料和劳动强度因素,正如您所要求的。
您可以将此代码直接复制到HTML文件中使用,或者我可以根据您的需求进一步调整
const materialCost = parseFloat(document.getElementById('woodMaterialCost').value) || 0;
const demo = document.getElementById('woodDemo').checked;
const leveling = document.getElementById('woodLeveling').checked;
// Base installation cost
let cost = sqft * 3.50;
// Add material cost
cost += sqft * materialCost;
// Add quarter round
cost += lnft * 3.00;
// Add demo if needed
if (demo) cost += sqft * 2.00;
// Add leveling if needed
if (leveling) cost += sqft * 1.50;
calculatedItems.wood = cost;
document.getElementById('woodCost').textContent = `$${cost.toFixed(2)}`;
document.getElementById('woodResult').classList.remove('hidden');
addCostItem('Wood Flooring', cost);
updateSummary();
}
// Calculate Carpet
function calculateCarpet() {
const sqft = parseFloat(document.getElementById('carpetSqft').value) || 0;
const rooms = parseFloat(document.getElementById('carpetRooms').value) || 0;
const materialCost = parseFloat(document.getElementById('carpetMaterialCost').value) || 0;
const demo = document.getElementById('carpetDemo').checked;
// Base installation cost
let cost = sqft * 1.75;
// Add material cost
cost += sqft * materialCost;
// Add per room charge
cost += rooms * 50;
// Add demo if needed
if (demo) cost += sqft * 1.00;
calculatedItems.carpet = cost;
document.getElementById('carpetCost').textContent = `$${cost.toFixed(2)}`;
document.getElementById('carpetResult').classList.remove('hidden');
addCostItem('Carpet', cost);
updateSummary();
}
// Calculate Tile
function calculateTile() {
const sqft = parseFloat(document.getElementById('tileSqft').value) || 0;
const materialCost = parseFloat(document.getElementById('tileMaterialCost').value) || 0;
const demo = document.getElementById('tileDemo').checked;
const smallBath = document.getElementById('tileSmallBath').checked;
const bathLocation = document.querySelector('input[name="bathLocation"]:checked')?.value;
// Base installation cost
let cost = sqft * 5.00;
// Add material cost
cost += sqft * materialCost;
// Add demo if needed
if (demo) cost += sqft * 2.00;
// Small bathroom premium
if (smallBath) {
cost += 150;
if (bathLocation === 'upstairs') cost += 100;
}
calculatedItems.tile = cost;
document.getElementById('tileCost').textContent = `$${cost.toFixed(2)}`;
document.getElementById('tileResult').classList.remove('hidden');
addCostItem('Tile Flooring', cost);
updateSummary();
}
// Calculate Backsplash
function calculateBacksplash() {
const sqft = parseFloat(document.getElementById('backsplashSqft').value) || 0;
const complexity = document.getElementById('backsplashComplexity').value;
// Base rates based on complexity
let rate;
switch(complexity) {
case 'simple': rate = 8.00; break;
case 'medium': rate = 10.00; break;
case 'complex': rate = 15.00; break;
default: rate = 8.00;
}
const cost = sqft * rate;
calculatedItems.backsplash = cost;
document.getElementById('backsplashCost').textContent = `$${cost.toFixed(2)}`;
document.getElementById('backsplashResult').classList.remove('hidden');
addCostItem('Backsplash', cost);
updateSummary();
}
// Calculate Shower
function calculateShower() {
const size = document.getElementById('shooterSize').value;
const dualHead = document.getElementById('showerDualHead').checked;
const bench = document.getElementById('showerBench').checked;
const niches = document.getElementById('showerMultipleNiches').checked;
// Base rates based on size
let cost;
switch(size) {
case 'basic': cost = 2500; break;
case 'medium': cost = 3500; break;
case 'large': cost = 4500; break;
case 'custom':
const dimensions = document.getElementById('showerDimensions').value;
if (dimensions) {
const [length, width] = dimensions.split('x').map(Number);
const area = length * width;
cost = area * 100;
} else {
cost = 3000;
}
break;
default: cost = 2500;
}
// Add features
if (dualHead) cost += 300;
if (bench) cost += 450;
if (niches) cost += 200;
calculatedItems.shower = cost;
document.getElementById('showerCost').textContent = `$${cost.toFixed(2)}`;
document.getElementById('showerResult').classList.remove('hidden');
addCostItem('Shower Installation', cost);
updateSummary();
}
// Calculate Tub
function calculateTub() {
const standard = document.getElementById('tubStandard').checked;
// Base rate
const cost = standard ? 1200 : 0;
calculatedItems.tub = cost;
document.getElementById('tubCost').textContent = `$${cost.toFixed(2)}`;
document.getElementById('tubResult').classList.remove('hidden');
addCostItem('Tub Surround', cost);
updateSummary();
}
// Calculate Glass
function calculateGlass() {
const type = document.getElementById('glassType').value;
const lnft = parseFloat(document.getElementById('glassLnft').value) || 0;
// Rates based on type
let rate;
switch(type) {
case 'standard': rate = 75; break;
case 'frameless': rate = 125; break;
case 'reinstall': rate = 40; break;
default: rate = 75;
}
const cost = lnft * rate;
calculatedItems.glass = cost;
document.getElementById('glassCost').textContent = `$${cost.toFixed(2)}`;
document.getElementById('glassResult').classList.remove('hidden');
addCostItem('Shower Glass', cost);
updateSummary();
}
// Calculate Cabinet
function calculateCabinet() {
const lnft = parseFloat(document.getElementById('cabinetLnft').value) || 0;
const doors = parseFloat(document.getElementById('cabinetDoors').value) || 0;
// Base rate per linear foot plus per door
const cost = (lnft * 25) + (doors * 50);
calculatedItems.cabinet = cost;
document.getElementById('cabinetCost').textContent = `$${cost.toFixed(2)}`;
document.getElementById('cabinetResult').classList.remove('hidden');
addCostItem('Cabinet Repair', cost);
updateSummary();
}
// Add cost item to summary
function addCostItem(name, cost) {
const costItems = document.getElementById('costItems');
// Check if item already exists
const existingItem = Array.from(costItems.children).find(item => {
return item.querySelector('.item-name')?.textContent === name;
});
if (existingItem) {
// Update existing item
existingItem.querySelector('.item-cost').textContent = `$${cost.toFixed(2)}`;
} else {
// Create new item
const item = document.createElement('div');
item.className = 'summary-item pl-3 py-2';
item.innerHTML = `
<div class="flex justify-between items-center">
<span class="item-name text-gray-700">${name}</span>
<span class="item-cost font-medium">$${cost.toFixed(2)}</span>
</div>
`;
// Add to the top of the list
if (costItems.firstChild && costItems.firstChild.classList.contains('text-center')) {
costItems.replaceChild(item, costItems.firstChild);
} else {
costItems.prepend(item);
}
}
}
// Update summary with totals
function updateSummary() {
// Calculate total estimated cost
const totalCost = Object.values(calculatedItems).reduce((sum, cost) => sum + cost, 0);
// Get contract total and overhead
const contractTotal = parseFloat(document.getElementById('contractTotal').value) || 0;
const overheadPercent = parseFloat(document.getElementById('overheadPercent').value) || 0;
const overheadAmount = totalCost * (overheadPercent / 100);
// Calculate gross profit
const grossProfit = contractTotal - totalCost - overheadAmount;
const profitMargin = contractTotal > 0 ? (grossProfit / contractTotal) * 100 : 0;
// Update display
document.getElementById('summaryContractTotal').textContent = `$${contractTotal.toFixed(2)}`;
document.getElementById('summaryEstimatedCosts').textContent = `$${totalCost.toFixed(2)}`;
document.getElementById('summaryOverhead').textContent = `$${overheadAmount.toFixed(2)}`;
document.getElementById('overheadPercentDisplay').textContent = overheadPercent;
document.getElementById('summaryGrossProfit').textContent = `$${grossProfit.toFixed(2)}`;
document.getElementById('summaryProfitMargin').textContent = `${profitMargin.toFixed(1)}%`;
document.getElementById('totalEstimatedCost').textContent = `$${totalCost.toFixed(2)}`;
// Style profit based on value
const grossProfitElement = document.getElementById('summaryGrossProfit');
const profitMarginElement = document.getElementById('summaryProfitMargin');
if (grossProfit > 0) {
grossProfitElement.classList.add('profit-positive');
grossProfitElement.classList.remove('profit-negative', 'profit-neutral');
profitMarginElement.classList.add('profit-positive');
profitMarginElement.classList.remove('profit-negative', 'profit-neutral');
} else if (grossProfit < 0) {
grossProfitElement.classList.add('profit-negative');
grossProfitElement.classList.remove('profit-positive', 'profit-neutral');
profitMarginElement.classList.add('profit-negative');
profitMarginElement.classList.remove('profit-positive', 'profit-neutral');
} else {
grossProfitElement.classList.add('profit-neutral');
grossProfitElement.classList.remove('profit-positive', 'profit-negative');
profitMarginElement.classList.add('profit-neutral');
profitMarginElement.classList.remove('profit-positive', 'profit-negative');
}
}
// Reset all fields
document.getElementById('resetBtn').addEventListener('click', function() {
// Reset all input fields
document.querySelectorAll('input[type="text"], input[type="number"], input[type="date"], textarea').forEach(input => {
input.value = '';
});
// Reset checkboxes and radios
document.querySelectorAll('input[type="checkbox"], input[type="radio"]').forEach(input => {
input.checked = false;
});
// Reset selects
document.querySelectorAll('select').forEach(select => {
select.selectedIndex = 0;
});
// Reset calculated items
for (const key in calculatedItems) {
calculatedItems[key] = 0;
}
// Reset results displays
document.querySelectorAll('[id$="Result"]').forEach(result => {
result.classList.add('hidden');
});
// Reset summary
document.getElementById('costItems').innerHTML = `
<div class="text-center text-gray-500 py-4">
<i class="fas fa-calculator text-2xl mb-2"></i>
<p>Start adding items to see your cost breakdown</p>
</div>
`;
updateSummary();
});
// Print functionality
document.getElementById('printBtn').addEventListener('click', function() {
window.print();
});
// Show/hide custom shower size field
document.getElementById('shooterSize').addEventListener('change', function() {
const customSizeField = document.getElementById('showerCustomSize');
if (this.value === 'custom') {
customSizeField.classList.remove('hidden');
} else {
customSizeField.classList.add('hidden');
}
});
// Show/hide bathroom location options
document.getElementById('tileSmallBath').addEventListener('change', function() {
const bathLocationField = document.getElementById('tileBathLocation');
if (this.checked) {
bathLocationField.classList.remove('hidden');
} else {
bathLocationField.classList.add('hidden');
}
});
// Initialize with today's date
document.addEventListener('DOMContentLoaded', function() {
const today = new Date().toISOString().split('T')[0];
document.getElementById('projectDate').value = today;
});
</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=rdowns/pcc-tools" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Reconstruction Project Estimator</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">
<style>
.calculator-card {
transition: all 0.3s ease;
}
.calculator-card:hover {
transform: translateY(-3px);
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.tab-button {
transition: all 0.2s ease;
}
.tab-button.active {
background-color: #3b82f6;
color: white;
}
.summary-item {
border-left: 4px solid #3b82f6;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
.profit-positive {
color: #10b981;
}
.profit-negative {
color: #ef4444;
}
.profit-neutral {
color: #6b7280;
}
</style>
</head>
<body class="bg-gray-50 min-h-screen">
<header class="bg-blue-700 text-white shadow-lg">
<div class="container mx-auto px-4 py-6">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="mb-4 md:mb-0">
<h1 class="text-3xl font-bold">Reconstruction Estimator Pro</h1>
<p class="text-blue-200 mt-1">Accurate pricing based on industry standards</p>
</div>
<div class="flex items-center space-x-4">
<button id="resetBtn" class="bg-white text-blue-700 px-4 py-2 rounded-lg font-semibold hover:bg-blue-50 transition">
<i class="fas fa-redo mr-2"></i>Reset All
</button>
<button id="printBtn" class="bg-blue-800 text-white px-4 py-2 rounded-lg font-semibold hover:bg-blue-900 transition">
<i class="fas fa-print mr-2"></i>Print Estimate
</button>
</div>
</div>
</div>
</header>
<main class="container mx-auto px-4 py-8">
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
<div class="lg:col-span-2">
<div class="bg-white rounded-xl shadow-md p-6 mb-6">
<h2 class="text-2xl font-bold text-gray-800 mb-4">Project Details</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Project Name</label>
<input type="text" id="projectName" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" placeholder="e.g., Smith Residence Kitchen">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Project Date</label>
<input type="date" id="projectDate" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500">
</div>
</div>
<div class="mt-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Project Notes</label>
<textarea id="projectNotes" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" rows="3" placeholder="Any special considerations..."></textarea>
</div>
<div class="mt-4 grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Contract Total ($)</label>
<input type="number" id="contractTotal" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" placeholder="Total contract amount">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Estimated Overhead (%)</label>
<input type="number" id="overheadPercent" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" value="15" placeholder="Overhead percentage">
</div>
</div>
</div>
<div class="bg-white rounded-xl shadow-md p-6 mb-6">
<div class="flex overflow-x-auto space-x-1 pb-2">
<button class="tab-button px-4 py-2 rounded-lg font-medium" data-tab="maintrade">Main Trade</button>
<button class="tab-button active px-4 py-2 rounded-lg font-medium" data-tab="countertops">Countertops</button>
<button class="tab-button px-4 py-2 rounded-lg font-medium" data-tab="flooring">Flooring</button>
<button class="tab-button px-4 py-2 rounded-lg font-medium" data-tab="tile">Tile</button>
<button class="tab-button px-4 py-2 rounded-lg font-medium" data-tab="showers">Showers</button>