Auto commit: 2025-10-30T20:26:25.582Z
This commit is contained in:
parent
e2292ad72a
commit
5439455f52
77
assets/css/custom.css
Normal file
77
assets/css/custom.css
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
@import url('https://fonts.googleapis.com/css2?family=Georgia&family=Helvetica+Neue&display=swap');
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: #FDFDFD;
|
||||||
|
color: #4A4A4A;
|
||||||
|
font-family: 'Helvetica Neue', Arial, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1, h2, h3, h4, h5, h6 {
|
||||||
|
font-family: 'Georgia', serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary {
|
||||||
|
background-color: #D4AF37;
|
||||||
|
border-color: #D4AF37;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary:hover, .btn-primary:focus {
|
||||||
|
background-color: #c09d2e;
|
||||||
|
border-color: #c09d2e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-secondary {
|
||||||
|
background-color: #6c757d;
|
||||||
|
border-color: #6c757d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
border: 1px solid #EAEAEA;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
border-bottom: 1px solid #EAEAEA;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-footer {
|
||||||
|
border-top: 1px solid #EAEAEA;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-control:focus {
|
||||||
|
border-color: #D4AF37;
|
||||||
|
box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
.table {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#estimator-section {
|
||||||
|
background: linear-gradient(to bottom, rgba(212, 175, 55, 0.05), rgba(212, 175, 55, 0));
|
||||||
|
padding-top: 2rem;
|
||||||
|
padding-bottom: 2rem;
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
body * {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
#estimator-section, #estimator-section * {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
#estimator-section {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.btn, .form-label, #item-form {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
.card {
|
||||||
|
box-shadow: none !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
81
assets/js/main.js
Normal file
81
assets/js/main.js
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
const itemForm = document.getElementById('item-form');
|
||||||
|
const estimateItems = document.getElementById('estimate-items');
|
||||||
|
const subtotalEl = document.getElementById('subtotal');
|
||||||
|
const taxEl = document.getElementById('tax');
|
||||||
|
const totalEl = document.getElementById('total');
|
||||||
|
const printBtn = document.getElementById('print-btn');
|
||||||
|
const emptyState = document.getElementById('empty-state');
|
||||||
|
|
||||||
|
let items = [];
|
||||||
|
|
||||||
|
const updateTotals = () => {
|
||||||
|
const subtotal = items.reduce((acc, item) => acc + item.total, 0);
|
||||||
|
const tax = subtotal * 0.10;
|
||||||
|
const total = subtotal + tax;
|
||||||
|
|
||||||
|
subtotalEl.textContent = `$${subtotal.toFixed(2)}`;
|
||||||
|
taxEl.textContent = `$${tax.toFixed(2)}`;
|
||||||
|
totalEl.textContent = `$${total.toFixed(2)}`;
|
||||||
|
|
||||||
|
if (items.length > 0) {
|
||||||
|
emptyState.style.display = 'none';
|
||||||
|
} else {
|
||||||
|
emptyState.style.display = 'block';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderItems = () => {
|
||||||
|
estimateItems.innerHTML = '';
|
||||||
|
items.forEach((item, index) => {
|
||||||
|
const tr = document.createElement('tr');
|
||||||
|
tr.innerHTML = `
|
||||||
|
<td>${item.description}</td>
|
||||||
|
<td class="text-end">${item.quantity}</td>
|
||||||
|
<td class="text-end">$${item.price.toFixed(2)}</td>
|
||||||
|
<td class="text-end fw-bold">$${item.total.toFixed(2)}</td>
|
||||||
|
<td class="text-center">
|
||||||
|
<button class="btn btn-sm btn-outline-danger remove-btn" data-index="${index}">
|
||||||
|
<i class="bi bi-trash"></i>
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
|
`;
|
||||||
|
estimateItems.appendChild(tr);
|
||||||
|
});
|
||||||
|
updateTotals();
|
||||||
|
};
|
||||||
|
|
||||||
|
itemForm.addEventListener('submit', (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
const description = document.getElementById('item-description').value;
|
||||||
|
const quantity = parseInt(document.getElementById('item-quantity').value);
|
||||||
|
const price = parseFloat(document.getElementById('item-price').value);
|
||||||
|
|
||||||
|
if (description && quantity > 0 && price > 0) {
|
||||||
|
const newItem = {
|
||||||
|
description,
|
||||||
|
quantity,
|
||||||
|
price,
|
||||||
|
total: quantity * price
|
||||||
|
};
|
||||||
|
items.push(newItem);
|
||||||
|
renderItems();
|
||||||
|
itemForm.reset();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
estimateItems.addEventListener('click', (e) => {
|
||||||
|
if (e.target.classList.contains('remove-btn') || e.target.closest('.remove-btn')) {
|
||||||
|
const button = e.target.closest('.remove-btn');
|
||||||
|
const index = parseInt(button.dataset.index);
|
||||||
|
items.splice(index, 1);
|
||||||
|
renderItems();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
printBtn.addEventListener('click', () => {
|
||||||
|
window.print();
|
||||||
|
});
|
||||||
|
|
||||||
|
updateTotals();
|
||||||
|
});
|
||||||
252
index.php
252
index.php
@ -1,150 +1,114 @@
|
|||||||
<?php
|
<!DOCTYPE html>
|
||||||
declare(strict_types=1);
|
|
||||||
@ini_set('display_errors', '1');
|
|
||||||
@error_reporting(E_ALL);
|
|
||||||
@date_default_timezone_set('UTC');
|
|
||||||
|
|
||||||
$phpVersion = PHP_VERSION;
|
|
||||||
$now = date('Y-m-d H:i:s');
|
|
||||||
?>
|
|
||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>New Style</title>
|
<title>Project BrassConnect Full-Stack Development PrompC</title>
|
||||||
<?php
|
<meta name="description" content="Built with Flatlogic Generator">
|
||||||
// Read project preview data from environment
|
<meta name="keywords" content="brass marketplace, b2b platform, manufacturing, brass components, industrial supply, RFQ, quote generator, brass parts, Jamnagar brass, Built with Flatlogic Generator">
|
||||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
<meta property="og:title" content="Project BrassConnect Full-Stack Development PrompC">
|
||||||
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
<meta property="og:description" content="Built with Flatlogic Generator">
|
||||||
?>
|
<meta property="og:image" content="">
|
||||||
<?php if ($projectDescription): ?>
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
<!-- Meta description -->
|
<meta name="twitter:image" content="">
|
||||||
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
|
||||||
<!-- Open Graph meta tags -->
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||||
<!-- Twitter meta tags -->
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||||
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ($projectImageUrl): ?>
|
|
||||||
<!-- Open Graph image -->
|
|
||||||
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
|
||||||
<!-- Twitter image -->
|
|
||||||
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
|
||||||
<?php endif; ?>
|
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
|
||||||
<style>
|
|
||||||
:root {
|
|
||||||
--bg-color-start: #6a11cb;
|
|
||||||
--bg-color-end: #2575fc;
|
|
||||||
--text-color: #ffffff;
|
|
||||||
--card-bg-color: rgba(255, 255, 255, 0.01);
|
|
||||||
--card-border-color: rgba(255, 255, 255, 0.1);
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
font-family: 'Inter', sans-serif;
|
|
||||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
|
||||||
color: var(--text-color);
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
min-height: 100vh;
|
|
||||||
text-align: center;
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
body::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
|
|
||||||
animation: bg-pan 20s linear infinite;
|
|
||||||
z-index: -1;
|
|
||||||
}
|
|
||||||
@keyframes bg-pan {
|
|
||||||
0% { background-position: 0% 0%; }
|
|
||||||
100% { background-position: 100% 100%; }
|
|
||||||
}
|
|
||||||
main {
|
|
||||||
padding: 2rem;
|
|
||||||
}
|
|
||||||
.card {
|
|
||||||
background: var(--card-bg-color);
|
|
||||||
border: 1px solid var(--card-border-color);
|
|
||||||
border-radius: 16px;
|
|
||||||
padding: 2rem;
|
|
||||||
backdrop-filter: blur(20px);
|
|
||||||
-webkit-backdrop-filter: blur(20px);
|
|
||||||
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
.loader {
|
|
||||||
margin: 1.25rem auto 1.25rem;
|
|
||||||
width: 48px;
|
|
||||||
height: 48px;
|
|
||||||
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
||||||
border-top-color: #fff;
|
|
||||||
border-radius: 50%;
|
|
||||||
animation: spin 1s linear infinite;
|
|
||||||
}
|
|
||||||
@keyframes spin {
|
|
||||||
from { transform: rotate(0deg); }
|
|
||||||
to { transform: rotate(360deg); }
|
|
||||||
}
|
|
||||||
.hint {
|
|
||||||
opacity: 0.9;
|
|
||||||
}
|
|
||||||
.sr-only {
|
|
||||||
position: absolute;
|
|
||||||
width: 1px; height: 1px;
|
|
||||||
padding: 0; margin: -1px;
|
|
||||||
overflow: hidden;
|
|
||||||
clip: rect(0, 0, 0, 0);
|
|
||||||
white-space: nowrap; border: 0;
|
|
||||||
}
|
|
||||||
h1 {
|
|
||||||
font-size: 3rem;
|
|
||||||
font-weight: 700;
|
|
||||||
margin: 0 0 1rem;
|
|
||||||
letter-spacing: -1px;
|
|
||||||
}
|
|
||||||
p {
|
|
||||||
margin: 0.5rem 0;
|
|
||||||
font-size: 1.1rem;
|
|
||||||
}
|
|
||||||
code {
|
|
||||||
background: rgba(0,0,0,0.2);
|
|
||||||
padding: 2px 6px;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
||||||
}
|
|
||||||
footer {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 1rem;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<main>
|
|
||||||
<div class="card">
|
<header class="bg-light py-3 border-bottom">
|
||||||
<h1>Analyzing your requirements and generating your website…</h1>
|
<div class="container">
|
||||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
<h1 class="display-5 fw-bold">BrassConnect Estimator</h1>
|
||||||
<span class="sr-only">Loading…</span>
|
<p class="text-muted">A B2B Marketplace for the Brass Industry</p>
|
||||||
</div>
|
</div>
|
||||||
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
</header>
|
||||||
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
|
||||||
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
<main class="container my-5" id="estimator-section">
|
||||||
</div>
|
<div class="card shadow-sm">
|
||||||
</main>
|
<div class="card-header bg-white py-3">
|
||||||
<footer>
|
<h2 class="h4 mb-0">Create a Quick Estimate</h2>
|
||||||
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
</div>
|
||||||
</footer>
|
<div class="card-body p-4">
|
||||||
|
<form id="item-form" class="row g-3 align-items-end">
|
||||||
|
<div class="col-md-5">
|
||||||
|
<label for="item-description" class="form-label">Description</label>
|
||||||
|
<input type="text" class="form-control" id="item-description" placeholder="E.g., Brass Fitting" required>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label for="item-quantity" class="form-label">Quantity</label>
|
||||||
|
<input type="number" class="form-control" id="item-quantity" value="1" min="1" required>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label for="item-price" class="form-label">Unit Price ($)</label>
|
||||||
|
<input type="number" class="form-control" id="item-price" value="10.00" min="0.01" step="0.01" required>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<button type="submit" class="btn btn-primary w-100">Add Item</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<hr class="my-4">
|
||||||
|
|
||||||
|
<h3 class="h5 mb-3">Line Items</h3>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover">
|
||||||
|
<thead class="table-light">
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Description</th>
|
||||||
|
<th scope="col" class="text-end">Quantity</th>
|
||||||
|
<th scope="col" class="text-end">Unit Price</th>
|
||||||
|
<th scope="col" class="text-end">Total</th>
|
||||||
|
<th scope="col" class="text-center">Action</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="estimate-items">
|
||||||
|
<!-- Items will be added here -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div id="empty-state" class="text-center py-5">
|
||||||
|
<i class="bi bi-receipt-cutoff" style="font-size: 3rem; color: #EAEAEA;"></i>
|
||||||
|
<p class="mt-3 text-muted">Your estimate is currently empty.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr class="my-4">
|
||||||
|
|
||||||
|
<div class="row justify-content-end">
|
||||||
|
<div class="col-md-5">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h4 class="card-title h6">Summary</h4>
|
||||||
|
<div class="d-flex justify-content-between mb-2">
|
||||||
|
<span>Subtotal</span>
|
||||||
|
<span id="subtotal">$0.00</span>
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-between mb-2">
|
||||||
|
<span>Tax (10%)</span>
|
||||||
|
<span id="tax">$0.00</span>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<div class="d-flex justify-content-between fw-bold h5 mb-0">
|
||||||
|
<span>Total</span>
|
||||||
|
<span id="total">$0.00</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="card-footer bg-light text-end py-3">
|
||||||
|
<button id="print-btn" class="btn btn-secondary"><i class="bi bi-printer"></i> Print / Download</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer class="text-center py-4 mt-auto border-top">
|
||||||
|
<p class="mb-0 text-muted">© <?php echo date("Y"); ?> BrassConnect. Built with Flatlogic.</p>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
x
Reference in New Issue
Block a user