Update frontend to add tab organisation

This commit is contained in:
pjmalandrino 2025-05-22 14:25:59 +02:00
parent 23a8ae5d4e
commit 3f2d2ec856
3 changed files with 476 additions and 546 deletions

View file

@ -3,136 +3,140 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DocTags Analyzer and Visualizer</title>
<title>DocTags Tools</title>
<link rel="stylesheet" href="static/styles.css">
<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;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Fira+Code&display=swap" rel="stylesheet">
</head>
<body>
<div id="app-container">
<h1>DocTags Analyzer and Visualizer</h1>
<h1>DocTags Analyzer and Visualizer</h1>
<div class="card">
<h3>Document Settings</h3>
<!-- Settings Panel -->
<div class="settings-panel">
<div class="settings-row">
<div class="form-group">
<label for="pdf_file">Select PDF Document:</label>
<label for="pdf_file">PDF File:</label>
<select id="pdf_file" name="pdf_file"></select>
<div id="pdf-load-status" class="status mt-1"></div>
<div id="pdf-load-status"></div>
</div>
<div class="form-group">
<label for="page_num">Page Number:</label>
<input type="number" id="page_num" name="page_num" value="1" min="1">
</div>
<div class="form-group">
<label class="checkbox-container">
<label for="adjust">
<input type="checkbox" id="adjust" name="adjust" checked>
<span class="checkmark"></span>
Auto-adjust coordinates
</label>
</div>
</div>
</div>
<div class="pipeline-container">
<div class="step-card">
<h3>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="2" y="2" width="20" height="8" rx="2" ry="2"></rect>
<rect x="2" y="14" width="20" height="8" rx="2" ry="2"></rect>
<line x1="6" y1="6" x2="6" y2="6"></line>
<line x1="6" y1="18" x2="6" y2="18"></line>
</svg>
Step 1: Analyze PDF
</h3>
<p>Extract DocTags structure from the selected PDF page</p>
<button id="analyzer-btn" onclick="runScript('analyzer')">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"></path>
<polyline points="14 2 14 8 20 8"></polyline>
<path d="M12 18v-6"></path>
<path d="M8 18v-1"></path>
<path d="M16 18v-3"></path>
</svg>
Run Analyzer
</button>
<div id="analyzer-status" class="status mt-2"></div>
</div>
<!-- Progress Indicator -->
<div class="progress-indicator">
<div class="step-indicator" id="step-1">1</div>
<div class="step-connector" id="connector-1"></div>
<div class="step-indicator" id="step-2">2</div>
<div class="step-connector" id="connector-2"></div>
<div class="step-indicator" id="step-3">3</div>
</div>
<div class="step-card">
<h3>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
<circle cx="8.5" cy="8.5" r="1.5"></circle>
<polyline points="21 15 16 10 5 21"></polyline>
</svg>
Step 2: Generate Visualization
</h3>
<p>Create visual representation of the extracted DocTags</p>
<button id="visualizer-btn" onclick="runScript('visualizer')">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="3" width="18" height="18" rx="2"></rect>
<path d="M3 9h18"></path>
<path d="M9 21V9"></path>
</svg>
Run Visualizer
</button>
<div id="visualizer-status" class="status mt-2"></div>
</div>
<div class="step-card">
<h3>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path>
<polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline>
<line x1="12" y1="22.08" x2="12" y2="12"></line>
</svg>
Step 3: Extract Pictures
</h3>
<p>Extract images from the document based on DocTags</p>
<button id="extractor-btn" onclick="runScript('extractor')">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M4 22h16a2 2 0 0 0 2-2V9a1 1 0 0 0-1-1h-6.34a1 1 0 0 1-.7-.29l-3.32-3.3a1 1 0 0 0-.7-.29H4a2 2 0 0 0-2 2v14.93a2 2 0 0 0 2 2z"></path>
<polyline points="8 17 12 13 16 17"></polyline>
<line x1="12" y1="13" x2="12" y2="22"></line>
</svg>
Run Picture Extractor
</button>
<div id="extractor-status" class="status mt-2"></div>
</div>
</div>
<div id="output" class="hidden"></div>
<div id="image-container" class="hidden">
<h2>Visualization Result</h2>
<img id="result-image" src="" alt="Visualization">
</div>
<div id="environment-check" class="hidden">
<h3>Environment Status</h3>
<div id="env-details"></div>
</div>
<div class="debug-section">
<button onclick="checkEnvironment()">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
<polyline points="15 3 21 3 21 9"></polyline>
<line x1="10" y1="14" x2="21" y2="3"></line>
</svg>
Check Environment
<!-- Tabs Container -->
<div class="tabs-container">
<!-- Tab Buttons -->
<div class="tab-buttons">
<button class="tab-button active" onclick="switchTab('analyzer')">
📄 Step 1: Analyze PDF
</button>
<button onclick="manuallyRunScript()">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="16 18 22 12 16 6"></polyline>
<polyline points="8 6 2 12 8 18"></polyline>
</svg>
Run Manual Command
<button class="tab-button" onclick="switchTab('visualizer')">
🎨 Step 2: Visualize
</button>
<button class="tab-button" onclick="switchTab('extractor')">
🖼️ Step 3: Extract Pictures
</button>
</div>
<!-- Tab Contents -->
<div id="analyzer-tab" class="tab-content active">
<h3>📄 Analyze PDF</h3>
<p>Extract DocTags structure from the PDF page using AI-powered document analysis.</p>
<button id="analyzer-btn" onclick="runScript('analyzer')">
🚀 Run Analysis
</button>
<div id="analyzer-status" class="status hidden"></div>
<div class="tab-description">
<strong>What this does:</strong>
<ul>
<li>Converts the PDF page to an image</li>
<li>Uses AI to identify document structure (headers, text, images, tables)</li>
<li>Generates DocTags with precise coordinate information</li>
<li>Saves the results to the <code>results/</code> folder</li>
</ul>
</div>
</div>
<div id="visualizer-tab" class="tab-content">
<h3>🎨 Visualize DocTags</h3>
<p>Create a visual representation of the extracted DocTags with bounding boxes around detected elements.</p>
<button id="visualizer-btn" onclick="runScript('visualizer')" disabled>
🎨 Generate Visualization
</button>
<div id="visualizer-status" class="status hidden"></div>
<div id="image-container" class="hidden">
<h4>Visualization Result</h4>
<img id="result-image" src="" alt="Visualization">
</div>
<div class="tab-description">
<strong>What this does:</strong>
<ul>
<li>Reads the DocTags file from Step 1</li>
<li>Overlays colored rectangles on the original PDF page</li>
<li>Each element type gets a different color (headers, text, images, etc.)</li>
<li>Saves the visualization as a PNG image</li>
</ul>
</div>
</div>
<div id="extractor-tab" class="tab-content">
<h3>🖼️ Extract Pictures</h3>
<p>Extract individual images from the document based on the detected picture regions.</p>
<button id="extractor-btn" onclick="runScript('extractor')" disabled>
🖼️ Extract Images
</button>
<div id="extractor-status" class="status hidden"></div>
<div class="tab-description">
<strong>What this does:</strong>
<ul>
<li>Identifies picture regions from the DocTags</li>
<li>Crops and extracts individual images</li>
<li>Saves each image as a separate PNG file</li>
<li>Creates an HTML index of all extracted images</li>
</ul>
</div>
</div>
</div>
<!-- Output Section -->
<div id="output" class="output hidden"></div>
<!-- Environment Check -->
<div id="environment-check" class="hidden">
<h3>Environment Check</h3>
<div id="env-details"></div>
</div>
<!-- Debug Section -->
<div class="debug-section">
<button onclick="checkEnvironment()">🔍 Environment Check</button>
<button onclick="manuallyRunScript()">⚙️ Manual Command</button>
</div>
<script src="static/app.js"></script>

