Spaces:
Running
Please add the following missing functionality to complete the design:
Browse files1. **Interactive Workflow Navigation** - Add "Next Step" buttons and step state management
2. **Dedicated Settings Panel** - Create a separate settings view that appears when "Settings" step is active
3. **Loading States** - Add progress indicators for file upload and harvest calculation
4. **Toast Notification System** - Add error/success message display area
5. **Enhanced File Upload States** - Show success/error states with proper feedback
6. **Interactive Data Tables** - Make Preview Data table editable with action buttons
7. **Real-time Calculations** - Update estimates as users change inputs
8. **Collapsible Panel Functionality** - Make Preview Data and Results panels expandable
9. **Form Validation** - Add validation for all input fields
10. **Responsive Mobile Layout** - Ensure all new components work on mobile
Please integrate these features while maintaining the current clean design and ensuring all functionality is properly connected with JavaScript event handlers.
83 unmodified lines84858687888990913 unmodified lines9596979899100101102103104105106107108109110111112113114115116117118119120121176 unmodified lines29829930030130230330430530630730830979 unmodified lines38939039139239339439539639739839983 unmodified lines<div class="bg-white dark:bg-gray-800 rounded-xl shadow-lg overflow-hidden border border-gray-200 dark:border-gray-700 glow-card"><div class="md:flex"><!-- Left Panel --><div class="md:w-1/2 p-8 md:p-10"><div class="mb-8"><div class="flex items-center mb-4"><div class="bg-primary-100 dark:bg-primary-900 p-2 rounded-full mr-3"><i data-feather="bar-chart-2" class="text-primary-600 dark:text-primary-400 w-5 h-5"></i>3 unmodified lines<p class="text-gray-600 dark:text-gray-400">Maximize your portfolio's tax efficiency with intelligent harvesting.</p><div class="flex justify-between items-center mt-6 bg-gray-100 dark:bg-gray-700 p-4 rounded-lg"><div class="flex items-center"><div class="bg-primary-100 dark:bg-primary-900 p-2 rounded-full mr-3"><i data-feather="upload" class="text-primary-600 dark:text-primary-400 w-4 h-4"></i></div><span class="font-medium">Upload</span></div><i data-feather="arrow-right" class="text-gray-400 dark:text-gray-500 w-5 h-5 mx-2"></i><div class="flex items-center"><div class="bg-gray-200 dark:bg-gray-600 p-2 rounded-full mr-3"><i data-feather="settings" class="text-gray-500 dark:text-gray-300 w-4 h-4"></i></div><span class="text-gray-500 dark:text-gray-300">Settings</span></div><i data-feather="arrow-right" class="text-gray-400 dark:text-gray-500 w-5 h-5 mx-2"></i><div class="flex items-center"><div class="bg-gray-200 dark:bg-gray-600 p-2 rounded-full mr-3"><i data-feather="dollar-sign" class="text-gray-500 dark:text-gray-300 w-4 h-4"></i></div><span class="text-gray-500 dark:text-gray-300">Harvest</span></div></div></div><!-- Upload Section -->176 unmodified lines</div></div></div><script>feather.replace();// Initialize Vanta.jsVANTA.GLOBE({el: "#vanta-bg",mouseControls: true,touchControls: true,79 unmodified linesfunction handleFiles(files) {([...files]).forEach(uploadFile);}function uploadFile(file) {console.log('File uploaded:', file.name);// Here you would typically handle the file upload}</script></body></html>83 unmodified lines84858687888990913 unmodified lines9596979899100101102103104105106107108109110111112113114115116117118119120121176 unmodified lines29829930030130230330430530630730830931031131231331479 unmodified lines39439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369483 unmodified lines<div class="bg-white dark:bg-gray-800 rounded-xl shadow-lg overflow-hidden border border-gray-200 dark:border-gray-700 glow-card"><div class="md:flex"><!-- Left Panel --><div class="md:w-1/2 p-8 md:p-10" id="uploadPanel"><div class="mb-8"><div class="flex items-center mb-4"><div class="bg-primary-100 dark:bg-primary-900 p-2 rounded-full mr-3"><i data-feather="bar-chart-2" class="text-primary-600 dark:text-primary-400 w-5 h-5"></i>3 unmodified lines<p class="text-gray-600 dark:text-gray-400">Maximize your portfolio's tax efficiency with intelligent harvesting.</p><div class="flex justify-between items-center mt-6 bg-gray-100 dark:bg-gray-700 p-4 rounded-lg"><div class="flex items-center workflow-step" data-step="upload"><div class="bg-primary-100 dark:bg-primary-900 p-2 rounded-full mr-3"><i data-feather="upload" class="text-primary-600 dark:text-primary-400 w-4 h-4"></i></div><span class="font-medium">Upload</span></div><i data-feather="arrow-right" class="text-gray-400 dark:text-gray-500 w-5 h-5 mx-2"></i><div class="flex items-center workflow-step" data-step="settings"><div class="bg-gray-200 dark:bg-gray-600 p-2 rounded-full mr-3"><i data-feather="settings" class="text-gray-500 dark:text-gray-300 w-4 h-4"></i></div><span class="text-gray-500 dark:text-gray-300">Settings</span></div><i data-feather="arrow-right" class="text-gray-400 dark:text-gray-500 w-5 h-5 mx-2"></i><div class="flex items-center workflow-step" data-step="harvest"><div class="bg-gray-200 dark:bg-gray-600 p-2 rounded-full mr-3"><i data-feather="dollar-sign" class="text-gray-500 dark:text-gray-300 w-4 h-4"></i></div><span class="text-gray-500 dark:text-gray-300">Harvest</span></div></div></div><!-- Upload Section -->176 unmodified lines</div></div></div><!-- Toast Notification Container --><div id="toastContainer" class="fixed top-4 left-1/2 transform -translate-x-1/2 z-50 space-y-2 w-full max-w-md px-4"></div><script>feather.replace();// Current step trackinglet currentStep = 'upload';// Initialize Vanta.jsVANTA.GLOBE({el: "#vanta-bg",mouseControls: true,touchControls: true,79 unmodified linesfunction handleFiles(files) {([...files]).forEach(uploadFile);}function uploadFile(file) {// Show loading stateshowLoading('upload', 'Processing your file...');// Simulate file processingsetTimeout(() => {hideLoading('upload');if (file.name.endsWith('.pdf') || file.name.endsWith('.csv') || file.name.endsWith('.xlsx')) {showToast('File uploaded successfully!', 'success');updateFileUploadSuccess(file.name);enableNextStep('settings');} else {showToast('Invalid file type. Please upload PDF, CSV, or XLSX.', 'error');}}, 2000);}function updateFileUploadSuccess(filename) {const dropzone = document.getElementById('dropzone');dropzone.innerHTML = `<div class="flex flex-col items-center"><i data-feather="check-circle" class="w-12 h-12 text-green-500 mb-3"></i><h3 class="text-lg font-medium mb-1">Upload Complete</h3><p class="text-gray-500 dark:text-gray-400 text-sm mb-4">${filename}</p><button class="text-primary-600 dark:text-primary-400 text-sm hover:underline" id="changeFile">Change File</button></div>`;feather.replace();document.getElementById('changeFile').addEventListener('click', resetUploader);}function resetUploader() {const dropzone = document.getElementById('dropzone');dropzone.innerHTML = `<i data-feather="upload-cloud" class="w-12 h-12 mx-auto text-gray-400 mb-3"></i><h3 class="text-lg font-medium mb-1">Upload Statement</h3><p class="text-gray-500 dark:text-gray-400 text-sm mb-4">Drag & drop your statement here (PDF, CSV, XLSX)</p><button class="bg-primary-600 hover:bg-primary-700 text-white px-6 py-2 rounded-lg text-sm font-medium transition">Select File</button>`;feather.replace();currentStep = 'upload';updateStepUI();}function enableNextStep(nextStep) {currentStep = nextStep;updateStepUI();}function updateStepUI() {// Update workflow navigation highlightsdocument.querySelectorAll('.workflow-step').forEach(step => {if (step.dataset.step === currentStep) {step.classList.add('bg-primary-100', 'dark:bg-primary-900', 'text-primary-600', 'dark:text-primary-400');step.classList.remove('bg-gray-200', 'dark:bg-gray-600', 'text-gray-500', 'dark:text-gray-300');} else {step.classList.remove('bg-primary-100', 'dark:bg-primary-900', 'text-primary-600', 'dark:text-primary-400');step.classList.add('bg-gray-200', 'dark:bg-gray-600', 'text-gray-500', 'dark:text-gray-300');}});// Show/hide panels based on current stepif (currentStep === 'settings') {document.getElementById('settingsPanel').classList.remove('hidden');document.getElementById('uploadPanel').classList.add('hidden');} else {document.getElementById('settingsPanel').classList.add('hidden');document.getElementById('uploadPanel').classList.remove('hidden');}}function showLoading(context, message) {const loaderId = `${context}Loader`;let loader = document.getElementById(loaderId);if (!loader) {loader = document.createElement('div');loader.id = loaderId;loader.className = 'fixed inset-0 bg-black bg-opacity-30 flex items-center justify-center z-50';loader.innerHTML = `<div class="bg-white dark:bg-gray-800 p-6 rounded-lg shadow-xl max-w-sm w-full text-center"><div class="animate-spin rounded-full h-12 w-12 border-b-2 border-primary-600 mx-auto mb-4"></div><p class="text-gray-800 dark:text-gray-200">${message}</p></div>`;document.body.appendChild(loader);}}function hideLoading(context) {const loaderId = `${context}Loader`;const loader = document.getElementById(loaderId);if (loader) {loader.remove();}}function showToast(message, type = 'info') {const toast = document.createElement('div');const types = {success: 'bg-green-100 border-green-400 text-green-700',error: 'bg-red-100 border-red-400 text-red-700',warning: 'bg-yellow-100 border-yellow-400 text-yellow-700',info: 'bg-blue-100 border-blue-400 text-blue-700'};toast.className = `border-l-4 ${types[type]} p-4 rounded shadow-lg mb-2 flex items-start justify-between animate-fade-in`;toast.innerHTML = `<div class="flex items-start"><i data-feather="${type === 'success' ? 'check-circle' : type === 'error' ? 'alert-circle' : 'info'}"class="w-5 h-5 mr-3 mt-0.5"></i><p>${message}</p></div><button class="ml-4 text-gray-500 hover:text-gray-700" onclick="this.parentElement.remove()"><i data-feather="x" class="w-4 h-4"></i></button>`;document.getElementById('toastContainer').appendChild(toast);feather.replace();setTimeout(() => {toast.classList.add('animate-fade-out');setTimeout(() => toast.remove(), 300);}, 5000);}// Initialize interactive panelsdocument.getElementById('togglePreview').addEventListener('click', function() {const content = document.getElementById('previewDataContent');const icon = this.querySelector('i');content.classList.toggle('hidden');icon.setAttribute('data-feather', content.classList.contains('hidden') ? 'chevron-down' : 'chevron-up');feather.replace();});document.getElementById('toggleResults').addEventListener('click', function() {const content = document.getElementById('resultsContent');const icon = this.querySelector('i');content.classList.toggle('hidden');icon.setAttribute('data-feather', content.classList.contains('hidden') ? 'chevron-down' : 'chevron-up');feather.replace();});// Real-time calculation updatesdocument.getElementById('maxBudget').addEventListener('input', updateCalculations);document.getElementById('longTermRate').addEventListener('input', function() {document.getElementById('longTermRateValue').textContent = this.value;updateCalculations();});document.getElementById('shortTermRate').addEventListener('input', function() {document.getElementById('shortTermRateValue').textContent = this.value;updateCalculations();});document.getElementById('dispositionMethod').addEventListener('change', updateCalculations);document.getElementById('raiseCash').addEventListener('input', updateCalculations);function updateCalculations() {// Simulate calculationsconst budget = parseFloat(document.getElementById('maxBudget').value) || 0;const longTermRate = parseFloat(document.getElementById('longTermRate').value) || 0;const shortTermRate = parseFloat(document.getElementById('shortTermRate').value) || 0;// Update UI with simulated datadocument.getElementById('shortTermEstimate').textContent = `${(Math.random() * 1000).toFixed(2)}`;document.getElementById('longTermEstimate').textContent = `${(Math.random() * 500).toFixed(2)}`;document.getElementById('taxBillEstimate').textContent = `-${(Math.random() * 300).toFixed(2)}`;const progress = Math.min(100, (Math.random() * 100));document.getElementById('savingsProgress').style.width = `${progress}%`;document.getElementById('savingsPercentage').textContent = `${progress.toFixed(0)}%`;}// Form validationdocument.getElementById('runHarvest').addEventListener('click', function() {const budget = document.getElementById('maxBudget').value;if (!budget || isNaN(budget) || parseFloat(budget) <= 0) {showToast('Please enter a valid tax budget amount', 'error');return;}showLoading('harvest', 'Calculating optimal trades...');setTimeout(() => {hideLoading('harvest');showToast('Harvest complete! Optimal trades generated.', 'success');// Simulate resultspopulateResultsTable();}, 3000);});function populateResultsTable() {const resultsBody = document.getElementById('resultsDataBody');resultsBody.innerHTML = '';// Sample dataconst sampleTrades = [{ action: 'Sell', symbol: 'AAPL', qty: 5, gainLoss: -125.34 },{ action: 'Sell', symbol: 'TSLA', qty: 2, gainLoss: -87.21 },{ action: 'Buy', symbol: 'SPY', qty: 3, gainLoss: 0 }];sampleTrades.forEach(trade => {const row = document.createElement('tr');row.className = 'hover:bg-gray-50 dark:hover:bg-gray-700';row.innerHTML = `<td class="px-4 py-2 whitespace-nowrap ${trade.action === 'Sell' ? 'text-red-500' : 'text-green-500'}">${trade.action}</td><td class="px-4 py-2 whitespace-nowrap">${trade.symbol}</td><td class="px-4 py-2 whitespace-nowrap">${trade.qty}</td><td class="px-4 py-2 whitespace-nowrap ${trade.gainLoss < 0 ? 'text-red-500' : 'text-green-500'}">${Math.abs(trade.gainLoss).toFixed(2)}</td>`;resultsBody.appendChild(row);});document.getElementById('tradeCount').textContent = `${sampleTrades.length} trades`;document.getElementById('resultsContent').classList.remove('hidden');document.getElementById('noResultsData').classList.add('hidden');}// Initialize with sample preview datadocument.addEventListener('DOMContentLoaded', function() {// Sample preview dataconst sampleData = [{ symbol: 'AAPL', qty: 10, marketValue: 1750.00, costBasis: 1500.00 },{ symbol: 'TSLA', qty: 5, marketValue: 1250.00, costBasis: 1500.00 },{ symbol: 'SPY', qty: 15, marketValue: 6000.00, costBasis: 5500.00 }];const previewBody = document.getElementById('previewDataBody');sampleData.forEach(item => {const row = document.createElement('tr');row.className = 'hover:bg-gray-50 dark:hover:bg-gray-700';row.innerHTML = `<td class="px-4 py-2 whitespace-nowrap">${item.symbol}</td><td class="px-4 py-2 whitespace-nowrap">${item.qty}</td><td class="px-4 py-2 whitespace-nowrap">${item.marketValue.toFixed(2)}</td><td class="px-4 py-2 whitespace-nowrap">${item.costBasis.toFixed(2)}</td><td class="px-4 py-2 whitespace-nowrap"><button class="text-primary-600 dark:text-primary-400 hover:underline text-sm">Edit</button></td>`;previewBody.appendChild(row);});document.getElementById('noPreviewData').classList.add('hidden');// Initialize workflow stepsdocument.querySelectorAll('.workflow-step').forEach(step => {step.addEventListener('click', function() {if (this.dataset.step === 'upload' || currentStep === 'settings') {enableNextStep(this.dataset.step);}});});});</script><style>@keyframes fadeIn {from { opacity: 0; transform: translateY(10px); }to { opacity: 1; transform: translateY(0); }}@keyframes fadeOut {from { opacity: 1; transform: translateY(0); }to { opacity: 0; transform: translateY(10px); }}.animate-fade-in {animation: fadeIn 0.3s ease-out forwards;}.animate-fade-out {animation: fadeOut 0.3s ease-out forwards;}/* Responsive adjustments */@media (max-width: 768px) {.bottom-action-bar {flex-direction: column;gap: 0.5rem;padding: 0.5rem;}.bottom-action-bar > div {width: 100%;}#mainCard {flex-direction: column;}#mainCard > div {width: 100%;}}</style></body></html>