Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
66b79430a1 |
65
assets/css/custom.css
Normal file
65
assets/css/custom.css
Normal file
@ -0,0 +1,65 @@
|
||||
body {
|
||||
font-family: 'Inter', sans-serif;
|
||||
background-color: transparent;
|
||||
color: #111827;
|
||||
}
|
||||
|
||||
#particles-js {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: #F3F4F6;
|
||||
background-image: url("");
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
background-position: 50% 50%;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
color: #4F46E5 !important;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: #4F46E5;
|
||||
border-color: #4F46E5;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background-color: #4338CA;
|
||||
border-color: #4338CA;
|
||||
}
|
||||
|
||||
.card {
|
||||
border-radius: 0.5rem;
|
||||
background-color: rgba(255, 255, 255, 0.02);
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
transform: translateZ(0);
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
border-color: #4F46E5;
|
||||
box-shadow: 0 0 0 0.25rem rgba(79, 70, 229, 0.25);
|
||||
}
|
||||
|
||||
@media print {
|
||||
body {
|
||||
background-color: #fff;
|
||||
}
|
||||
.navbar, .btn, footer, #addItemForm, .col-lg-4 {
|
||||
display: none;
|
||||
}
|
||||
.col-lg-8 {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
flex: 0 0 100%;
|
||||
}
|
||||
.card {
|
||||
border: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
}
|
||||
72
assets/js/main.js
Normal file
72
assets/js/main.js
Normal file
@ -0,0 +1,72 @@
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const addItemForm = document.getElementById('addItemForm');
|
||||
const estimateItems = document.getElementById('estimateItems').getElementsByTagName('tbody')[0];
|
||||
const summarySubtotal = document.getElementById('summarySubtotal');
|
||||
const summaryTax = document.getElementById('summaryTax');
|
||||
const summaryTotal = document.getElementById('summaryTotal');
|
||||
const taxRate = 0.10; // 10%
|
||||
|
||||
// Set current date
|
||||
document.getElementById('estimateDate').valueAsDate = new Date();
|
||||
|
||||
addItemForm.addEventListener('submit', function (e) {
|
||||
e.preventDefault();
|
||||
const description = document.getElementById('itemDescription').value;
|
||||
const quantity = parseFloat(document.getElementById('itemQuantity').value);
|
||||
const price = parseFloat(document.getElementById('itemPrice').value);
|
||||
|
||||
if (description && quantity > 0 && price >= 0) {
|
||||
addItem(description, quantity, price);
|
||||
addItemForm.reset();
|
||||
document.getElementById('itemQuantity').value = 1;
|
||||
document.getElementById('itemPrice').value = "0.00";
|
||||
}
|
||||
});
|
||||
|
||||
function addItem(description, quantity, price) {
|
||||
const row = estimateItems.insertRow();
|
||||
const total = quantity * price;
|
||||
|
||||
row.innerHTML = `
|
||||
<td><input type="text" class="form-control border-0" value="${description}"></td>
|
||||
<td><input type="number" class="form-control border-0 item-quantity" value="${quantity}" min="1"></td>
|
||||
<td><input type="number" class="form-control border-0 item-price text-end" value="${price.toFixed(2)}" step="0.01" min="0"></td>
|
||||
<td class="text-end item-total">${total.toFixed(2)}</td>
|
||||
<td class="text-center"><button class="btn btn-sm btn-outline-danger remove-item">×</button></td>
|
||||
`;
|
||||
|
||||
row.querySelector('.remove-item').addEventListener('click', function () {
|
||||
row.remove();
|
||||
updateSummary();
|
||||
});
|
||||
|
||||
row.querySelectorAll('.item-quantity, .item-price').forEach(input => {
|
||||
input.addEventListener('input', function () {
|
||||
const newQuantity = parseFloat(row.querySelector('.item-quantity').value);
|
||||
const newPrice = parseFloat(row.querySelector('.item-price').value);
|
||||
const newTotal = newQuantity * newPrice;
|
||||
row.querySelector('.item-total').textContent = newTotal.toFixed(2);
|
||||
updateSummary();
|
||||
});
|
||||
});
|
||||
|
||||
updateSummary();
|
||||
}
|
||||
|
||||
function updateSummary() {
|
||||
let subtotal = 0;
|
||||
estimateItems.querySelectorAll('tr').forEach(row => {
|
||||
subtotal += parseFloat(row.querySelector('.item-total').textContent);
|
||||
});
|
||||
|
||||
const tax = subtotal * taxRate;
|
||||
const total = subtotal + tax;
|
||||
|
||||
summarySubtotal.textContent = `$${subtotal.toFixed(2)}`;
|
||||
summaryTax.textContent = `$${tax.toFixed(2)}`;
|
||||
summaryTotal.textContent = `$${total.toFixed(2)}`;
|
||||
}
|
||||
|
||||
// Add a default item to get started
|
||||
addItem('Example Item', 1, 100);
|
||||
});
|
||||
353
index.php
353
index.php
@ -1,131 +1,232 @@
|
||||
<?php
|
||||
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>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>New Style</title>
|
||||
<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>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Estimate Builder</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<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;500;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<div class="card">
|
||||
<h1>Analyzing your requirements and generating your website…</h1>
|
||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||
<span class="sr-only">Loading…</span>
|
||||
</div>
|
||||
<p class="hint">Flatlogic AI is collecting your requirements and applying the first changes.</p>
|
||||
<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>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
||||
</footer>
|
||||
<div id="particles-js"></div>
|
||||
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand fw-bold text-primary" href="#">Estimate Builder</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main class="container my-5">
|
||||
<div class="row">
|
||||
<!-- Estimate Form -->
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-body p-4">
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-6">
|
||||
<h5 class="card-title">Estimate Details</h5>
|
||||
<div class="mb-3">
|
||||
<label for="estimateNumber" class="form-label">Estimate #</label>
|
||||
<input type="text" class="form-control" id="estimateNumber" value="001">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="estimateDate" class="form-label">Date</label>
|
||||
<input type="date" class="form-control" id="estimateDate">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h5 class="card-title invisible">Bill To</h5>
|
||||
<div class="mb-3">
|
||||
<label for="billTo" class="form-label">Bill To</label>
|
||||
<textarea class="form-control" id="billTo" rows="3" placeholder="Client Name Address City, State, Zip"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="estimateItems">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Description</th>
|
||||
<th scope="col" style="width: 100px;">Quantity</th>
|
||||
<th scope="col" style="width: 120px;">Price</th>
|
||||
<th scope="col" class="text-end" style="width: 120px;">Total</th>
|
||||
<th scope="col" class="text-center" style="width: 50px;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- Items will be added here -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<h5 class="card-title">Add New Item</h5>
|
||||
<form id="addItemForm" class="row g-3 align-items-end">
|
||||
<div class="col">
|
||||
<label for="itemDescription" class="form-label">Description</label>
|
||||
<input type="text" class="form-control" id="itemDescription" required>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<label for="itemQuantity" class="form-label">Quantity</label>
|
||||
<input type="number" class="form-control" id="itemQuantity" value="1" min="1" style="width: 100px;">
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<label for="itemPrice" class="form-label">Price</label>
|
||||
<input type="number" class="form-control" id="itemPrice" value="0.00" step="0.01" min="0" style="width: 120px;">
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="submit" class="btn btn-primary">Add Item</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Summary -->
|
||||
<div class="col-lg-4">
|
||||
<div class="card position-sticky top-0" style="top: 1.5rem !important;">
|
||||
<div class="card-body p-4">
|
||||
<h5 class="card-title mb-4">Summary</h5>
|
||||
<div class="d-flex justify-content-between mb-2">
|
||||
<span>Subtotal</span>
|
||||
<span id="summarySubtotal">$0.00</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between mb-3">
|
||||
<span>Tax (10%)</span>
|
||||
<span id="summaryTax">$0.00</span>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="d-flex justify-content-between fw-bold fs-5">
|
||||
<span>Total</span>
|
||||
<span id="summaryTotal">$0.00</span>
|
||||
</div>
|
||||
<div class="d-grid gap-2 mt-4">
|
||||
<button class="btn btn-secondary" onclick="window.print()">Print / Download PDF</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="text-center text-muted py-4 mt-5 bg-light">
|
||||
<p>© <?php echo date("Y"); ?> Estimate Builder. All rights reserved.</p>
|
||||
</footer>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/particles.js@2.0.0/particles.min.js"></script>
|
||||
<script>
|
||||
particlesJS("particles-js", {
|
||||
"particles": {
|
||||
"number": {
|
||||
"value": 80,
|
||||
"density": {
|
||||
"enable": true,
|
||||
"value_area": 800
|
||||
}
|
||||
},
|
||||
"color": {
|
||||
"value": "#4F46E5"
|
||||
},
|
||||
"shape": {
|
||||
"type": "circle",
|
||||
"stroke": {
|
||||
"width": 0,
|
||||
"color": "#000000"
|
||||
},
|
||||
"polygon": {
|
||||
"nb_sides": 5
|
||||
}
|
||||
},
|
||||
"opacity": {
|
||||
"value": 0.5,
|
||||
"random": false,
|
||||
"anim": {
|
||||
"enable": false,
|
||||
"speed": 1,
|
||||
"opacity_min": 0.1,
|
||||
"sync": false
|
||||
}
|
||||
},
|
||||
"size": {
|
||||
"value": 3,
|
||||
"random": true,
|
||||
"anim": {
|
||||
"enable": false,
|
||||
"speed": 40,
|
||||
"size_min": 0.1,
|
||||
"sync": false
|
||||
}
|
||||
},
|
||||
"line_linked": {
|
||||
"enable": true,
|
||||
"distance": 150,
|
||||
"color": "#4F46E5",
|
||||
"opacity": 0.4,
|
||||
"width": 1
|
||||
},
|
||||
"move": {
|
||||
"enable": true,
|
||||
"speed": 6,
|
||||
"direction": "none",
|
||||
"random": false,
|
||||
"straight": false,
|
||||
"out_mode": "out",
|
||||
"bounce": false,
|
||||
"attract": {
|
||||
"enable": false,
|
||||
"rotateX": 600,
|
||||
"rotateY": 1200
|
||||
}
|
||||
}
|
||||
},
|
||||
"interactivity": {
|
||||
"detect_on": "canvas",
|
||||
"events": {
|
||||
"onhover": {
|
||||
"enable": true,
|
||||
"mode": "repulse"
|
||||
},
|
||||
"onclick": {
|
||||
"enable": true,
|
||||
"mode": "push"
|
||||
},
|
||||
"resize": true
|
||||
},
|
||||
"modes": {
|
||||
"grab": {
|
||||
"distance": 400,
|
||||
"line_linked": {
|
||||
"opacity": 1
|
||||
}
|
||||
},
|
||||
"bubble": {
|
||||
"distance": 400,
|
||||
"size": 40,
|
||||
"duration": 2,
|
||||
"opacity": 8,
|
||||
"speed": 3
|
||||
},
|
||||
"repulse": {
|
||||
"distance": 200,
|
||||
"duration": 0.4
|
||||
},
|
||||
"push": {
|
||||
"particles_nb": 4
|
||||
},
|
||||
"remove": {
|
||||
"particles_nb": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"retina_detect": true
|
||||
});
|
||||
</script>
|
||||
<script src="assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user