View file

@ -2,47 +2,47 @@
const activeTasks = {};
let pollingInterval = null;
// Helper functions for UI
const UI = {
showLoader: (elementId) => {
const el = document.getElementById(elementId);
el.innerHTML = '<div class="loader"></div><span class="working">Processing...</span>';
},
showSuccess: (elementId, message = 'Completed') => {
const el = document.getElementById(elementId);
el.innerHTML = `<span class="success">✓ ${message}</span>`;
},
showError: (elementId, message = 'Failed') => {
const el = document.getElementById(elementId);
el.innerHTML = `<span class="error">✗ ${message}</span>`;
},
showOutput: (content) => {
const outputDiv = document.getElementById('output');
outputDiv.textContent = content;
outputDiv.classList.remove('hidden');
// Scroll to show output
outputDiv.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
},
showImage: (src) => {
const img = document.getElementById('result-image');
const container = document.getElementById('image-container');
img.src = src;
container.classList.remove('hidden');
// Scroll to show image
container.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
},
enableButton: (buttonId) => {
document.getElementById(buttonId).disabled = false;
},
disableButton: (buttonId) => {
document.getElementById(buttonId).disabled = true;
// Tab switching functionality
function switchTab(tabName) {
// Hide all tab contents
const tabContents = document.querySelectorAll('.tab-content');
tabContents.forEach(content => content.classList.remove('active'));
// Remove active class from all tab buttons
const tabButtons = document.querySelectorAll('.tab-button');
tabButtons.forEach(button => button.classList.remove('active'));
// Show selected tab content
document.getElementById(tabName + '-tab').classList.add('active');
// Add active class to selected tab button
event.target.classList.add('active');
}
// Update progress indicator
function updateProgress(completedSteps) {
for (let i = 1; i <= 3; i++) {
const stepIndicator = document.getElementById(`step-${i}`);
const connector = document.getElementById(`connector-${i}`);
if (i <= completedSteps) {
stepIndicator.classList.add('completed');
stepIndicator.classList.remove('active');
if (connector) connector.classList.add('completed');
} else if (i === completedSteps + 1) {
stepIndicator.classList.add('active');
stepIndicator.classList.remove('completed');
} else {
stepIndicator.classList.remove('completed', 'active');
if (connector) connector.classList.remove('completed');
}
}
};
}
// Load PDF files on page load
window.addEventListener('DOMContentLoaded', function() {
const pdfStatus = document.getElementById('pdf-load-status');
pdfStatus.innerHTML = '<div class="loader"></div><span class="working">Loading PDF files...</span>';
pdfStatus.innerHTML = '<div class="loader"></div> Loading PDF files...';
fetch('/pdf-files')
.then(response => {
@ -54,7 +54,7 @@ window.addEventListener('DOMContentLoaded', function() {
.then(data => {
const select = document.getElementById('pdf_file');
if (data.length === 0) {
UI.showError('pdf-load-status', 'No PDF files found in the current directory');
pdfStatus.innerHTML = '<span class="error">No PDF files found in the current directory</span>';
return;
}
@ -64,11 +64,11 @@ window.addEventListener('DOMContentLoaded', function() {
option.textContent = file;
select.appendChild(option);
});
UI.showSuccess('pdf-load-status', `Loaded ${data.length} PDF files`);
pdfStatus.innerHTML = '<span class="success">Loaded ' + data.length + ' PDF files</span>';
})
.catch(error => {
console.error('Error loading PDFs:', error);
UI.showError('pdf-load-status', `Error: ${error.message}`);
pdfStatus.innerHTML = '<span class="error">Error: ' + error.message + '</span>';
});
// Run an environment check on startup
@ -81,59 +81,55 @@ function checkEnvironment() {
const envDetails = document.getElementById('env-details');
envDiv.classList.remove('hidden');
envDetails.innerHTML = '<div class="loader"></div><span class="working">Checking environment...</span>';
envDetails.innerHTML = '<div class="loader"></div> Checking environment...';
fetch('/check-environment')
.then(response => response.json())
.then(data => {
let html = '<div class="mt-2">';
let html = '<ul>';
// Current working directory
html += `<p><strong>Working directory:</strong> <code>${data.cwd}</code></p>`;
html += '<li>Working directory: <code>' + data.cwd + '</code></li>';
// Python version
html += `<p><strong>Python version:</strong> <code>${data.python_version}</code></p>`;
html += '<li>Python version: <code>' + data.python_version + '</code></li>';
// Required scripts check
if (data.missing_scripts.length === 0) {
html += '<p class="env-success">All required scripts found</p>';
html += '<li class="env-success">✓ All required scripts found</li>';
} else {
html += `<p class="env-error">Missing scripts: <code>${data.missing_scripts.join(', ')}</code></p>`;
html += '<li class="env-error">✗ Missing scripts: <code>' + data.missing_scripts.join(', ') + '</code></li>';
}
// PDF files check
if (data.pdf_files.length > 0) {
html += `<p class="env-success">Found ${data.pdf_files.length} PDF files</p>`;
html += '<details class="mt-1"><summary>PDF Files</summary><ul>';
data.pdf_files.forEach(file => {
html += `<li><code>${file}</code></li>`;
});
html += '</ul></details>';
html += '<li class="env-success">✓ Found ' + data.pdf_files.length + ' PDF files: <code>' + data.pdf_files.join(', ') + '</code></li>';
} else {
html += '<p class="env-error">No PDF files found in the working directory</p>';
html += '<li class="env-error">✗ No PDF files found in the working directory</li>';
}
// Results directory check
if (data.results_dir_exists) {
html += '<p class="env-success">Results directory exists</p>';
html += '<li class="env-success">✓ Results directory exists</li>';
if (data.results_dir_writable) {
html += '<p class="env-success">Results directory is writable</p>';
html += '<li class="env-success">✓ Results directory is writable</li>';
} else {
html += '<p class="env-error">Results directory is not writable</p>';
html += '<li class="env-error">✗ Results directory is not writable</li>';
}
} else {
html += '<p class="env-error">Results directory does not exist</p>';
html += '<li class="env-error">✗ Results directory does not exist</li>';
}
html += '</div>';
html += '</ul>';
// List of all files for debugging (collapsible)
html += `<details class="mt-2"><summary>All files in directory (${data.files.length} files)</summary><pre>${data.files.join('\n')}</pre></details>`;
// List of all files for debugging
html += '<details><summary>All files in directory (' + data.files.length + ' files)</summary><pre>' +
data.files.join('\n') + '</pre></details>';
envDetails.innerHTML = html;
})
.catch(error => {
envDetails.innerHTML = `<div class="env-error mt-2">Error checking environment: ${error.message}</div>`;
envDetails.innerHTML = '<div class="env-error">Error checking environment: ' + error.message + '</div>';
});
}
@ -142,7 +138,9 @@ function manuallyRunScript() {
const command = prompt("Enter command to run (e.g., 'python analyzer.py --image document.pdf --page 1')");
if (!command) return;
UI.showOutput(`Running command: ${command}\nPlease wait...`);
const outputDiv = document.getElementById('output');
outputDiv.textContent = 'Running command: ' + command + '\nPlease wait...';
outputDiv.classList.remove('hidden');
// Create form data
const formData = new FormData();
@ -155,12 +153,13 @@ function manuallyRunScript() {
})
.then(response => response.json())
.then(data => {
UI.showOutput(
`Command: ${command}\n\n${data.success ? 'Success!\n\n' : 'Failed!\n\n'}${data.output || ''}${data.error ? '\n\nError: ' + data.error : ''}`
);
outputDiv.textContent = 'Command: ' + command + '\n\n' +
(data.success ? 'Success!\n\n' : 'Failed!\n\n') +
(data.output || '') +
(data.error ? '\n\nError: ' + data.error : '');
})
.catch(error => {
UI.showOutput(`Error running command: ${error.message}`);
outputDiv.textContent = 'Error running command: ' + error.message;
});
}
@ -200,24 +199,32 @@ function pollTasks() {
if (data.done) {
if (data.success) {
// Task completed successfully
UI.showSuccess(`${taskInfo.type}-status`, 'Completed');
statusElement.innerHTML = '<span class="success">✓ Completed successfully!</span>';
statusElement.classList.remove('hidden');
// Enable button
UI.enableButton(`${taskInfo.type}-btn`);
document.getElementById(`${taskInfo.type}-btn`).disabled = false;
// Display output
UI.showOutput(data.output);
const outputDiv = document.getElementById('output');
outputDiv.textContent = data.output;
outputDiv.classList.remove('hidden');
// Show image if available for visualizer
if (taskInfo.type === 'visualizer' && data.image_file) {
UI.showImage(`/${data.image_file}?t=${new Date().getTime()}`);
document.getElementById('result-image').src = '/' + data.image_file + '?t=' + new Date().getTime();
document.getElementById('image-container').classList.remove('hidden');
}
// Enable next step button if applicable
// Enable next step button and update progress
if (taskInfo.type === 'analyzer') {
UI.enableButton('visualizer-btn');
document.getElementById('visualizer-btn').disabled = false;
updateProgress(1);
} else if (taskInfo.type === 'visualizer') {
UI.enableButton('extractor-btn');
document.getElementById('extractor-btn').disabled = false;
updateProgress(2);
} else if (taskInfo.type === 'extractor') {
updateProgress(3);
}
// Remove from active tasks
@ -225,11 +232,14 @@ function pollTasks() {
checkAndStopPolling();
} else {
// Task failed
UI.showError(`${taskInfo.type}-status`, data.error || 'Unknown error');
UI.enableButton(`${taskInfo.type}-btn`);
statusElement.innerHTML = '<span class="error">✗ Failed: ' + (data.error || 'Unknown error') + '</span>';
statusElement.classList.remove('hidden');
document.getElementById(`${taskInfo.type}-btn`).disabled = false;
// Display error output
UI.showOutput(`Error: ${data.error || 'Unknown error'}`);
const outputDiv = document.getElementById('output');
outputDiv.textContent = 'Error: ' + (data.error || 'Unknown error');
outputDiv.classList.remove('hidden');
// Remove from active tasks
delete activeTasks[taskId];
@ -237,17 +247,12 @@ function pollTasks() {
}
} else {
// Still running
statusElement.innerHTML = '<div class="loader"></div><span class="working">Processing...</span>';
statusElement.innerHTML = '<div class="loader"></div><span class="working">Running...</span>';
statusElement.classList.remove('hidden');
}
})
.catch(error => {
console.error('Error checking task status:', error);
UI.showError(`${taskInfo.type}-status`, 'Failed to check status');
UI.enableButton(`${taskInfo.type}-btn`);
// Remove from active tasks to prevent endless error messages
delete activeTasks[taskId];
checkAndStopPolling();
});
}
}
@ -263,7 +268,8 @@ function runScript(script) {
}
// Disable button
UI.disableButton(`${script}-btn`);
const button = document.getElementById(`${script}-btn`);
button.disabled = true;
// Create form data
const formData = new FormData();
@ -272,7 +278,9 @@ function runScript(script) {
formData.append('adjust', adjust);
// Show running status
UI.showLoader(`${script}-status`);
const statusElement = document.getElementById(`${script}-status`);
statusElement.innerHTML = '<div class="loader"></div><span class="working">Starting...</span>';
statusElement.classList.remove('hidden');
// Clear previous output
document.getElementById('output').classList.add('hidden');
@ -288,13 +296,14 @@ function runScript(script) {
case 'analyzer':
endpoint = '/run-analyzer';
// Disable next step buttons
UI.disableButton('visualizer-btn');
UI.disableButton('extractor-btn');
document.getElementById('visualizer-btn').disabled = true;
document.getElementById('extractor-btn').disabled = true;
updateProgress(0);
break;
case 'visualizer':
endpoint = '/run-visualizer';
// Disable next step button
UI.disableButton('extractor-btn');
document.getElementById('extractor-btn').disabled = true;
break;
case 'extractor':
endpoint = '/run-extractor';
@ -324,25 +333,31 @@ function runScript(script) {
startPolling();
// Update status
UI.showLoader(`${script}-status`);
statusElement.innerHTML = '<div class="loader"></div><span class="working">Running...</span>';
// Show initial output
UI.showOutput(data.message || 'Task started, please wait...');
const outputDiv = document.getElementById('output');
outputDiv.textContent = data.message || 'Task started, please wait...';
outputDiv.classList.remove('hidden');
} else {
// Failed to start task
UI.showError(`${script}-status`, 'Failed to start task');
UI.enableButton(`${script}-btn`);
statusElement.innerHTML = '<span class="error">✗ Failed to start task</span>';
button.disabled = false;
// Show error
UI.showOutput(`Error: ${data.error || 'Failed to start task'}`);
const outputDiv = document.getElementById('output');
outputDiv.textContent = 'Error: ' + (data.error || 'Failed to start task');
outputDiv.classList.remove('hidden');
}
})
.catch(error => {
console.error('Error starting task:', error);
UI.showError(`${script}-status`, error.message);
UI.enableButton(`${script}-btn`);
statusElement.innerHTML = '<span class="error">✗ ' + error.message + '</span>';
button.disabled = false;
// Show error
UI.showOutput(`Error: ${error.message}`);
const outputDiv = document.getElementById('output');
outputDiv.textContent = 'Error: ' + error.message;
outputDiv.classList.remove('hidden');
});
}

View file

@ -1,431 +1,342 @@
/* Modern stylesheet for DocTags Analyzer and Visualizer */
:root {
/* Color palette */
--bg-color: #f8f1ee;
--primary-color: #195162;
--secondary-color: #618794;
--light-color: #e6eaf1;
--mint: #b9e9da;
--amber: #ffdb96;
--pale-rose: #ffc9c9;
--white: #ffffff;
--error: #e74c3c;
--success: #2ecc71;
--warning: #f39c12;
--shadow: rgba(25, 81, 98, 0.1);
/* Typography */
--font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
--font-mono: 'Fira Code', 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}
/* Base styles */
body {
font-family: var(--font-sans);
background-color: var(--bg-color);
color: var(--primary-color);
line-height: 1.6;
margin: 0;
padding: 0;
}
#app-container {
max-width: 1200px;
font-family: Arial, sans-serif;
max-width: 900px;
margin: 0 auto;
padding: 2rem;
}
h1, h2, h3, h4, h5, h6 {
color: var(--primary-color);
margin-top: 0;
font-weight: 600;
padding: 20px;
background-color: #f5f5f5;
}
h1 {
font-size: 2.25rem;
margin-bottom: 1.5rem;
position: relative;
display: inline-block;
color: #333;
text-align: center;
margin-bottom: 30px;
}
h1::after {
content: '';
position: absolute;
width: 50%;
height: 4px;
background-color: var(--secondary-color);
bottom: -8px;
left: 0;
border-radius: 2px;
}
h3 {
font-size: 1.35rem;
color: var(--secondary-color);
margin-bottom: 1rem;
}
/* Card Component */
.card {
background-color: var(--white);
border-radius: 12px;
box-shadow: 0 8px 16px var(--shadow);
padding: 1.5rem;
margin-bottom: 1.5rem;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
transform: translateY(-4px);
box-shadow: 0 10px 20px var(--shadow);
}
/* Form Elements */
/* Common form styles */
.form-group {
margin-bottom: 1.5rem;
margin-bottom: 15px;
}
label {
display: block;
margin-bottom: 0.5rem;
font-weight: 500;
color: var(--primary-color);
margin-bottom: 5px;
font-weight: bold;
}
select, input[type="number"], input[type="text"] {
select, input {
padding: 8px;
width: 100%;
padding: 12px 16px;
border: 2px solid var(--light-color);
border-radius: 8px;
background-color: var(--white);
font-size: 1rem;
color: var(--primary-color);
transition: border-color 0.2s ease, box-shadow 0.2s ease;
-webkit-appearance: none;
appearance: none;
}
select {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23618794' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 16px center;
padding-right: 48px;
}
select:focus, input:focus {
outline: none;
border-color: var(--secondary-color);
box-shadow: 0 0 0 3px rgba(97, 135, 148, 0.25);
}
.checkbox-container {
display: flex;
align-items: center;
position: relative;
cursor: pointer;
user-select: none;
}
.checkbox-container input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
.checkmark {
height: 24px;
width: 24px;
background-color: var(--white);
border: 2px solid var(--light-color);
max-width: 300px;
border: 1px solid #ddd;
border-radius: 4px;
margin-right: 10px;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s ease;
}
.checkbox-container:hover input ~ .checkmark {
background-color: var(--light-color);
}
.checkbox-container input:checked ~ .checkmark {
background-color: var(--secondary-color);
border-color: var(--secondary-color);
}
.checkmark:after {
content: "";
display: none;
width: 5px;
height: 10px;
border: solid white;
border-width: 0 2px 2px 0;
transform: rotate(45deg);
}
.checkbox-container input:checked ~ .checkmark:after {
display: block;
}
/* Buttons */
button {
background-color: var(--secondary-color);
padding: 12px 20px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 8px;
padding: 12px 24px;
font-size: 1rem;
font-weight: 500;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.2s ease, transform 0.1s ease;
display: inline-flex;
align-items: center;
justify-content: center;
margin-right: 10px;
margin-bottom: 10px;
font-size: 14px;
transition: background-color 0.3s;
}
button:hover:not(:disabled) {
background-color: var(--primary-color);
transform: translateY(-2px);
}
button:active:not(:disabled) {
transform: translateY(0);
button:hover {
background-color: #45a049;
}
button:disabled {
background-color: var(--light-color);
color: var(--secondary-color);
background-color: #cccccc;
cursor: not-allowed;
opacity: 0.7;
}
button svg {
margin-right: 8px;
.output {
margin-top: 20px;
padding: 15px;
border: 1px solid #ddd;
border-radius: 4px;
background-color: #fff;
white-space: pre-wrap;
max-height: 300px;
overflow-y: auto;
font-family: monospace;
font-size: 12px;
}
/* Status indicators */
.status {
margin-top: 1rem;
font-weight: 500;
.hidden {
display: none;
}
img {
max-width: 100%;
margin-top: 10px;
border: 1px solid #ddd;
border-radius: 4px;
}
/* Tab styles */
.tabs-container {
background-color: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
overflow: hidden;
}
.tab-buttons {
display: flex;
align-items: center;
background-color: #f8f9fa;
border-bottom: 1px solid #ddd;
}
.tab-button {
flex: 1;
padding: 15px 20px;
background-color: transparent;
border: none;
cursor: pointer;
font-size: 16px;
font-weight: 500;
color: #666;
transition: all 0.3s;
border-bottom: 3px solid transparent;
}
.tab-button:hover {
background-color: #e9ecef;
color: #333;
}
.tab-button.active {
background-color: white;
color: #4CAF50;
border-bottom-color: #4CAF50;
}
.tab-content {
display: none;
padding: 30px;
background-color: white;
}
.tab-content.active {
display: block;
}
.tab-content h3 {
color: #333;
margin-top: 0;
margin-bottom: 10px;
}
.tab-content p {
color: #666;
margin-bottom: 20px;
}
/* Tab description styles */
.tab-description {
margin-top: 20px;
color: #666;
font-size: 14px;
}
.tab-description ul {
margin-top: 10px;
}
.tab-description li {
margin-bottom: 5px;
}
.tab-description code {
background-color: #f1f3f4;
padding: 2px 4px;
border-radius: 3px;
font-size: 13px;
}
/* Status styles */
.status {
font-weight: bold;
margin-top: 15px;
padding: 10px;
border-radius: 4px;
background-color: #f8f9fa;
}
.error {
color: var(--error);
color: #d32f2f;
background-color: #ffebee;
}
.success {
color: var(--success);
color: #43a047;
background-color: #e8f5e8;
}
.working {
color: var(--secondary-color);
color: #1976d2;
background-color: #e3f2fd;
}
.loader {
display: inline-block;
width: 20px;
height: 20px;
margin-right: 10px;
border: 3px solid var(--light-color);
border: 3px solid #f3f3f3;
border-top: 3px solid #3498db;
border-radius: 50%;
border-top-color: var(--secondary-color);
animation: spin 1s ease-in-out infinite;
width: 16px;
height: 16px;
animation: spin 1s linear infinite;
display: inline-block;
vertical-align: middle;
margin-right: 8px;
}
@keyframes spin {
to { transform: rotate(360deg); }
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Pipeline Container */
.pipeline-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1.5rem;
margin: 2rem 0;
/* Settings panel */
.settings-panel {
background-color: #fff;
padding: 20px;
border-radius: 8px;
margin-bottom: 20px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
/* Step Cards */
.step-card {
background-color: var(--white);
border-radius: 12px;
border-left: 5px solid var(--mint);
box-shadow: 0 4px 12px var(--shadow);
padding: 1.5rem;
transition: transform 0.2s ease, box-shadow 0.2s ease;
.settings-row {
display: flex;
flex-direction: column;
gap: 20px;
align-items: end;
flex-wrap: wrap;
}
.step-card:nth-child(2) {
border-left-color: var(--amber);
.settings-row .form-group {
flex: 1;
min-width: 200px;
}
.step-card:nth-child(3) {
border-left-color: var(--pale-rose);
}
.step-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 16px var(--shadow);
}
.step-card h3 {
margin-top: 0;
display: flex;
align-items: center;
}
.step-card h3 svg {
margin-right: 10px;
}
.step-card p {
color: var(--secondary-color);
margin-bottom: 1.5rem;
flex-grow: 1;
}
/* Environment Check Panel */
/* Environment check styles */
#environment-check {
background-color: var(--white);
border-radius: 12px;
box-shadow: 0 4px 12px var(--shadow);
padding: 1.5rem;
margin-top: 2rem;
margin-top: 20px;
padding: 15px;
background-color: #fff3cd;
border: 1px solid #ffeeba;
border-radius: 4px;
}
.env-success {
color: var(--success);
display: flex;
align-items: center;
color: #155724;
}
.env-error {
color: var(--error);
display: flex;
align-items: center;
color: #721c24;
}
.env-success::before, .env-error::before {
content: '';
display: inline-block;
width: 16px;
height: 16px;
margin-right: 8px;
border-radius: 50%;
}
.env-success::before {
background-color: var(--success);
}
.env-error::before {
background-color: var(--error);
}
/* Output Container */
#output {
background-color: var(--white);
border-radius: 12px;
padding: 1.5rem;
white-space: pre-wrap;
font-family: var(--font-mono);
font-size: 0.9rem;
line-height: 1.6;
color: var(--primary-color);
overflow-x: auto;
box-shadow: 0 4px 12px var(--shadow);
max-height: 300px;
overflow-y: auto;
}
/* Image Container */
#image-container {
background-color: var(--white);
border-radius: 12px;
padding: 1.5rem;
box-shadow: 0 4px 12px var(--shadow);
margin-top: 2rem;
}
#image-container h2 {
margin-top: 0;
margin-bottom: 1rem;
display: flex;
align-items: center;
}
#image-container h2::before {
content: '';
display: inline-block;
width: 24px;
height: 24px;
margin-right: 10px;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23618794' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpolyline points='21 15 16 10 5 21'/%3E%3C/svg%3E");
background-repeat: no-repeat;
}
#result-image {
max-width: 100%;
border-radius: 8px;
box-shadow: 0 2px 8px var(--shadow);
}
/* Debug Section */
.debug-section {
margin-top: 3rem;
padding-top: 1.5rem;
border-top: 1px dashed var(--light-color);
margin-top: 30px;
border-top: 1px solid #ddd;
padding-top: 20px;
text-align: center;
}
.debug-section button {
background-color: #6c757d;
margin: 0 5px;
}
.debug-section button:hover {
background-color: #5a6268;
}
/* Image container styles */
#image-container {
margin-top: 20px;
text-align: center;
}
#image-container h4 {
color: #333;
margin-bottom: 15px;
}
/* Progress indicator */
.progress-indicator {
display: flex;
gap: 1rem;
justify-content: center;
align-items: center;
margin: 20px 0;
}
/* Utility Classes */
.hidden {
display: none !important;
.step-indicator {
width: 30px;
height: 30px;
border-radius: 50%;
background-color: #ddd;
color: white;
display: flex;
align-items: center;
justify-content: center;
margin: 0 10px;
font-weight: bold;
transition: background-color 0.3s;
}
.mt-1 {
margin-top: 0.5rem;
.step-indicator.completed {
background-color: #4CAF50;
}
.mt-2 {
margin-top: 1rem;
.step-indicator.active {
background-color: #2196F3;
}
.mt-4 {
margin-top: 2rem;
.step-connector {
width: 50px;
height: 2px;
background-color: #ddd;
transition: background-color 0.3s;
}
.mb-1 {
margin-bottom: 0.5rem;
.step-connector.completed {
background-color: #4CAF50;
}
.mb-2 {
margin-bottom: 1rem;
}
.mb-4 {
margin-bottom: 2rem;
}
/* Responsive adjustments */
/* Responsive design */
@media (max-width: 768px) {
#app-container {
padding: 1rem;
body {
padding: 10px;
}
.pipeline-container {
grid-template-columns: 1fr;
.tab-buttons {
flex-direction: column;
}
button {
width: 100%;
.tab-button {
text-align: center;
border-bottom: 1px solid #ddd;
border-right: none;
}
.tab-button.active {
border-bottom: 1px solid #4CAF50;
border-left: 3px solid #4CAF50;
}
.settings-row {
flex-direction: column;
gap: 10px;
}
.progress-indicator {
flex-wrap: wrap;
gap: 10px;
}
.step-connector {
display: none;
}
}