Compare commits

..

1 Commits

Author SHA1 Message Date
Flatlogic Bot
4c9b7d6526 0.1 2025-12-01 10:54:05 +00:00
3 changed files with 290 additions and 145 deletions

97
assets/css/custom.css Normal file
View File

@ -0,0 +1,97 @@
/* Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
:root {
--primary-color: #4F46E5;
--secondary-color: #10B981;
--background-color: #F9FAFB;
--surface-color: #FFFFFF;
--text-color: #111827;
--text-muted-color: #6B7281;
--border-radius-sm: 0.375rem;
--border-radius-lg: 0.5rem;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background-color: var(--background-color);
color: var(--text-color);
}
.navbar {
border-bottom: 1px solid #E5E7EB;
}
.main-content {
min-height: calc(100vh - 100px);
}
.upload-section, .review-section {
max-width: 900px;
margin: auto;
}
.drop-zone {
border: 2px dashed #D1D5DB;
border-radius: var(--border-radius-lg);
padding: 4rem;
text-align: center;
cursor: pointer;
transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}
.drop-zone.is-dragover {
background-color: #E0E7FF;
border-color: var(--primary-color);
}
.drop-zone-icon {
width: 48px;
height: 48px;
color: #9CA3AF;
margin: 0 auto 1rem;
}
.btn-primary {
background-color: var(--primary-color);
border-color: var(--primary-color);
border-radius: var(--border-radius-sm);
font-weight: 500;
}
.btn-primary:hover {
background-color: #4338CA;
border-color: #4338CA;
}
.btn-light {
border-radius: var(--border-radius-sm);
font-weight: 500;
}
.spinner-border {
width: 3rem;
height: 3rem;
color: var(--primary-color);
}
.review-card {
background-color: var(--surface-color);
border: 1px solid #E5E7EB;
border-radius: var(--border-radius-lg);
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.document-preview {
background-color: #F3F4F6;
border-radius: var(--border-radius-lg);
display: flex;
align-items: center;
justify-content: center;
min-height: 200px;
color: var(--text-muted-color);
}
.form-label {
font-weight: 500;
}
.form-control {
border-radius: var(--border-radius-sm);
}

79
assets/js/main.js Normal file
View File

@ -0,0 +1,79 @@
document.addEventListener('DOMContentLoaded', function () {
const uploadSection = document.getElementById('uploadSection');
const reviewSection = document.getElementById('reviewSection');
const processingSection = document.getElementById('processingSection');
const dropZone = document.getElementById('dropZone');
const fileInput = document.getElementById('fileInput');
const startAutomationBtn = document.getElementById('startAutomationBtn');
const discardBtn = document.getElementById('discardBtn');
const uploadNewBtn = document.getElementById('uploadNewBtn');
function showSection(section) {
[uploadSection, reviewSection, processingSection].forEach(s => s.classList.add('d-none'));
section.classList.remove('d-none');
}
function handleFileSelect(file) {
if (!file) return;
showSection(processingSection);
// Simulate AI processing
setTimeout(() => {
// Mock data - in a real app, this would come from an API call
document.getElementById('firstName').value = 'Max';
document.getElementById('lastName').value = 'Mustermann';
document.getElementById('street').value = 'Musterstraße 1';
document.getElementById('zip').value = '12345';
document.getElementById('city').value = 'Berlin';
document.getElementById('dob').value = '1990-01-15';
showSection(reviewSection);
}, 2500);
}
// --- Event Listeners ---
dropZone.addEventListener('click', () => fileInput.click());
dropZone.addEventListener('dragover', (e) => {
e.preventDefault();
dropZone.classList.add('is-dragover');
});
dropZone.addEventListener('dragleave', (e) => {
e.preventDefault();
dropZone.classList.remove('is-dragover');
});
dropZone.addEventListener('drop', (e) => {
e.preventDefault();
dropZone.classList.remove('is-dragover');
if (e.dataTransfer.files.length) {
fileInput.files = e.dataTransfer.files;
handleFileSelect(fileInput.files[0]);
}
});
fileInput.addEventListener('change', () => {
if (fileInput.files.length) {
handleFileSelect(fileInput.files[0]);
}
});
startAutomationBtn.addEventListener('click', () => {
alert('This would start the automation process on the backend. This is just a UI mock-up for now!');
});
discardBtn.addEventListener('click', () => {
if(confirm('Are you sure you want to discard the extracted data?')) {
showSection(uploadSection);
}
});
uploadNewBtn.addEventListener('click', () => {
showSection(uploadSection);
});
// Initial state
showSection(uploadSection);
});

259
index.php
View File

@ -1,150 +1,119 @@
<?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>
<?php <title><?php echo htmlspecialchars($_SERVER['PROJECT_NAME'] ?? 'B2C Productivity Platform'); ?></title>
// Read project preview data from environment <meta name="description" content="<?php echo htmlspecialchars($_SERVER['PROJECT_DESCRIPTION'] ?? 'Automate administrative tasks with AI.'); ?>">
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? ''; <!-- Bootstrap 5 CSS -->
?> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<?php if ($projectDescription): ?>
<!-- Meta description --> <!-- Custom CSS -->
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' /> <link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
<!-- Open Graph meta tags -->
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
<!-- Twitter meta tags -->
<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"> <nav class="navbar navbar-expand-lg navbar-light bg-white">
<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"> <a class="navbar-brand fw-bold" href="/"><?php echo htmlspecialchars($_SERVER['PROJECT_NAME'] ?? 'FormAutomator'); ?></a>
<span class="sr-only">Loading…</span> </div>
</div> </nav>
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : '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> <main class="main-content container py-5">
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
</div> <!-- 1. Upload Section -->
</main> <section id="uploadSection" class="upload-section">
<footer> <div class="text-center mb-5">
Page updated: <?= htmlspecialchars($now) ?> (UTC) <h1 class="h2 fw-bold">Secure Document Upload</h1>
</footer> <p class="text-muted">Upload your form (PDF, PNG, JPG) to begin the automated process.</p>
</div>
<div id="dropZone" class="drop-zone">
<input type="file" id="fileInput" class="d-none" accept=".pdf,.png,.jpg,.jpeg">
<div class="drop-zone-icon">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 16.5V9.75m0 0l-3 3m3-3l3 3M6.75 19.5a4.5 4.5 0 01-1.41-8.775 5.25 5.25 0 0110.233-2.33 3 3 0 013.758 3.848A3.752 3.752 0 0118 19.5H6.75z" />
</svg>
</div>
<p class="mb-1 fw-bold">Drag & drop your file here</p>
<p class="text-muted mb-2">or click to browse</p>
<p class="small text-muted">PDF, PNG, or JPG (max 5MB)</p>
</div>
</section>
<!-- 2. Processing Section -->
<section id="processingSection" class="d-none text-center py-5">
<div class="spinner-border mb-4" role="status">
<span class="visually-hidden">Loading...</span>
</div>
<h2 class="h4 fw-bold">Extracting Data...</h2>
<p class="text-muted">Our AI is analyzing your document. This may take a moment.</p>
</section>
<!-- 3. Review Section -->
<section id="reviewSection" class="review-section d-none">
<div class="d-flex justify-content-between align-items-center mb-4">
<div>
<h1 class="h3 fw-bold">Review Extracted Data</h1>
<p class="text-muted">Please verify the information below before starting the automation.</p>
</div>
<button class="btn btn-light" id="uploadNewBtn">Upload New</button>
</div>
<div class="review-card">
<div class="row g-0">
<div class="col-md-5 d-none d-md-flex align-items-center justify-content-center p-4">
<div class="document-preview w-100 h-100">
<p>Document Preview</p>
</div>
</div>
<div class="col-md-7 p-4 p-lg-5">
<form>
<div class="row g-3">
<div class="col-md-6">
<label for="firstName" class="form-label">First Name</label>
<input type="text" class="form-control" id="firstName">
</div>
<div class="col-md-6">
<label for="lastName" class="form-label">Last Name</label>
<input type="text" class="form-control" id="lastName">
</div>
<div class="col-12">
<label for="street" class="form-label">Street Address</label>
<input type="text" class="form-control" id="street">
</div>
<div class="col-md-4">
<label for="zip" class="form-label">ZIP Code</label>
<input type="text" class="form-control" id="zip">
</div>
<div class="col-md-8">
<label for="city" class="form-label">City</label>
<input type="text" class="form-control" id="city">
</div>
<div class="col-12">
<label for="dob" class="form-label">Date of Birth</label>
<input type="date" class="form-control" id="dob">
</div>
</div>
<hr class="my-4">
<div class="d-flex justify-content-end gap-2">
<button type="button" id="discardBtn" class="btn btn-light">Discard</button>
<button type="button" id="startAutomationBtn" class="btn btn-primary">Approve & Start Automation</button>
</div>
</form>
</div>
</div>
</div>
</section>
</main>
<!-- Bootstrap 5 JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<!-- Custom JS -->
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</body> </body>
</html> </html>