Spaces:
Running
Running
File size: 27,514 Bytes
3f1219c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Enquiry Form with Preview</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: '#3b82f6',
secondary: '#1d4ed8',
accent: '#93c5fd',
paper: '#f8fafc'
}
}
}
}
</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;
background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
min-height: 100vh;
}
.paper-preview {
background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
border: 1px solid #e2e8f0;
position: relative;
overflow: hidden;
}
.paper-preview::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
height: 40px;
background: linear-gradient(to right, #1d4ed8, #3b82f6);
}
.watermark {
position: absolute;
opacity: 0.05;
font-size: 8rem;
font-weight: 800;
transform: rotate(-30deg);
pointer-events: none;
z-index: 0;
color: #1e40af;
}
.item-row:hover {
background-color: #f1f5f9;
}
.print-button {
transition: all 0.3s ease;
}
.print-button:hover {
transform: translateY(-2px);
box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}
.company-logo {
background: linear-gradient(135deg, #1d4ed8, #3b82f6);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.header-divider {
height: 2px;
background: linear-gradient(to right, transparent, #3b82f6, transparent);
}
</style>
</head>
<body class="py-8 px-4">
<div class="max-w-6xl mx-auto">
<!-- Header -->
<div class="text-center mb-10">
<h1 class="text-4xl font-bold text-gray-800 mb-2">Enquiry Form</h1>
<p class="text-gray-600 max-w-2xl mx-auto">Create detailed enquiries with item specifications, quantities, and pricing. Preview your document before printing.</p>
</div>
<div class="flex flex-col lg:flex-row gap-8">
<!-- Form Section -->
<div class="w-full lg:w-1/2">
<div class="bg-white rounded-xl shadow-lg p-6">
<h2 class="text-2xl font-bold text-gray-800 mb-6 flex items-center">
<i class="fas fa-edit mr-3 text-primary"></i> Enquiry Details
</h2>
<!-- Company Info -->
<div class="mb-8">
<h3 class="text-lg font-semibold text-gray-700 mb-3">Company Information</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">Company Name</label>
<input type="text" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="Enter company name">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Contact Person</label>
<input type="text" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="Enter contact name">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Email</label>
<input type="email" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="Enter email">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Phone</label>
<input type="tel" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="Enter phone number">
</div>
</div>
</div>
<!-- Items Section -->
<div>
<div class="flex justify-between items-center mb-3">
<h3 class="text-lg font-semibold text-gray-700">Items</h3>
<button id="add-item" class="px-4 py-2 bg-primary hover:bg-secondary text-white rounded-lg flex items-center">
<i class="fas fa-plus mr-2"></i> Add Item
</button>
</div>
<div class="overflow-x-auto">
<table class="w-full">
<thead>
<tr class="bg-gray-100 text-gray-700 text-sm">
<th class="py-3 px-4 text-left">Item Type</th>
<th class="py-3 px-4 text-left">Description</th>
<th class="py-3 px-4 text-left">Qty</th>
<th class="py-3 px-4 text-left">Rate</th>
<th class="py-3 px-4 text-left">Amount</th>
<th class="py-3 px-4 text-left">Action</th>
</tr>
</thead>
<tbody id="items-container">
<!-- Items will be added here dynamically -->
</tbody>
</table>
</div>
<div class="mt-6 flex justify-end">
<div class="bg-gray-50 p-4 rounded-lg w-full max-w-xs">
<div class="flex justify-between mb-2">
<span class="font-medium text-gray-700">Subtotal:</span>
<span id="subtotal" class="font-medium">$0.00</span>
</div>
<div class="flex justify-between mb-2">
<span class="font-medium text-gray-700">Tax (5%):</span>
<span id="tax" class="font-medium">$0.00</span>
</div>
<div class="flex justify-between text-lg font-bold pt-2 border-t border-gray-200">
<span>Total:</span>
<span id="total" class="text-primary">$0.00</span>
</div>
</div>
</div>
<div class="mt-8">
<label class="block text-sm font-medium text-gray-700 mb-2">Additional Notes</label>
<textarea class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent h-24" placeholder="Enter any additional notes or requirements..."></textarea>
</div>
<div class="mt-8 flex justify-end gap-4">
<button class="px-6 py-3 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50">
<i class="fas fa-times mr-2"></i> Cancel
</button>
<button class="px-6 py-3 bg-primary hover:bg-secondary text-white rounded-lg flex items-center">
<i class="fas fa-paper-plane mr-2"></i> Submit Enquiry
</button>
</div>
</div>
</div>
</div>
<!-- Preview Section -->
<div class="w-full lg:w-1/2">
<div class="sticky top-8">
<div class="flex justify-between items-center mb-4">
<h2 class="text-2xl font-bold text-gray-800 flex items-center">
<i class="fas fa-file-alt mr-3 text-primary"></i> Document Preview
</h2>
<button id="print-btn" class="print-button px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg flex items-center">
<i class="fas fa-print mr-2"></i> Print Preview
</button>
</div>
<div class="paper-preview rounded-xl p-8 relative overflow-hidden">
<div class="watermark">DRAFT</div>
<!-- Preview Header -->
<div class="text-center mb-8 relative z-10">
<div class="company-logo text-4xl font-bold mb-2">CompanyLogo</div>
<h1 class="text-3xl font-bold text-gray-800 mb-1">ENQUIRY DOCUMENT</h1>
<div class="text-gray-600">Ref: ENQ-2023-001</div>
<div class="header-divider my-4"></div>
</div>
<!-- Company Info -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8 relative z-10">
<div>
<h3 class="text-sm font-semibold text-gray-500 uppercase mb-1">From</h3>
<div class="text-gray-800">
<div class="font-bold">ABC Suppliers Inc.</div>
<div>123 Business Avenue</div>
<div>New York, NY 10001</div>
<div>[email protected]</div>
<div>+1 (555) 123-4567</div>
</div>
</div>
<div>
<h3 class="text-sm font-semibold text-gray-500 uppercase mb-1">To</h3>
<div class="text-gray-800">
<div class="font-bold" id="preview-company">[Company Name]</div>
<div id="preview-contact">[Contact Person]</div>
<div id="preview-email">[Email Address]</div>
<div id="preview-phone">[Phone Number]</div>
</div>
</div>
</div>
<!-- Preview Date -->
<div class="mb-8 relative z-10">
<div class="flex justify-between">
<div>
<span class="font-semibold">Enquiry Date:</span>
<span id="preview-date">October 16, 2023</span>
</div>
<div>
<span class="font-semibold">Valid Until:</span>
<span id="preview-valid">November 16, 2023</span>
</div>
</div>
</div>
<!-- Preview Items -->
<div class="mb-8 relative z-10">
<table class="w-full border-collapse">
<thead>
<tr class="bg-gray-200 text-gray-700">
<th class="py-3 px-4 text-left border border-gray-300">Item</th>
<th class="py-3 px-4 text-left border border-gray-300">Description</th>
<th class="py-3 px-4 text-left border border-gray-300">Qty</th>
<th class="py-3 px-4 text-left border border-gray-300">Rate</th>
<th class="py-3 px-4 text-left border border-gray-300">Amount</th>
</tr>
</thead>
<tbody id="preview-items">
<!-- Preview items will be added here -->
<tr>
<td colspan="5" class="py-4 text-center text-gray-500 italic">No items added yet</td>
</tr>
</tbody>
</table>
</div>
<!-- Preview Summary -->
<div class="mb-8 relative z-10">
<div class="flex justify-end">
<div class="w-full max-w-xs">
<div class="flex justify-between mb-1">
<span class="text-gray-700">Subtotal:</span>
<span id="preview-subtotal">$0.00</span>
</div>
<div class="flex justify-between mb-1">
<span class="text-gray-700">Tax (10%):</span>
<span id="preview-tax">$0.00</span>
</div>
<div class="flex justify-between font-bold text-lg pt-2 border-t border-gray-300 mt-2">
<span>Total:</span>
<span id="preview-total" class="text-primary">$0.00</span>
</div>
</div>
</div>
</div>
<!-- Preview Notes -->
<div class="mb-8 relative z-10">
<h3 class="text-sm font-semibold text-gray-500 uppercase mb-2">Notes</h3>
<div class="text-gray-700 italic" id="preview-notes">
Payment terms: Net 30 days. Prices valid for 30 days from enquiry date.
</div>
</div>
<!-- Preview Footer -->
<div class="relative z-10">
<div class="flex justify-between items-center pt-6 border-t border-gray-300">
<div>
<div class="font-semibold text-gray-800">Authorized Signature</div>
<div class="text-sm text-gray-600">John Smith, Sales Manager</div>
</div>
<div class="text-sm text-gray-600 text-right">
<div>ABC Suppliers Inc.</div>
<div>www.abcsuppliers.com</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Initialize date
const today = new Date();
const validUntil = new Date();
validUntil.setDate(today.getDate() + 30);
document.getElementById('preview-date').textContent = formatDate(today);
document.getElementById('preview-valid').textContent = formatDate(validUntil);
// Initialize items array
let items = [];
// Add item button functionality
document.getElementById('add-item').addEventListener('click', function(e) {
e.preventDefault();
addItem();
});
// Print button functionality
document.getElementById('print-btn').addEventListener('click', function() {
alert('Print functionality would open print dialog in a real application');
// window.print();
});
// Initialize form with one item
addItem();
// Update preview when company info changes
const companyInputs = {
'preview-company': 'input[placeholder="Enter company name"]',
'preview-contact': 'input[placeholder="Enter contact name"]',
'preview-email': 'input[placeholder="Enter email"]',
'preview-phone': 'input[placeholder="Enter phone number"]'
};
Object.entries(companyInputs).forEach(([previewId, selector]) => {
const input = document.querySelector(selector);
if (input) {
input.addEventListener('input', (e) => {
document.getElementById(previewId).textContent = e.target.value || `[${previewId.replace('preview-', '').replace(/-/g, ' ')}]`;
});
}
});
function addItem() {
const container = document.getElementById('items-container');
const id = Date.now();
const itemRow = document.createElement('tr');
itemRow.className = 'item-row';
itemRow.id = `item-${id}`;
itemRow.innerHTML = `
<td class="py-3 px-4">
<select class="w-full px-3 py-1 border border-gray-300 rounded focus:ring-2 focus:ring-primary focus:border-transparent">
<option value="">Select Item Type</option>
<option value="electronics">Electronics</option>
<option value="furniture">Furniture</option>
<option value="office">Office Supplies</option>
<option value="machinery">Machinery</option>
<option value="raw">Raw Materials</option>
<option value="other">Other</option>
</select>
</td>
<td class="py-3 px-4">
<input type="text" class="w-full px-3 py-1 border border-gray-300 rounded focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="Description">
</td>
<td class="py-3 px-4">
<input type="number" min="1" value="1" class="item-qty w-full px-3 py-1 border border-gray-300 rounded focus:ring-2 focus:ring-primary focus:border-transparent">
</td>
<td class="py-3 px-4">
<input type="number" min="0" step="0.01" value="0" class="item-rate w-full px-3 py-1 border border-gray-300 rounded focus:ring-2 focus:ring-primary focus:border-transparent">
</td>
<td class="py-3 px-4">
<input type="text" class="item-amount w-full px-3 py-1 border border-gray-300 rounded bg-gray-50" value="$0.00" readonly>
</td>
<td class="py-3 px-4">
<button class="remove-item text-red-500 hover:text-red-700">
<i class="fas fa-trash"></i>
</button>
</td>
`;
container.appendChild(itemRow);
// Add event listeners for qty and rate
const qtyInput = itemRow.querySelector('.item-qty');
const rateInput = itemRow.querySelector('.item-rate');
const updateAmount = () => {
const qty = parseFloat(qtyInput.value) || 0;
const rate = parseFloat(rateInput.value) || 0;
const amount = qty * rate;
itemRow.querySelector('.item-amount').value = `$${amount.toFixed(2)}`;
updateTotals();
updatePreview();
};
qtyInput.addEventListener('input', updateAmount);
rateInput.addEventListener('input', updateAmount);
// Add remove functionality
itemRow.querySelector('.remove-item').addEventListener('click', function() {
itemRow.remove();
updateTotals();
updatePreview();
});
// Update preview
updatePreview();
}
function updateTotals() {
let subtotal = 0;
document.querySelectorAll('.item-row').forEach(row => {
const amount = parseFloat(row.querySelector('.item-amount').value.replace('$', '')) || 0;
subtotal += amount;
});
const tax = subtotal * 0.05;
const total = subtotal + tax;
document.getElementById('subtotal').textContent = `$${subtotal.toFixed(2)}`;
document.getElementById('tax').textContent = `$${tax.toFixed(2)}`;
document.getElementById('total').textContent = `$${total.toFixed(2)}`;
}
function updatePreview() {
// Update company info
document.getElementById('preview-company').textContent =
document.querySelector('input[placeholder="Enter company name"]').value || '[Company Name]';
document.getElementById('preview-contact').textContent =
document.querySelector('input[placeholder="Enter contact name"]').value || '[Contact Person]';
document.getElementById('preview-email').textContent =
document.querySelector('input[placeholder="Enter email"]').value || '[Email Address]';
document.getElementById('preview-phone').textContent =
document.querySelector('input[placeholder="Enter phone number"]').value || '[Phone Number]';
// Update items
const previewContainer = document.getElementById('preview-items');
previewContainer.innerHTML = '';
const items = document.querySelectorAll('.item-row');
if (items.length === 0) {
previewContainer.innerHTML = `
<tr>
<td colspan="5" class="py-4 text-center text-gray-500 italic">No items added yet</td>
</tr>
`;
} else {
items.forEach((item, index) => {
const type = item.querySelector('select').value || 'N/A';
const desc = item.querySelector('input[type="text"]').value || 'No description';
const qty = item.querySelector('.item-qty').value || '0';
const rate = `$${parseFloat(item.querySelector('.item-rate').value || 0).toFixed(2)}`;
const amount = item.querySelector('.item-amount').value || '$0.00';
const row = document.createElement('tr');
row.className = index % 2 === 0 ? 'bg-gray-50' : '';
row.innerHTML = `
<td class="py-2 px-4 border border-gray-300">${type}</td>
<td class="py-2 px-4 border border-gray-300">${desc}</td>
<td class="py-2 px-4 border border-gray-300 text-right">${qty}</td>
<td class="py-2 px-4 border border-gray-300 text-right">${rate}</td>
<td class="py-2 px-4 border border-gray-300 text-right">${amount}</td>
`;
previewContainer.appendChild(row);
});
}
// Update totals
const subtotal = parseFloat(document.getElementById('subtotal').textContent.replace('$', '')) || 0;
const tax = parseFloat(document.getElementById('tax').textContent.replace('$', '')) || 0;
const total = parseFloat(document.getElementById('total').textContent.replace('$', '')) || 0;
document.getElementById('preview-subtotal').textContent = `$${subtotal.toFixed(2)}`;
document.getElementById('preview-tax').textContent = `$${tax.toFixed(2)}`;
document.getElementById('preview-total').textContent = `$${total.toFixed(2)}`;
}
function formatDate(date) {
const options = { year: 'numeric', month: 'long', day: 'numeric' };
return date.toLocaleDateString('en-US', options);
}
});
</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=TimexPeachtree/deep-enquiry-tw" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |