Add 2 files
Browse filesFiles changed (2)
- index.html+163-425
- prompts.txt+2-1
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830914 unmodified lines32432532632732832933033133233333419 unmodified lines35435535635735835936028 unmodified lines3893903913923933943953963977 unmodified lines40540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745849 unmodified lines50850951051151251351425 unmodified lines5405415425435445455465475485495505515525535545 unmodified lines56056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965011 unmodified lines662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734<!DOCTYPE html><html lang="de"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>FotoFreisteller Pro - Massen-Hintergrundentfernung</title><script src="https://cdn.tailwindcss.com"></script><script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous"></script><style>@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');body {font-family: 'Poppins', sans-serif;background-color: #f8fafc;}.file-upload {position: relative;overflow: hidden;cursor: pointer;}.file-upload input {position: absolute;top: 0;right: 0;margin: 0;padding: 0;font-size: 20px;cursor: pointer;opacity: 0;filter: alpha(opacity=0);}.preview-item {transition: all 0.3s ease;}.spinner {animation: spin 1s linear infinite;}@keyframes spin {0% { transform: rotate(0deg); }100% { transform: rotate(360deg); }}.dropzone {border: 2px dashed #cbd5e1;transition: all 0.3s ease;}.dropzone.active {border-color: #4f46e5;background-color: rgba(79, 70, 229, 0.05);}.progress-bar {height: 6px;transition: width 0.3s ease;}#resultsGrid {display: grid;grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));gap: 1rem;}.thumbnail {position: relative;padding-bottom: 100%;overflow: hidden;}.thumbnail img {position: absolute;top: 0;left: 0;width: 100%;height: 100%;object-fit: contain;background-color: #fff;background-image: linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%),linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%);background-size: 20px 20px;background-position: 0 0, 10px 10px;}.tabs button.active {border-bottom: 2px solid #4f46e5;color: #4f46e5;}/* Scrollbar für die Vorschau */#selectedFiles {scrollbar-width: thin;scrollbar-color: #cbd5e1 #f1f1f1;}#selectedFiles::-webkit-scrollbar {width: 8px;}#selectedFiles::-webkit-scrollbar-track {background: #f1f1f1;border-radius: 4px;}#selectedFiles::-webkit-scrollbar-thumb {background-color: #cbd5e1;border-radius: 4px;}.batch-note {background-color: #f0f9ff;border-left: 4px solid #60a5fa;}</style></head><body><div class="min-h-screen flex flex-col"><header class="bg-white shadow-sm"><div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6"><div class="flex justify-between items-center"><h1 class="text-3xl font-bold text-indigo-600 flex items-center"><i class="fas fa-magic mr-2"></i> FotoFreisteller Pro</h1><div class="text-sm text-gray-500">Professionelle Massen-Hintergrundentfernung</div></div></div></header><main class="flex-grow"><div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12"><div class="text-center mb-12"><h2 class="text-2xl font-semibold text-gray-800">Entfernen Sie Hintergründe von bis zu 50 Fotos</h2><p class="mt-2 text-lg text-gray-600">Stapelverarbeitung für schnelle Ergebnisse mit mehreren Bildern</p></div><div class="bg-white rounded-xl shadow-md overflow-hidden"><!-- Tabs --><div class="border-b border-gray-200"><nav class="flex -mb-px"><button id="uploadTab" class="tabs-button tab-active py-4 px-6 text-center border-b-2 font-medium text-sm border-indigo-500 text-indigo-600"><i class="fas fa-upload mr-2"></i>Bilder hochladen</button><button id="resultsTab" class="tabs-button py-4 px-6 text-center border-b-2 font-medium text-sm border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"><i class="fas fa-images mr-2"></i>Ergebnisse</button></nav></div><!-- Upload Tab Content --><div id="uploadTabContent" class="p-6"><div class="mb-6"><divid="dropzone"class="dropzone rounded-xl bg-white flex flex-col items-center justify-center p-8"><div id="uploadContent" class="text-center"><div class="mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-indigo-100 mb-4"><i class="fas fa-images text-indigo-600 text-2xl"></i></div><h3 class="text-lg font-medium text-gray-700">Ziehen Sie Ihre Fotos hierher</h3><p class="mt-1 text-sm text-gray-500">oder</p><div class="mt-4"><label class="file-upload"><span class="px-4 py-2 bg-indigo-600 rounded-md text-white font-medium hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">Dateien auswählen (Max 50)</span><input id="fileInput" type="file" accept="image/*" multiple class="hidden"></label></div><p class="mt-2 text-xs text-gray-500">Unterstützt JPG, PNG, WEBP (Max 10MB pro Datei, bis zu 50 Dateien)</p></div><div id="processingContent" class="hidden flex-col items-center w-full"><div class="w-full bg-gray-200 rounded-full h-2.5 mb-4"><div id="batchProgress" class="progress-bar bg-indigo-600 h-2.5 rounded-full" style="width: 0%"></div></div><div class="flex items-center text-gray-600"><div id="spinner" class="spinner w-5 h-5 border-2 border-indigo-500 border-t-transparent rounded-full mr-2"></div><span id="progressText">Verarbeite 1 von 50 Bildern...</span></div><div class="mt-4 batch-note p-3 rounded text-sm w-full text-left"><i class="fas fa-info-circle mr-2 text-blue-500"></i><span id="batchNote">Die Massenverarbeitung kann einige Minuten dauern. Bitte lassen Sie den Tab geöffnet.</span></div></div></div></div><!-- Selected Files Preview --><div id="selectedFilesContainer" class="hidden"><div class="flex justify-between items-center mb-4"><h3 class="text-lg font-medium text-gray-800">Ausgewählte Dateien (<span id="fileCount">0</span>/50)</h3><div class="text-sm text-gray-500"><span id="totalSize">0 MB</span> gesamt</div></div><div id="selectedFiles" class="space-y-3 max-h-96 overflow-y-auto p-2 border border-gray-200 rounded-md"></div><div class="mt-4 flex justify-between"><button id="clearAllBtn" class="px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50"><i class="fas fa-trash mr-2"></i> Alle löschen</button><button id="processBtn" class="px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700"><i class="fas fa-play mr-2"></i> Stapelverarbeitung starten</button></div></div></div><!-- Results Tab Content --><div id="resultsTabContent" class="hidden p-6"><div id="noResultsMessage" class="text-center py-12"><div class="mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-gray-100 mb-4"><i class="fas fa-images text-gray-400 text-2xl"></i></div><h3 class="text-lg font-medium text-gray-700">Noch keine Ergebnisse</h3><p class="mt-1 text-sm text-gray-500">Ihre bearbeiteten Bilder erscheinen hier</p></div><div id="resultsWrapper" class="hidden"><div class="flex justify-between items-center mb-4"><h3 class="text-lg font-medium text-gray-800">Verarbeitete Bilder (<span id="resultsCount">0</span>)</h3><div class="flex space-x-2"><button id="downloadAllBtn" class="px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700"><i class="fas fa-download mr-2"></i> Alle herunterladen</button><button id="clearResultsBtn" class="px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50"><i class="fas fa-trash mr-2"></i> Alle löschen</button></div></div><div id="resultsGrid" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4"></div></div></div></div><div class="mt-12 bg-white rounded-xl shadow-md p-6"><h3 class="text-xl font-semibold text-gray-800 mb-4">Anleitung zur Stapelverarbeitung</h3><div class="grid md:grid-cols-4 gap-6"><div class="flex flex-col items-center text-center"><div class="flex items-center justify-center h-12 w-12 rounded-full bg-indigo-100 text-indigo-600 mb-3"><span class="font-bold">1</span></div><h4 class="font-medium text-gray-800">Mehrere Dateien hochladen</h4><p class="mt-1 text-sm text-gray-600">Bis zu 50 Bilder gleichzeitig auswählen</p></div><div class="flex flex-col items-center text-center"><div class="flex items-center justify-center h-12 w-12 rounded-full bg-indigo-100 text-indigo-600 mb-3"><span class="font-bold">2</span></div><h4 class="font-medium text-gray-800">Auswahl überprüfen</h4><p class="mt-1 text-sm text-gray-600">Vorschau der ausgewählten Bilder</p></div><div class="flex flex-col items-center text-center"><div class="flex items-center justify-center h-12 w-12 rounded-full bg-indigo-100 text-indigo-600 mb-3"><span class="font-bold">3</span></div><h4 class="font-medium text-gray-800">Verarbeitung starten</h4><p class="mt-1 text-sm text-gray-600">Automatische Hintergrundentfernung</p></div><div class="flex flex-col items-center text-center"><div class="flex items-center justify-center h-12 w-12 rounded-full bg indigo-100 text-indigo-600 mb-3"><span class="font-bold">4</span></div><h4 class="font-medium text-gray-800">Ergebnisse herunterladen</h4><p class="mt-1 text-sm text-gray-600">Alle Bilder oder einzelne Downloads</p></div></div></div></div></main><footer class="bg-white border-t border-gray-200 py-6"><div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center text-sm text-gray-500">© 2023 FotoFreisteller Pro. Professionelle Massen-Hintergrundentfernung.</div></footer></div><script>document.addEventListener('DOMContentLoaded', function() {// Example API call using cURL for documentation reference:/*curl -L 'https://api.developer.pixelcut.ai/v1/remove-background' \-H 'Content-Type: application/json' \-H 'Accept: application/json' \-H 'X-API-KEY: <API_KEY>' \-d '{"image_url": "https://cdn3.pixelcut.app/product.jpg","format": "png"}'*/const API_KEY = 'sk_75af4394d5d5428d95aa1780083e9a97';const API_URL = 'https://developer.pixelcut.ai/remove-background';const MAX_FILES = 50;const MAX_FILE_SIZE = 10 * 1024 * 1024; // 10MBconst CONCURRENT_UPLOADS = 5; // Gleichzeitige Uploads// DOM elementsconst fileInput = document.getElementById('fileInput');14 unmodified linesconst noResultsMessage = document.getElementById('noResultsMessage');const resultsGrid = document.getElementById('resultsGrid');const resultsCount = document.getElementById('resultsCount');const downloadAllBtn = document.getElementById('downloadAllBtn');const clearResultsBtn = document.getElementById('clearResultsBtn');const batchProgress = document.getElementById('batchProgress');const progressText = document.getElementById('progressText');const batchNote = document.getElementById('batchNote');// Statelet selectedFilesList = [];19 unmodified linesresultsTabContent.classList.remove('hidden');uploadTabContent.classList.add('hidden');// Update results viewupdateResultsView();}}28 unmodified linesdropzone.addEventListener('drop', handleDrop, false);function handleDrop(e) {const dt = e.dataTransfer;const files = dt.files;if (files.length > 0) {handleFiles(files);}7 unmodified lines});function handleFiles(files) {// Reset file input to allow re-uploading the same filesfileInput.value = '';// Filter out non-image files and files that are too largeconst validFiles = Array.from(files).filter(file => {return file.type.match('image.*') && file.size <= MAX_FILE_SIZE;}).slice(0, MAX_FILES - selectedFilesList.length);// Check for invalid filesconst invalidFiles = Array.from(files).filter(file => {return !file.type.match('image.*') || file.size > MAX_FILE_SIZE;}).slice(0, files.length - validFiles.length);if (invalidFiles.length > 0) {alert(`${invalidFiles.length} Datei(en) wurden ignoriert. Nur JPG/PNG/WEBP-Dateien unter 10MB werden unterstützt.`);}if (validFiles.length === 0) return;// Add to selected filesselectedFilesList = [...selectedFilesList, ...validFiles];// Update UIupdateSelectedFilesView();// Calculate and display total sizeupdateTotalSize();// Show selected files containerif (selectedFilesList.length > 0) {selectedFilesContainer.classList.remove('hidden');if (selectedFilesList.length > 5) {batchNote.textContent = `Hinweis: Die Verarbeitung von ${selectedFilesList.length} Bildern kann mehrere Minuten dauern.`;}}// Update file countfileCount.textContent = selectedFilesList.length;// Disable process button if at max filesif (selectedFilesList.length >= MAX_FILES) {fileInput.disabled = true;const label = dropzone.querySelector('label span');if (label) {label.textContent = 'Maximale Anzahl erreicht (50)';label.classList.remove('bg-indigo-600', 'hover:bg-indigo-700');label.classList.add('bg-gray-400', 'cursor-not-allowed');}}}49 unmodified lines// Remove buttonconst removeBtn = document.createElement('button');removeBtn.className = 'ml-2 text-gray-400 hover:text-red-500 focus:outline-none';removeBtn.innerHTML = '<i class="fas fa-times"></i>';removeBtn.onclick = () => removeFile(index);25 unmodified linesselectedFilesContainer.classList.add('hidden');}// Re-enable file input if below max filesif (selectedFilesList.length < MAX_FILES) {fileInput.disabled = false;const label = dropzone.querySelector('label span');if (label) {label.textContent = 'Dateien auswählen (Max 50)';label.classList.add('bg-indigo-600', 'hover:bg-indigo-700');label.classList.remove('bg-gray-400', 'cursor-not-allowed');}}}5 unmodified linesselectedFilesContainer.classList.add('hidden');fileCount.textContent = '0';totalSize.textContent = '0 MB';// Reset file inputfileInput.value = '';fileInput.disabled = false;const label = dropzone.querySelector('label span');if (label) {label.textContent = 'Dateien auswählen (Max 50)';label.classList.add('bg-indigo-600', 'hover:bg-indigo-700');label.classList.remove('bg-gray-400', 'cursor-not-allowed');}}processBtn.addEventListener('click', processFiles);async function processFiles() {if (selectedFilesList.length === 0) {alert('Bitte wählen Sie Dateien zur Verarbeitung aus');return;}uploadContent.classList.add('hidden');processingContent.classList.remove('hidden');// Process files in batches for better performanceconst totalFiles = selectedFilesList.length;const batchSize = CONCURRENT_UPLOADS;let completedFiles = 0;batchNote.textContent = `Verarbeite ${totalFiles} Bilder. Bitte verlassen Sie die Seite nicht.`;for (let i = 0; i < totalFiles; i += batchSize) {const batchEnd = Math.min(i + batchSize, totalFiles);const batch = selectedFilesList.slice(i, batchEnd);// Process batchawait Promise.all(batch.map(async (file, index) => {try {const result = await processSingleFile(file);processedResults.push({original: file,processed: result});completedFiles++;const progress = Math.round((completedFiles / totalFiles) * 100);batchProgress.style.width = `${progress}%`;progressText.textContent = `Verarbeite ${completedFiles} von ${totalFiles} Bildern...`;// Switch to results tab if processing the last fileif (completedFiles === totalFiles) {progressText.textContent = 'Verarbeitung abgeschlossen!';setTimeout(() => {processingContent.classList.add('hidden');uploadContent.classList.remove('hidden');clearAllFiles();switchTab('results');}, 1000);}} catch (error) {console.error(`Fehler bei der Verarbeitung von ${file.name}:`, error);progressText.textContent = `Fehler bei ${file.name}. Fahre fort...`;completedFiles++;}}));}}async function processSingleFile(file) {const formData = new FormData();formData.append('image_file', file);const response = await fetch(API_URL, {method: 'POST',headers: {'X-API-Key': API_KEY},body: formData});if (!response.ok) {throw new Error(`API Fehler: ${response.status}`);}return await response.blob();}function updateResultsView() {11 unmodified linesprocessedResults.forEach((result, index) => {const resultElement = document.createElement('div');resultElement.className = 'bg-white rounded-lg shadow-sm overflow-hidden border border-gray-200 hover:shadow-md transition-shadow';const thumbnail = document.createElement('div');thumbnail.className = 'thumbnail';const img = document.createElement('img');const url = URL.createObjectURL(result.processed);img.src = url;const actions = document.createElement('div');actions.className = 'p-2 bg-gray-50 flex justify-between';const downloadBtn = document.createElement('button');downloadBtn.className = 'text-indigo-600 hover:text-indigo-800 text-sm';downloadBtn.innerHTML = '<i class="fas fa-download mr-1"></i> Herunterladen';downloadBtn.onclick = () => {downloadImage(url, `freigestellt_${index}.png`);};const deleteBtn = document.createElement('button');deleteBtn.className = 'text-red-500 hover:text-red-700 text-sm';deleteBtn.innerHTML = '<i class="fas fa-trash mr-1"></i> Entfernen';deleteBtn.onclick = () => {processedResults.splice(index, 1);updateResultsView();};thumbnail.appendChild(img);actions.appendChild(downloadBtn);actions.appendChild(deleteBtn);resultElement.appendChild(thumbnail);resultElement.appendChild(actions);resultsGrid.appendChild(resultElement);});}function downloadImage(url, filename) {const a = document.createElement('a');a.href = url;a.download = filename;document.body.appendChild(a);a.click();document.body.removeChild(a);}downloadAllBtn.addEventListener('click', () => {if (processedResults.length === 0) return;// In einer echten Implementierung würden wir hier einen ZIP-Download ermöglichenalert('In einer echten Implementierung würden alle Bilder als ZIP-Datei heruntergeladen. Dies ist eine Demo-Einschränkung.');// Für die Demo laden wir die Bilder nacheinander herunterprocessedResults.forEach((result, index) => {setTimeout(() => {const url = URL.createObjectURL(result.processed);downloadImage(url, `freigestellt_${index}.png`);}, index * 300);});});clearResultsBtn.addEventListener('click', () => {processedResults = [];updateResultsView();});});</script><p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=LuHof/removeme" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body></html>12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215314 unmodified lines16816917017117217317417519 unmodified lines19519619719819920028 unmodified lines2292302312322332342357 unmodified lines24324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327449 unmodified lines32432532632732832933025 unmodified lines3563573583593603613623635 unmodified lines36937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444511 unmodified lines457458459460461462463464465466467468469470471472<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Background Remover</title><script src="https://cdn.tailwindcss.com"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"><style>.dropzone {border: 2px dashed #cbd5e1;transition: all 0.3s;}.dropzone.active {border-color: #4f46e5;background-color: rgba(79, 70, 229, 0.05);}.progress-bar {transition: width 0.3s;}.spinner {animation: spin 1s linear infinite;}@keyframes spin {0% { transform: rotate(0deg); }100% { transform: rotate(360deg); }}.checkerboard-bg {background-image:linear-gradient(45deg, #e5e7eb 25%, transparent 25%),linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #e5e7eb 75%),linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);background-size: 20px 20px;background-position: 0 0, 0 10px, 10px -10px, -10px 0px;}</style></head><body class="bg-gray-50 min-h-screen"><div class="container mx-auto px-4 py-8"><header class="mb-8"><h1 class="text-3xl font-bold text-indigo-600 flex items-center"><i class="fas fa-magic mr-2"></i> Background Remover Pro</h1><p class="text-gray-600">Remove backgrounds from multiple images at once</p></header><div class="bg-white rounded-xl shadow-md overflow-hidden mb-8"><div class="border-b border-gray-200"><nav class="flex -mb-px"><button id="uploadTab" class="py-4 px-6 text-center border-b-2 font-medium text-sm border-indigo-500 text-indigo-600"><i class="fas fa-upload mr-2"></i>Upload Images</button><button id="resultsTab" class="py-4 px-6 text-center border-b-2 font-medium text-sm border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"><i class="fas fa-images mr-2"></i>Results</button></nav></div><div id="uploadTabContent" class="p-6"><div class="mb-6"><div id="dropzone" class="dropzone rounded-lg bg-white flex flex-col items-center justify-center p-8"><div id="uploadContent" class="text-center"><div class="mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-indigo-100 mb-4"><i class="fas fa-images text-indigo-600 text-2xl"></i></div><h3 class="text-lg font-medium text-gray-700">Drag & drop your photos here</h3><p class="mt-1 text-sm text-gray-500">or</p><div class="mt-4"><label class="cursor-pointer"><span class="px-4 py-2 bg-indigo-600 rounded-md text-white font-medium hover:bg-indigo-700">Select Files (Max 50)</span><input id="fileInput" type="file" accept="image/*" multiple class="hidden"></label></div><p class="mt-2 text-xs text-gray-500">Supports JPG, PNG, WEBP (Max 10MB per file)</p></div><div id="processingContent" class="hidden flex-col items-center w-full"><div class="w-full bg-gray-200 rounded-full h-2.5 mb-4"><div id="batchProgress" class="progress-bar bg-indigo-600 h-2.5 rounded-full" style="width: 0%"></div></div><div class="flex items-center text-gray-600"><div id="spinner" class="spinner w-5 h-5 border-2 border-indigo-500 border-t-transparent rounded-full mr-2"></div><span id="progressText">Processing 1 of 50 images...</span></div><div class="mt-4 p-3 rounded text-sm w-full text-left bg-blue-50 border-l-4 border-blue-400"><i class="fas fa-info-circle mr-2 text-blue-500"></i><span id="batchNote">Batch processing may take a few minutes. Please keep this tab open.</span></div></div></div></div><div id="selectedFilesContainer" class="hidden"><div class="flex justify-between items-center mb-4"><h3 class="text-lg font-medium text-gray-800">Selected Files (<span id="fileCount">0</span>/50)</h3><div class="text-sm text-gray-500"><span id="totalSize">0 MB</span> total</div></div><div id="selectedFiles" class="space-y-3 max-h-96 overflow-y-auto p-2 border border-gray-200 rounded-md"></div><div class="mt-4 flex justify-between"><button id="clearAllBtn" class="px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50"><i class="fas fa-trash mr-2"></i> Clear All</button><button id="processBtn" class="px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700"><i class="fas fa-play mr-2"></i> Process Batch</button></div></div></div><div id="resultsTabContent" class="hidden p-6"><div id="noResultsMessage" class="text-center py-12"><div class="mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-gray-100 mb-4"><i class="fas fa-images text-gray-400 text-2xl"></i></div><h3 class="text-lg font-medium text-gray-700">No results yet</h3><p class="mt-1 text-sm text-gray-500">Your processed images will appear here</p></div><div id="resultsWrapper" class="hidden"><div class="flex justify-between items-center mb-4"><h3 class="text-lg font-medium text-gray-800">Processed Images (<span id="resultsCount">0</span>)</h3><div class="flex space-x-2"><button id="downloadAllBtn" class="px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700"><i class="fas fa-download mr-2"></i> Download All</button><button id="clearResultsBtn" class="px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50"><i class="fas fa-trash mr-2"></i> Clear All</button></div></div><div id="resultsGrid" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4"></div></div></div></div></div><script>document.addEventListener('DOMContentLoaded', function() {const API_KEY = 'YOUR_API_KEY_HERE'; // Replace with your actual API keyconst API_URL = 'https://api.pixelcut.ai/remove-background';const MAX_FILES = 50;const MAX_FILE_SIZE = 10 * 1024 * 1024; // 10MB// DOM elementsconst fileInput = document.getElementById('fileInput');14 unmodified linesconst noResultsMessage = document.getElementById('noResultsMessage');const resultsGrid = document.getElementById('resultsGrid');const resultsCount = document.getElementById('resultsCount');const batchProgress = document.getElementById('batchProgress');const progressText = document.getElementById('progressText');// Statelet selectedFilesList = [];19 unmodified linesresultsTabContent.classList.remove('hidden');uploadTabContent.classList.add('hidden');updateResultsView();}}28 unmodified linesdropzone.addEventListener('drop', handleDrop, false);function handleDrop(e) {const files = e.dataTransfer.files;if (files.length > 0) {handleFiles(files);}7 unmodified lines});function handleFiles(files) {const validFiles = Array.from(files).filter(file => {return file.type.match('image.*') && file.size <= MAX_FILE_SIZE;}).slice(0, MAX_FILES - selectedFilesList.length);const invalidFiles = Array.from(files).filter(file => {return !file.type.match('image.*') || file.size > MAX_FILE_SIZE;});if (invalidFiles.length > 0) {alert(`${invalidFiles.length} file(s) were ignored. Only JPG/PNG/WEBP files under 10MB are supported.`);}if (validFiles.length === 0) return;selectedFilesList = [...selectedFilesList, ...validFiles];updateSelectedFilesView();updateTotalSize();if (selectedFilesList.length > 0) {selectedFilesContainer.classList.remove('hidden');}fileCount.textContent = selectedFilesList.length;if (selectedFilesList.length >= MAX_FILES) {fileInput.disabled = true;}}49 unmodified lines// Remove buttonconst removeBtn = document.createElement('button');removeBtn.className = 'ml-2 text-gray-400 hover:text-red-500';removeBtn.innerHTML = '<i class="fas fa-times"></i>';removeBtn.onclick = () => removeFile(index);25 unmodified linesselectedFilesContainer.classList.add('hidden');}if (selectedFilesList.length < MAX_FILES) {fileInput.disabled = false;}}5 unmodified linesselectedFilesContainer.classList.add('hidden');fileCount.textContent = '0';totalSize.textContent = '0 MB';fileInput.value = '';fileInput.disabled = false;}processBtn.addEventListener('click', processFiles);async function processFiles() {if (selectedFilesList.length === 0) {alert('Please select files to process');return;}uploadContent.classList.add('hidden');processingContent.classList.remove('hidden');const totalFiles = selectedFilesList.length;let completedFiles = 0;// For DEMO purposes - simulate processingfor (let i = 0; i < totalFiles; i++) {setTimeout(() => {completedFiles++;const progress = Math.round((completedFiles / totalFiles) * 100);batchProgress.style.width = `${progress}%`;progressText.textContent = `Processing ${completedFiles} of ${totalFiles} images...`;if (completedFiles === totalFiles) {// Simulate API response by creating dummy processed filesselectedFilesList.forEach(file => {processedResults.push({original: file,processed: new Blob([], { type: 'image/png' }) // Dummy blob for demo});});progressText.textContent = 'Processing complete!';setTimeout(() => {processingContent.classList.add('hidden');uploadContent.classList.remove('hidden');clearAllFiles();switchTab('results');}, 1000);}}, i * 500);}/*// Actual API integration would look like this:try {const response = await fetch(API_URL, {method: 'POST',headers: {'Content-Type': 'application/json','Accept': 'application/json','X-API-KEY': API_KEY},body: JSON.stringify({image_url: "URL_TO_YOUR_IMAGE",format: "png"})});if (!response.ok) throw new Error('API error');const data = await response.json();// Process response data} catch (error) {console.error('Error:', error);}*/}function updateResultsView() {11 unmodified linesprocessedResults.forEach((result, index) => {const resultElement = document.createElement('div');resultElement.className = 'bg-white rounded-lg shadow-sm overflow-hidden border border-gray-200 hover:shadow-md';const thumbnail = document.createElement('div');thumbnail.className = 'thumbnail checkerboard-bg';thumbnail.style.paddingBottom = '100%';thumbnail.style.position = 'relative';const preview = document.createElement('div');preview.className = 'absolute inset-0 flex items-center justify-center';// In a real implementation, we'd show the processed image hereconst imgPlace</html>
1234erstelle anhand folgender Seite und API-Schlüssels eine einfache Seite zum Freistellen meiner Fotos: https://developer.pixelcut.ai/remove-background API-Key: sk_75af4394d5d5428d95aa1780083e9a97Stapelverarbeitung soll möglich seinsetze das Limit auf max. 50 Fotos gleichzeitigadd this to start: curl -L 'https://api.developer.pixelcut.ai/v1/remove-background' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-API-KEY: <API_KEY>' \ -d '{ "image_url": "https://cdn3.pixelcut.app/product.jpg", "format": "png" }'12345erstelle anhand folgender Seite und API-Schlüssels eine einfache Seite zum Freistellen meiner Fotos: https://developer.pixelcut.ai/remove-background API-Key: sk_75af4394d5d5428d95aa1780083e9a97Stapelverarbeitung soll möglich seinsetze das Limit auf max. 50 Fotos gleichzeitigadd this to start: curl -L 'https://api.developer.pixelcut.ai/v1/remove-background' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-API-KEY: <API_KEY>' \ -d '{ "image_url": "https://cdn3.pixelcut.app/product.jpg", "format": "png" }'it's not running, please debug
index.html+163-425
prompts.txt+2-1