Spaces:
Running
Running
Download index.html from WDFluho/wdf-converter: direct link, hf CLI and curl.
- Browser
- Download file 23 kB
-
https://huggingface.co/spaces/WDFluho/wdf-converter/resolve/main/index.html
- Command line
-
hf download hf://spaces/WDFluho/wdf-converter/index.html
-
curl -L -o index.html https://huggingface.co/spaces/WDFluho/wdf-converter/resolve/main/index.html
23 kB
| <html lang="de"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>WDF-Converter | Negativ zu Positiv Konvertierung</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> | |
| @import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;700&display=swap'); | |
| body { | |
| font-family: 'Roboto Mono', monospace; | |
| background-color: #1a1a1a; | |
| color: #e0e0e0; | |
| } | |
| .film-grain { | |
| position: fixed; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="1" numOctaves="1" stitchTiles="stitch"/><feColorMatrix type="saturate" values="0"/></filter><rect width="500" height="500" filter="url(%23noise)" opacity="0.05"/></svg>'); | |
| pointer-events: none; | |
| z-index: 50; | |
| } | |
| .camera-preview { | |
| background-color: #000; | |
| background-image: | |
| linear-gradient(45deg, #222 25%, transparent 25%), | |
| linear-gradient(-45deg, #222 25%, transparent 25%), | |
| linear-gradient(45deg, transparent 75%, #222 75%), | |
| linear-gradient(-45deg, transparent 75%, #222 75%); | |
| background-size: 20px 20px; | |
| background-position: 0 0, 0 10px, 10px -10px, -10px 0px; | |
| position: relative; | |
| } | |
| .film-selector { | |
| scrollbar-width: thin; | |
| scrollbar-color: #555 #222; | |
| } | |
| .film-selector::-webkit-scrollbar { | |
| height: 8px; | |
| } | |
| .film-selector::-webkit-scrollbar-track { | |
| background: #222; | |
| } | |
| .film-selector::-webkit-scrollbar-thumb { | |
| background-color: #555; | |
| border-radius: 4px; | |
| } | |
| .range-slider::-webkit-slider-thumb { | |
| -webkit-appearance: none; | |
| width: 18px; | |
| height: 18px; | |
| background: #f59e0b; | |
| border-radius: 50%; | |
| cursor: pointer; | |
| } | |
| .range-slider::-moz-range-thumb { | |
| width: 18px; | |
| height: 18px; | |
| background: #f59e0b; | |
| border-radius: 50%; | |
| cursor: pointer; | |
| } | |
| @keyframes scanline { | |
| 0% { top: -100%; } | |
| 100% { top: 100%; } | |
| } | |
| .scanline { | |
| position: absolute; | |
| width: 100%; | |
| height: 2px; | |
| background: rgba(255, 255, 255, 0.2); | |
| animation: scanline 5s linear infinite; | |
| z-index: 10; | |
| } | |
| .vintage-border { | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| border: 15px solid transparent; | |
| border-image: linear-gradient(135deg, rgba(210,180,140,0.5) 0%, rgba(210,180,140,0) 40%, rgba(210,180,140,0.5) 60%, rgba(210,180,140,0) 100%); | |
| border-image-slice: 1; | |
| pointer-events: none; | |
| z-index: 20; | |
| } | |
| </style> | |
| </head> | |
| <body class="relative overflow-hidden"> | |
| <div class="film-grain"></div> | |
| <div class="vintage-border"></div> | |
| <div class="container mx-auto px-4 py-8"> | |
| <!-- Header --> | |
| <header class="flex justify-between items-center mb-8"> | |
| <div class="flex items-center"> | |
| <i class="fas fa-camera-retro text-3xl text-amber-500 mr-3"></i> | |
| <h1 class="text-3xl font-bold">WDF-<span class="text-amber-500">Converter</span></h1> | |
| </div> | |
| <div class="hidden md:flex space-x-4"> | |
| <button class="px-4 py-2 bg-gray-800 hover:bg-gray-700 rounded-lg flex items-center"> | |
| <i class="fas fa-book mr-2"></i> Dokumentation | |
| </button> | |
| <button class="px-4 py-2 bg-gray-800 hover:bg-gray-700 rounded-lg flex items-center"> | |
| <i class="fas fa-cog mr-2"></i> Einstellungen | |
| </button> | |
| </div> | |
| </header> | |
| <div class="flex flex-col lg:flex-row gap-8"> | |
| <!-- Left Panel - Camera Preview and Controls --> | |
| <div class="w-full lg:w-1/2"> | |
| <div class="camera-preview rounded-lg overflow-hidden relative aspect-[4/3] mb-4"> | |
| <div class="scanline"></div> | |
| <video id="camera-feed" class="w-full h-full object-cover" autoplay></video> | |
| <canvas id="photo-canvas" class="absolute top-0 left-0 w-full h-full hidden"></canvas> | |
| <div id="loading-indicator" class="absolute inset-0 bg-black bg-opacity-70 flex items-center justify-center hidden"> | |
| <div class="animate-spin rounded-full h-16 w-16 border-t-2 border-b-2 border-amber-500"></div> | |
| </div> | |
| </div> | |
| <div class="bg-gray-900 rounded-lg p-6"> | |
| <h2 class="text-xl font-bold mb-4 flex items-center"> | |
| <i class="fas fa-camera mr-2"></i> Kamerasteuerung | |
| </h2> | |
| <div class="grid grid-cols-2 gap-4 mb-4"> | |
| <button id="capture-btn" class="bg-amber-600 hover:bg-amber-700 text-white py-3 px-4 rounded-lg flex items-center justify-center"> | |
| <i class="fas fa-camera mr-2"></i> Aufnahme | |
| </button> | |
| <button id="toggle-camera-btn" class="bg-gray-700 hover:bg-gray-600 text-white py-3 px-4 rounded-lg flex items-center justify-center"> | |
| <i class="fas fa-sync-alt mr-2"></i> Kamera wechseln | |
| </button> | |
| </div> | |
| <div class="mb-4"> | |
| <label class="block text-sm font-medium mb-1">Blitzmodus</label> | |
| <div class="flex space-x-2"> | |
| <button class="flex-1 py-2 bg-gray-700 hover:bg-gray-600 rounded">Aus</button> | |
| <button class="flex-1 py-2 bg-gray-700 hover:bg-gray-600 rounded">Ein</button> | |
| <button class="flex-1 py-2 bg-gray-700 hover:bg-gray-600 rounded">Auto</button> | |
| </div> | |
| </div> | |
| <div class="mb-4"> | |
| <label class="block text-sm font-medium mb-1">Delay (s)</label> | |
| <div class="flex space-x-2"> | |
| <button class="py-2 px-3 bg-gray-700 hover:bg-gray-600 rounded">0</button> | |
| <button class="py-2 px-3 bg-gray-700 hover:bg-gray-600 rounded">3</button> | |
| <button class="py-2 px-3 bg-gray-700 hover:bg-gray-600 rounded">5</button> | |
| <button class="py-2 px-3 bg-gray-700 hover:bg-gray-600 rounded">10</button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Right Panel - Image Processing --> | |
| <div class="w-full lg:w-1/2"> | |
| <div class="bg-gray-900 rounded-lg p-6 mb-6"> | |
| <h2 class="text-xl font-bold mb-4 flex items-center"> | |
| <i class="fas fa-film mr-2"></i> Filmprofil | |
| </h2> | |
| <div class="film-selector flex overflow-x-auto pb-4 mb-4 space-x-3"> | |
| <div class="film-card flex-shrink-0 w-32 h-32 bg-gray-800 rounded-lg flex flex-col items-center justify-center border-2 border-gray-700 hover:border-amber-500 cursor-pointer"> | |
| <div class="h-16 w-16 bg-gradient-to-br from-gray-300 to-gray-500 rounded-full mb-2"></div> | |
| <span class="text-xs font-bold">Ilford HP5+</span> | |
| <span class="text-xs text-gray-400">BW 400</span> | |
| </div> | |
| <div class="film-card flex-shrink-0 w-32 h-32 bg-gray-800 rounded-lg flex flex-col items-center justify-center border-2 border-gray-700 hover:border-amber-500 cursor-pointer"> | |
| <div class="h-16 w-16 bg-gradient-to-br from-blue-900 via-purple-700 to-red-600 rounded-full mb-2"></div> | |
| <span class="text-xs font-bold">Kodak Portra</span> | |
| <span class="text-xs text-gray-400">Color 400</span> | |
| </div> | |
| <div class="film-card flex-shrink-0 w-32 h-32 bg-gray-800 rounded-lg flex flex-col items-center justify-center border-2 border-gray-700 hover:border-amber-500 cursor-pointer"> | |
| <div class="h-16 w-16 bg-gradient-to-br from-green-800 to-green-500 rounded-full mb-2"></div> | |
| <span class="text-xs font-bold">Fuji Pro 400H</span> | |
| <span class="text-xs text-gray-400">Color 400</span> | |
| </div> | |
| <div class="film-card flex-shrink-0 w-32 h-32 bg-gray-800 rounded-lg flex flex-col items-center justify-center border-2 border-gray-700 hover:border-amber-500 cursor-pointer"> | |
| <div class="h-16 w-16 bg-gradient-to-br from-gray-200 to-gray-400 rounded-full mb-2"></div> | |
| <span class="text-xs font-bold">Kodak T-Max</span> | |
| <span class="text-xs text-gray-400">BW 100</span> | |
| </div> | |
| <div class="film-card flex-shrink-0 w-32 h-32 bg-gray-800 rounded-lg flex flex-col items-center justify-center border-2 border-gray-700 hover:border-amber-500 cursor-pointer"> | |
| <div class="h-16 w-16 bg-gradient-to-br from-red-900 to-yellow-600 rounded-full mb-2"></div> | |
| <span class="text-xs font-bold">Kodak Ektachrome</span> | |
| <span class="text-xs text-gray-400">Slide 100</span> | |
| </div> | |
| </div> | |
| <div class="mb-4"> | |
| <label class="block text-sm font-medium mb-1">Benutzerdefiniertes Profil</label> | |
| <button class="w-full bg-gray-800 hover:bg-gray-700 py-2 px-4 rounded-lg flex items-center justify-center"> | |
| <i class="fas fa-plus-circle mr-2"></i> Neues Profil erstellen | |
| </button> | |
| </div> | |
| </div> | |
| <div class="bg-gray-900 rounded-lg p-6 mb-6"> | |
| <h2 class="text-xl font-bold mb-4 flex items-center"> | |
| <i class="fas fa-sliders-h mr-2"></i> Entwicklungseinstellungen | |
| </h2> | |
| <div class="space-y-4"> | |
| <div> | |
| <label class="block text-sm font-medium mb-1">Helligkeit</label> | |
| <input type="range" min="0" max="200" value="100" class="w-full range-slider bg-gray-700 rounded-lg appearance-none h-2"> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium mb-1">Kontrast</label> | |
| <input type="range" min="0" max="200" value="100" class="w-full range-slider bg-gray-700 rounded-lg appearance-none h-2"> | |
| </div> | |
| <div class="grid grid-cols-2 gap-4"> | |
| <div> | |
| <label class="block text-sm font-medium mb-1">Schatten</label> | |
| <input type="range" min="0" max="100" value="50" class="w-full range-slider bg-gray-700 rounded-lg appearance-none h-2"> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium mb-1">Lichter</label> | |
| <input type="range" min="0" max="100" value="50" class="w-full range-slider bg-gray-700 rounded-lg appearance-none h-2"> | |
| </div> | |
| </div> | |
| <div class="grid grid-cols-2 gap-4"> | |
| <div> | |
| <label class="block text-sm font-medium mb-1">Belichtung</label> | |
| <input type="range" min="-2" max="2" step="0.1" value="0" class="w-full range-slider bg-gray-700 rounded-lg appearance-none h-2"> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium mb-1">Gamma</label> | |
| <input type="range" min="0.5" max="2.5" step="0.1" value="1" class="w-full range-slider bg-gray-700 rounded-lg appearance-none h-2"> | |
| </div> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium mb-1">Farbumkehr</label> | |
| <div class="flex space-x-2"> | |
| <button class="flex-1 py-2 bg-amber-600 hover:bg-amber-700 rounded">Automatisch</button> | |
| <button class="flex-1 py-2 bg-gray-700 hover:bg-gray-600 rounded">Manuell</button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-gray-900 rounded-lg p-6"> | |
| <h2 class="text-xl font-bold mb-4 flex items-center"> | |
| <i class="fas fa-archive mr-2"></i> Ergebnisse | |
| </h2> | |
| <div class="grid grid-cols-3 gap-2 mb-4"> | |
| <div class="aspect-square bg-gray-800 rounded-lg"></div> | |
| <div class="aspect-square bg-gray-800 rounded-lg"></div> | |
| <div class="aspect-square bg-gray-800 rounded-lg"></div> | |
| <div class="aspect-square bg-gray-800 rounded-lg"></div> | |
| <div class="aspect-square bg-gray-800 rounded-lg"></div> | |
| <div class="aspect-square bg-gray-800 rounded-lg"></div> | |
| </div> | |
| <div class="flex space-x-3"> | |
| <button class="flex-1 bg-gray-700 hover:bg-gray-600 py-2 px-4 rounded-lg"> | |
| <i class="fas fa-folder mr-1"></i> Öffnen | |
| </button> | |
| <button class="flex-1 bg-gray-700 hover:bg-gray-600 py-2 px-4 rounded-lg"> | |
| <i class="fas fa-save mr-1"></i> Speichern | |
| </button> | |
| <button class="flex-1 bg-amber-600 hover:bg-amber-700 py-2 px-4 rounded-lg"> | |
| <i class="fas fa-print mr-1"></i> Drucken | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <script> | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Camera elements | |
| const cameraFeed = document.getElementById('camera-feed'); | |
| const photoCanvas = document.getElementById('photo-canvas'); | |
| const captureBtn = document.getElementById('capture-btn'); | |
| const toggleCameraBtn = document.getElementById('toggle-camera-btn'); | |
| const loadingIndicator = document.getElementById('loading-indicator'); | |
| // Image processing elements | |
| const filmCards = document.querySelectorAll('.film-card'); | |
| // Camera state | |
| let currentStream = null; | |
| let currentCamera = 'environment'; // or 'user' for front camera | |
| let isProcessing = false; | |
| // Initialize the camera | |
| function initCamera(cameraType) { | |
| if (currentStream) { | |
| currentStream.getTracks().forEach(track => track.stop()); | |
| } | |
| const constraints = { | |
| video: { | |
| facingMode: cameraType, | |
| width: { ideal: 1280 }, | |
| height: { ideal: 720 } | |
| }, | |
| audio: false | |
| }; | |
| navigator.mediaDevices.getUserMedia(constraints) | |
| .then(function(stream) { | |
| currentStream = stream; | |
| cameraFeed.srcObject = stream; | |
| // Set canvas dimensions to match video feed | |
| cameraFeed.onloadedmetadata = function() { | |
| const videoWidth = cameraFeed.videoWidth; | |
| const videoHeight = cameraFeed.videoHeight; | |
| // Maintain aspect ratio but limit to container | |
| const containerRatio = 4/3; | |
| const videoRatio = videoWidth / videoHeight; | |
| if (containerRatio > videoRatio) { | |
| photoCanvas.width = videoHeight * containerRatio; | |
| photoCanvas.height = videoHeight; | |
| } else { | |
| photoCanvas.width = videoWidth; | |
| photoCanvas.height = videoWidth / containerRatio; | |
| } | |
| }; | |
| }) | |
| .catch(function(err) { | |
| console.error("Error accessing camera:", err); | |
| // Fallback to placeholder image | |
| cameraFeed.src = 'placeholder.jpg'; | |
| }); | |
| } | |
| // Capture photo | |
| captureBtn.addEventListener('click', function() { | |
| if (isProcessing) return; | |
| isProcessing = true; | |
| loadingIndicator.classList.remove('hidden'); | |
| // Hide video and show canvas | |
| cameraFeed.classList.add('hidden'); | |
| photoCanvas.classList.remove('hidden'); | |
| // Draw the current frame to canvas | |
| const ctx = photoCanvas.getContext('2d'); | |
| ctx.drawImage(cameraFeed, 0, 0, photoCanvas.width, photoCanvas.height); | |
| // Simulate processing delay | |
| setTimeout(function() { | |
| // Here we would normally process the image | |
| // For now, we'll just simulate the conversion | |
| // Show a flash effect | |
| photoCanvas.style.transition = 'filter 0.2s'; | |
| photoCanvas.style.filter = 'brightness(2)'; | |
| setTimeout(function() { | |
| photoCanvas.style.filter = 'none'; | |
| // Process the image (this is where actual conversion would happen) | |
| processNegativeToPositive(); | |
| // Show the processed result | |
| loadingIndicator.classList.add('hidden'); | |
| isProcessing = false; | |
| // Optionally: add the photo to the results grid | |
| }, 200); | |
| }, 1000); // Simulate 1 second processing time | |
| }); | |
| // Toggle camera direction | |
| toggleCameraBtn.addEventListener('click', function() { | |
| currentCamera = currentCamera === 'user' ? 'environment' : 'user'; | |
| initCamera(currentCamera); | |
| }); | |
| // Film profile selection | |
| filmCards.forEach(card => { | |
| card.addEventListener('click', function() { | |
| // Remove active class from all cards | |
| filmCards.forEach(c => { | |
| c.classList.remove('border-amber-500'); | |
| c.classList.add('border-gray-700'); | |
| }); | |
| // Add active class to clicked card | |
| this.classList.add('border-amber-500'); | |
| this.classList.remove('border-gray-700'); | |
| // Here you would apply the selected film profile | |
| }); | |
| }); | |
| // Initial setup | |
| initCamera(currentCamera); | |
| // Simulate negative to positive conversion | |
| function processNegativeToPositive() { | |
| const ctx = photoCanvas.getContext('2d'); | |
| const imageData = ctx.getImageData(0, 0, photoCanvas.width, photoCanvas.height); | |
| const data = imageData.data; | |
| // Simple inversion for demonstration | |
| for (let i = 0; i < data.length; i += 4) { | |
| // Invert RGB channels for negative effect | |
| // Note: Real conversion would be more complex and film-specific | |
| data[i] = 255 - data[i]; // R | |
| data[i + 1] = 255 - data[i + 1]; // G | |
| data[i + 2] = 255 - data[i + 2]; // B | |
| // Alpha channel remains unchanged | |
| } | |
| ctx.putImageData(imageData, 0, 0); | |
| } | |
| }); | |
| </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=WDFluho/wdf-converter" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |