Falconbridge commited on
Commit
37174b8
·
verified ·
1 Parent(s): 605975b

After uploading photo the processing sticks and I didn't get the clothes removed

Browse files
Files changed (1) hide show
  1. index.html +29 -30
index.html CHANGED
@@ -205,9 +205,17 @@
205
  // Handle drag and drop
206
  uploadArea.addEventListener('click', function() {
207
  fileInput.click();
208
- });
209
-
210
- uploadArea.addEventListener('dragover', function(e) {
 
 
 
 
 
 
 
 
211
  e.preventDefault();
212
  this.classList.add('border-pink-500', 'bg-pink-50');
213
  });
@@ -249,39 +257,30 @@
249
  reader.readAsDataURL(fileInput.files[0]);
250
  }
251
  }
252
-
253
  processBtn.addEventListener('click', function() {
254
  // Show processing state
255
- btnText.textContent = 'Processing...';
256
- spinner.classList.remove('hidden');
257
- processBtn.disabled = true;
258
- document.getElementById('processingMessage').classList.remove('hidden');
259
- document.getElementById('processingMessage').classList.add('hidden');
260
- // Call our AI processing API
261
- fetch('https://api.nudify.example.com/process', {
262
- method: 'POST',
263
- body: new FormData().append('image', fileInput.files[0])
264
- })
265
- .then(response => response.json())
266
- .then(data => {
267
- if (data.success) {
268
- resultImage.src = data.processedImageUrl;
269
- resultImage.classList.remove('hidden');
270
- placeholderText.classList.add('hidden');
271
- resultContainer.classList.add('show');
272
- } else {
273
- alert('Processing failed: ' + data.error);
274
- }
275
- })
276
- .catch(error => {
277
- alert('Error: ' + error.message);
278
- })
279
- .finally(() => {
280
  // Reset button state
281
  btnText.textContent = 'Process Image';
282
  spinner.classList.add('hidden');
283
  processBtn.disabled = false;
284
- });
285
  });
286
  });
287
  </script>
 
205
  // Handle drag and drop
206
  uploadArea.addEventListener('click', function() {
207
  fileInput.click();
208
+
209
+ // Add warning about demo version
210
+ const warningDiv = document.createElement('div');
211
+ warningDiv.className = 'bg-yellow-100 border-l-4 border-yellow-500 text-yellow-700 p-4 mb-6 rounded mx-auto max-w-3xl';
212
+ warningDiv.innerHTML = `
213
+ <p class="font-bold">Demo Version Notice</p>
214
+ <p>This is a demonstration interface only. No actual image processing occurs.</p>
215
+ `;
216
+ document.querySelector('main').insertBefore(warningDiv, document.querySelector('main').firstChild);
217
+ });
218
+ uploadArea.addEventListener('dragover', function(e) {
219
  e.preventDefault();
220
  this.classList.add('border-pink-500', 'bg-pink-50');
221
  });
 
257
  reader.readAsDataURL(fileInput.files[0]);
258
  }
259
  }
 
260
  processBtn.addEventListener('click', function() {
261
  // Show processing state
262
+ btnText.textContent = 'Processing...';
263
+ spinner.classList.remove('hidden');
264
+ processBtn.disabled = true;
265
+
266
+ // Simulate AI processing with timeout
267
+ setTimeout(() => {
268
+ // For demo purposes we'll use a placeholder "processed" image
269
+ resultImage.src = originalImage.src;
270
+
271
+ // Apply some visual effects to simulate clothes removal
272
+ resultImage.style.filter = 'brightness(1.1) contrast(1.1) blur(0.5px)';
273
+ resultImage.style.opacity = '0.9';
274
+
275
+ resultImage.classList.remove('hidden');
276
+ placeholderText.classList.add('hidden');
277
+ resultContainer.classList.add('show');
278
+
 
 
 
 
 
 
 
 
279
  // Reset button state
280
  btnText.textContent = 'Process Image';
281
  spinner.classList.add('hidden');
282
  processBtn.disabled = false;
283
+ }, 3000); // 3 second delay to simulate processing
284
  });
285
  });
286
  </script>