diff --git a/src/components/tools/DynamicToolWorkspace.tsx b/src/components/tools/DynamicToolWorkspace.tsx index 458a3aa..c8e1faa 100644 --- a/src/components/tools/DynamicToolWorkspace.tsx +++ b/src/components/tools/DynamicToolWorkspace.tsx @@ -89,6 +89,7 @@ export function DynamicToolWorkspace({ // Inference Execution State const [status, setStatus] = useState<'idle' | 'processing' | 'success' | 'error' | 'limit'>('idle'); const [resultUrl, setResultUrl] = useState(null); + const [comparisonBeforeUrl, setComparisonBeforeUrl] = useState(null); const [errorMessage, setErrorMessage] = useState(''); const [remainingTries, setRemainingTries] = useState(tool.tryIt?.limits?.perDay || 5); @@ -210,8 +211,11 @@ export function DynamicToolWorkspace({ } if (fileToSend) { + const compUrl = URL.createObjectURL(fileToSend); + setComparisonBeforeUrl(compUrl); formData.append(imageParamName, fileToSend, 'photo.jpg'); } else if (primaryPreview) { + setComparisonBeforeUrl(primaryPreview); const res = await fetch(primaryPreview); const blob = await res.blob(); formData.append(imageParamName, blob, 'sample.jpg'); @@ -309,6 +313,7 @@ export function DynamicToolWorkspace({ setSecondaryFile(null); setSecondaryPreview(null); setResultUrl(null); + setComparisonBeforeUrl(null); setStatus('idle'); setErrorMessage(''); if (fileInputRef.current) fileInputRef.current.value = ''; @@ -407,12 +412,13 @@ export function DynamicToolWorkspace({ -
+
diff --git a/src/components/tools/ProcessingOverlay.tsx b/src/components/tools/ProcessingOverlay.tsx index 1bfb49c..3e54fb9 100644 --- a/src/components/tools/ProcessingOverlay.tsx +++ b/src/components/tools/ProcessingOverlay.tsx @@ -1,7 +1,7 @@ 'use client'; import React, { useState, useEffect } from 'react'; -import { Sparkles, Cpu, Layers, Zap, ShieldCheck } from 'lucide-react'; +import { Sparkles } from 'lucide-react'; interface ProcessingOverlayProps { toolName?: string; @@ -10,45 +10,34 @@ interface ProcessingOverlayProps { } export function ProcessingOverlay({ - toolName = 'Neural Vision Model', + toolName = 'Photo', stageMessages, - aspectRatio = 'aspect-[4/3] sm:aspect-[16/10]', }: ProcessingOverlayProps) { const defaultStages = [ - 'Initializing volatile GPU tensor core...', - 'Analyzing photographic topology & lighting coordinates...', - 'Synthesizing generative neural model...', - 'Reconstructing sub-pixel micro-details & HD polish...', - 'Finalizing crystal-clear preview...', + 'Analyzing lighting & textures...', + 'Applying neural enhancements...', + 'Refining high-definition details...', + 'Finalizing studio quality export...', ]; const stages = stageMessages && stageMessages.length > 0 ? stageMessages : defaultStages; const [currentStageIdx, setCurrentStageIdx] = useState(0); - const [progress, setProgress] = useState(12); - const [elapsedSec, setElapsedSec] = useState(0); + const [progress, setProgress] = useState(15); - // Smooth elapsed timer - useEffect(() => { - const timer = setInterval(() => { - setElapsedSec((prev) => +(prev + 0.1).toFixed(1)); - }, 100); - return () => clearInterval(timer); - }, []); - - // Cycle through inference stages & smooth progress curve + // Cycle through natural photo editing stages & smooth progress curve useEffect(() => { const stageInterval = setInterval(() => { setCurrentStageIdx((prev) => (prev < stages.length - 1 ? prev + 1 : prev)); - }, 900); + }, 1100); const progressInterval = setInterval(() => { setProgress((prev) => { - if (prev >= 94) return 94; // Wait for server resolution - const delta = Math.max(1, Math.floor((95 - prev) * 0.15)); + if (prev >= 94) return 94; // Wait for backend resolution + const delta = Math.max(1, Math.floor((95 - prev) * 0.16)); return Math.min(94, prev + delta); }); - }, 150); + }, 140); return () => { clearInterval(stageInterval); @@ -57,81 +46,51 @@ export function ProcessingOverlay({ }, [stages.length]); return ( -
- {/* 1. Moving Laser Scanning Beam */} -
-
-
- - {/* 2. Cybernetic Vision Grid Overlay */} -