Spaces:
Running

flextight-control1 / index.html
WDFluho's picture
Add 2 files
1e59324 verified
Raw History Blame Contribute Delete
62.4 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>FlexiscanPro - Professional Scanner Control</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"> <script> tailwind.config = { theme: { extend: { colors: { primary: '#005293', primarylight: '#e6f0f8', primarydark: '#003a6d', firewire: '#FF4500', thunderbolt: '#0071C5', usb: '#00a651', network: '#8e44ad' } } } } </script> <style> @keyframes scannerActive { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } } .scanner-active { animation: scannerActive 1.5s infinite; } .preview-container { background-image: linear-gradient(45deg, #eee 25%, transparent 25%), linear-gradient(-45deg, #eee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eee 75%), linear-gradient(-45deg, transparent 75%, #eee 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0px; position: relative; } input[type="range"] { -webkit-appearance: none; width: 100%; height: 8px; border-radius: 4px; background: #e5e7eb; outline: none; } input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #005293; cursor: pointer; transition: transform 0.1s; } input[type="range"]::-webkit-slider-thumb:active { transform: scale(1.2); } .tooltip { display: none; position: absolute; z-index: 10; background-color: black; color: white; font-size: 0.75rem; padding: 0.25rem 0.5rem; border-radius: 0.25rem; transform: translateX(-50%); left: 50%; bottom: 100%; margin-bottom: 0.5rem; white-space: nowrap; } .tooltip-container:hover .tooltip { display: block; } .film-option { transition: all 0.2s; } .film-option:hover { background-color: #f0f0f0; } .expert-border { border: 2px dashed #4a5568; } .expert-only { display: none; } .expert-mode .expert-only { display: block; } .expert-setting { background-color: #f8fafc; border-left: 3px solid #4a5568; transition: background-color 0.2s; } .expert-setting:hover { background-color: #edf2f7; } /* Interface color indicators */ .interface-indicator { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 5px; } .interface-thunderbolt { background-color: #0071C5; } .interface-firewire { background-color: #FF4500; } .interface-usb { background-color: #00a651; } .interface-network { background-color: #8e44ad; } </style> </head> <body class="bg-gray-100"> <div class="container mx-auto px-4 py-6 max-w-7xl" id="appContainer"> <!-- Header --> <header class="flex justify-between items-center mb-8"> <div class="flex items-center"> <h1 class="text-2xl font-bold text-primary">FlexiscanPro</h1> <span id="liveIndicator" class="ml-2 text-xs bg-primary text-white px-2 py-1 rounded">LIVE MODE</span> </div> <div class="flex items-center space-x-4"> <div id="connectionStatus" class="flex items-center"> <div class="relative group"> <span id="connectionIndicator" class="h-3 w-3 rounded-full bg-gray-500 mr-2"></span> <span id="connectionText" class="text-sm">Searching devices...</span> <div class="absolute z-10 hidden group-hover:block bg-white p-2 rounded shadow-lg text-xs w-64"> <span id="connectionTooltip">Scanning for available devices</span> </div> </div> </div> <div class="flex space-x-2"> <button id="refreshDevicesBtn" class="text-primary hover:text-primary/80 tooltip-container"> <i class="fas fa-sync-alt text-xl"></i> <span class="tooltip">Rescan devices</span> </button> <button id="connectionMethodBtn" class="text-primary hover:text-primary/80 tooltip-container"> <i class="fas fa-plug text-xl"></i> <span class="tooltip">Connection method</span> </button> <button id="infoBtn" class="text-primary hover:text-primary/80 tooltip-container"> <i class="fas fa-info-circle text-xl"></i> <span class="tooltip">Information</span> </button> </div> </div> </header> <!-- Connection Method Modal --> <div id="connectionMethodModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50"> <div class="bg-white rounded-lg p-6 max-w-lg w-full"> <h3 class="text-xl font-bold text-primary mb-4">Connection Settings</h3> <div class="mb-4"> <h4 class="font-medium mb-2">Default Interface</h4> <select id="connectionPriority" class="w-full p-2 border rounded focus:ring-2 focus:ring-primary/50 focus:border-primary"> <option value="any">Automatic detection (recommended)</option> <option value="thunderbolt">Thunderbolt (if available)</option> <option value="firewire">Firewire (if available)</option> <option value="usb">USB (if available)</option> <option value="network">Network (if available)</option> </select> </div> <div class="bg-yellow-50 p-3 rounded border border-yellow-200 mb-4"> <h4 class="font-medium text-yellow-800 mb-1"><i class="fas fa-exclamation-triangle mr-1"></i> Firewire/Thunderbolt Requirements</h4> <ul class="text-xs text-yellow-700 list-disc pl-5"> <li>Firewire: 1394 drivers must be installed</li> <li>Thunderbolt: System must support Thunderbolt devices</li> <li>Third-party software like IIDC driver may be required</li> </ul> </div> <div class="flex justify-between"> <button id="saveConnectionPrefBtn" class="px-4 py-2 bg-primary text-white rounded hover:bg-primary/90"> Save Settings </button> <button id="closeConnectionModalBtn" class="px-4 py-2 bg-gray-200 text-gray-700 rounded hover:bg-gray-300"> Cancel </button> </div> </div> </div> <!-- Main Content --> <div class="grid grid-cols-1 lg:grid-cols-3 gap-6"> <!-- Scanner Control Panel --> <div id="scannerPanel" class="scanner-panel lg:col-span-1 bg-white rounded-lg shadow p-6 expert-border"> <h2 class="text-lg font-semibold text-gray-800 mb-4">Scanner Control</h2> <div class="space-y-4"> <div> <label for="scannerSelect" class="block text-sm font-medium text-gray-700 mb-1">Available Scanners</label> <select id="scannerSelect" class="w-full p-2 border rounded focus:ring-2 focus:ring-primary/50 focus:border-primary"> <option value="">Select scanner...</option> </select> </div> <button id="connectBtn" class="w-full bg-primary text-white py-2 px-4 rounded hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed"> Connect </button> <div id="scannerDetails" class="hidden mt-4 border-t pt-4 space-y-2 text-sm"> <div class="flex justify-between"> <span class="text-gray-600">Model:</span> <span id="scannerModel" class="font-medium">-</span> </div> <div class="flex justify-between"> <span class="text-gray-600">Vendor:</span> <span id="scannerVendor" class="font-medium">-</span> </div> <div class="flex justify-between"> <span class="text-gray-600">Type:</span> <span id="scannerType" class="font-medium">-</span> </div> <div class="flex justify-between"> <span class="text-gray-600">Max Resolution:</span> <span id="scannerResolution" class="font-medium">-</span> </div> <div class="flex justify-between"> <span class="text-gray-600">Dynamic Range:</span> <span id="scannerDynamicRange" class="font-medium">-</span> </div> <div class="flex justify-between"> <span class="text-gray-600">Interface:</span> <span id="scannerInterface" class="font-medium">-</span> </div> </div> <!-- Operation mode section --> <div class="mt-4 border-t pt-4"> <h3 class="text-sm font-medium text-gray-700 mb-2">Operation Mode</h3> <div class="grid grid-cols-2 gap-2"> <button id="standardModeBtn" class="text-sm py-1 px-3 bg-gray-200 text-gray-700 rounded hover:bg-gray-300 transition"> Standard </button> <button id="expertModeBtn" class="text-sm py-1 px-3 bg-primary text-white rounded hover:bg-primary/90 transition"> Expert </button> </div> <p id="modeDescription" class="text-xs text-gray-500 mt-1">Expert mode with full control over all settings</p> </div> <!-- Scan settings section --> <div id="scanSettings" class="mt-4 border-t pt-4 space-y-2"> <h3 class="text-sm font-medium text-gray-700 mb-2">Scan Parameters</h3> <!-- Transparency mode --> <div> <label for="transparencyMode" class="block text-xs font-medium text-gray-600 mb-1">Transparency Mode</label> <select id="transparencyMode" class="w-full p-1 text-sm border rounded focus:ring-1 focus:ring-primary/50 focus:border-primary"> <option value="auto">Automatic</option> <option value="film">Film</option> <option value="slide">Slide</option> <option value="negative">Negative</option> </select> </div> <!-- Film simulation --> <div> <label for="filmSimulation" class="block text-xs font-medium text-gray-600 mb-1">Film Simulation</label> <select id="filmSimulation" class="w-full p-1 text-sm border rounded focus:ring-1 focus:ring-primary/50 focus:border-primary"> <option value="none">None</option> <option value="velvia" class="film-option">Fuji Velvia 50 (saturated colors)</option> <option value="provia" class="film-option">Fuji Provia 100F (neutral)</option> <option value="astia" class="film-option">Fuji Astia 100F (soft skin tones)</option> <option value="ektar" class="film-option">Kodak Ektar 100 (vivid colors)</option> <option value="portra160" class="film-option">Kodak Portra 160 (portrait)</option> <option value="portra400" class="film-option">Kodak Portra 400 (universal)</option> <option value="portra800" class="film-option">Kodak Portra 800 (low light)</option> <option value="tri-x" class="film-option">Kodak Tri-X 400 (B&W, grainy)</option> <option value="tmax400" class="film-option">Kodak T-Max 400 (B&W, fine grain)</option> <option value="hp5" class="film-option">Ilford HP5 Plus 400 (B&W, classic)</option> </select> </div> <!-- Expert settings --> <div id="expertSettings" class="expert-only space-y-2 mt-3 pt-3 border-t border-dashed border-gray-200"> <h4 class="text-xs font-medium text-gray-700 mb-1">Expert Settings</h4> <!-- Resolution --> <div class="expert-setting p-2 rounded"> <label for="resolutionSelect" class="block text-xs font-medium text-gray-600 mb-1">Scan Resolution (dpi)</label> <select id="resolutionSelect" class="w-full p-1 text-sm border rounded focus:ring-1 focus:ring-primary/50 focus:border-primary"> <option value="800">800 dpi (Preview)</option> <option value="1600">1600 dpi (Standard)</option> <option value="3200" selected>3200 dpi (High Quality)</option> <option value="4800">4800 dpi (Premium)</option> <option value="6400">6400 dpi (Maximum Resolution)</option> </select> </div> <!-- Output size --> <div class="expert-setting p-2 rounded"> <label for="outputSize" class="block text-xs font-medium text-gray-600 mb-1"> Output Size <span id="outputSizeLabel" class="text-xs text-gray-400">(Original)</span> </label> <div class="flex items-center space-x-2"> <select id="outputSizeMode" class="w-1/2 p-1 text-sm border rounded focus:ring-1 focus:ring-primary/50 focus:border-primary"> <option value="original">Original</option> <option value="percentage">Percentage</option> <option value="fixed-width">Fixed Width</option> <option value="fixed-height">Fixed Height</option> </select> <input id="outputSizeValue" type="number" min="1" max="5000" value="100" class="w-1/2 p-1 text-sm border rounded focus:ring-1 focus:ring-primary/50 focus:border-primary" disabled> <select id="outputSizeUnit" class="w-1/4 p-1 text-sm border rounded focus:ring-1 focus:ring-primary/50 focus:border-primary hidden"> <option value="percent">%</option> <option value="pixels">px</option> <option value="cm">cm</option> <option value="inches">inch</option> </select> </div> </div> <!-- Color space --> <div class="expert-setting p-2 rounded"> <label for="colorspaceSelect" class="block text-xs font-medium text-gray-600 mb-1">Color Space</label> <select id="colorspaceSelect" class="w-full p-1 text-sm border rounded focus:ring-1 focus:ring-primary/50 focus:border-primary"> <option value="srgb">sRGB (Standard)</option> <option value="adobe-rgb">Adobe RGB (1998)</option> <option value="prophoto">ProPhoto RGB</option> <option value="eci-rgb-v2">ECI-RGB v2</option> <option value="grayscale">16-Bit Grayscale</option> </select> </div> <!-- Multipass Scanning --> <div class="expert-setting p-2 rounded"> <label class="block text-xs font-medium text-gray-600 mb-1">Multipass Scanning</label> <div class="flex items-center"> <input type="checkbox" id="multipassCheck" class="mr-2 rounded border-gray-300 text-primary focus:ring-primary"> <label for="multipassCheck" class="text-xs">Multiple scans for noise reduction</label> </div> <div id="multipassControls" class="mt-1 hidden ml-6"> <div class="flex items-center space-x-2"> <label for="multipassCount" class="text-xs text-gray-600">Passes:</label> <select id="multipassCount" class="p-1 text-xs border rounded focus:ring-1 focus:ring-primary/50 focus:border-primary"> <option value="2">2x</option> <option value="4">4x</option> <option value="8">8x</option> <option value="16">16x</option> </select> </div> </div> </div> <!-- Advanced ROI settings --> <div class="expert-setting p-2 rounded"> <label class="block text-xs font-medium text-gray-600 mb-1">Scan Area (ROI)</label> <div class="grid grid-cols-2 gap-2"> <div> <label for="roiX" class="block text-2xs text-gray-500 mb-1">X Position</label> <input type="number" id="roiX" min="0" max="100" value="0" class="w-full p-1 text-sm border rounded"> </div> <div> <label for="roiY" class="block text-2xs text-gray-500 mb-1">Y Position</label> <input type="number" id="roiY" min="0" max="100" value="0" class="w-full p-1 text-sm border rounded"> </div> <div> <label for="roiWidth" class="block text-2xs text-gray-500 mb-1">Width</label> <input type="number" id="roiWidth" min="1" max="100" value="100" class="w-full p-1 text-sm border rounded"> </div> <div> <label for="roiHeight" class="block text-2xs text-gray-500 mb-1">Height</label> <input type="number" id="roiHeight" min="1" max="100" value="100" class="w-full p-1 text-sm border rounded"> </div> </div> </div> <!-- Dark current compensation --> <div class="expert-setting p-2 rounded"> <label for="darkCurrentComp" class="block text-xs font-medium text-gray-600 mb-1">Dark Current Compensation</label> <select id="darkCurrentComp" class="w-full p-1 text-sm border rounded focus:ring-1 focus:ring-primary/50 focus:border-primary"> <option value="auto">Automatic</option> <option value="low">Low</option> <option value="medium">Medium</option> <option value="high">High</option> <option value="none">None</option> </select> </div> </div> <div class="mt-4 flex space-x-2"> <button id="previewBtn" class="w-1/2 bg-gray-200 text-gray-800 py-2 px-4 rounded hover:bg-gray-300 disabled:opacity-50 disabled:cursor-not-allowed"> <i class="fas fa-eye mr-1"></i> Preview </button> <button id="scanBtn" class="w-1/2 bg-primary text-white py-2 px-4 rounded hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed"> <i class="fas fa-sscan mr-1"></i> Scan </button> </div> </div> <div class="relative mt-2 h-4"> <div id="scannerLight" class="absolute left-0 top-0 h-4 w-4 rounded-full bg-red-600 opacity-0"></div> </div> <!-- Progress bar --> <div id="progressContainer" class="hidden mt-2"> <div class="w-full bg-gray-200 rounded-full h-2.5"> <div id="progressBar" class="bg-primary h-2.5 rounded-full" style="width: 0%"></div> </div> <div id="progressPercent" class="text-right text-xs mt-1 text-gray-600">0%</div> </div> <div id="statusMessage" class="text-sm text-gray-600 mt-2 italic">Searching for available scanners...</div> </div> </div> <!-- Image Preview --> <div class="lg:col-span-2 bg-white rounded-lg shadow overflow-hidden"> <div class="p-4 border-b"> <h2 class="text-lg font-semibold text-gray-800">Preview & Results</h2> </div> <div id="previewContainer" class="preview-container h-96 flex items-center justify-center"> <div id="placeholderText" class="text-center p-6 text-gray-500"> <i class="fas fa-image text-4xl mb-2 opacity-50"></i> <p class="text-sm">No image available.<br>Click "Preview" or "Scan" to start.</p> </div> <img id="previewImage" src="" alt="Scan Result" class="hidden max-w-full max-h-full object-contain"> <!-- ROI Rectangle for Expert Mode --> <div id="roiRectangle" class="absolute border-2 border-yellow-400 pointer-events-none hidden" style="background-color: rgba(255, 255, 0, 0.2);"></div> </div> <!-- Advanced image settings --> <div class="p-4 border-t"> <h3 class="text-md font-medium text-gray-800 mb-3">Image Settings</h3> <div class="grid grid-cols-1 md:grid-cols-2 gap-4"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Brightness</label> <input type="range" min="0" max="200" value="100" class="slider" id="brightnessSlider"> <div class="flex justify-between text-xs text-gray-500 mt-1"> <span>-</span> <span id="brightnessValue">100</span> <span>+</span> </div> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Contrast</label> <input type="range" min="0" max="200" value="100" class="slider" id="contrastSlider"> <div class="flex justify-between text-xs text-gray-500 mt-1"> <span>-</span> <span id="contrastValue">100</span> <span>+</span> </div> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Sharpness</label> <input type="range" min="0" max="100" value="50" class="slider" id="sharpnessSlider"> <div class="flex justify-between text-xs text-gray-500 mt-1"> <span>0</span> <span id="sharpnessValue">50</span> <span>100</span> </div> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Color Balance</label> <input type="range" min="-20" max="20" value="0" class="slider" id="colorBalanceSlider"> <div class="flex justify-between text-xs text-gray-500 mt-1"> <span>Cooler</span> <span id="colorBalanceValue">0</span> <span>Warmer</span> </div> </div> <!-- Saturation slider --> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Saturation</label> <input type="range" min="-100" max="100" value="0" class="slider" id="saturationSlider"> <div class="flex justify-between text-xs text-gray-500 mt-1"> <span>-100%</span> <span id="saturationValue">0</span> <span>+100%</span> </div> </div> <!-- Gradation correction --> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Gradation Correction</label> <input type="range" min="0" max="100" value="0" class="slider" id="gradationSlider"> <div class="flex justify-between text-xs text-gray-500 mt-1"> <span>Soft</span> <span id="gradationValue">0</span> <span>Hard</span> </div> </div> <!-- Expert image settings --> <div class="expert-only"> <label class="block text-sm font-medium text-gray-700 mb-1">Density Matching</label> <input type="range" min="0" max="100" value="50" class="slider" id="densitySlider"> <div class="flex justify-between text-xs text-gray-500 mt-1"> <span>Flat</span> <span id="densityValue">50</span> <span>Contrasty</span> </div> </div> <div class="expert-only"> <label class="block text-sm font-medium text-gray-700 mb-1">Shadow Correction</label> <input type="range" min="0" max="100" value="0" class="slider" id="shadowSlider"> <div class="flex justify-between text-xs text-gray-500 mt-1"> <span>0%</span> <span id="shadowValue">0</span> <span>100%</span> </div> </div> </div> <!-- Histogram display with advanced features --> <div class="mt-4 bg-gray-50 p-2 rounded border border-gray-200"> <div class="flex justify-between items-center mb-1"> <div class="flex items-center space-x-2"> <span class="text-xs font-medium text-gray-700">Histogram</span> <select id="histogramChannel" class="expert-only text-xs border rounded p-1" title="Histogram Channel"> <option value="rgb">RGB</option> <option value="red">Red</option> <option value="green">Green</option> <option value="blue">Blue</option> </select> </div> <span class="text-xs text-gray-500" id="histogramInfo">RGB Distribution</span> </div> <div class="h-16 w-full bg-gray-200 rounded" id="histogramContainer"> <!-- Here the histogram would be rendered in a real app --> <div class="h-full flex items-end"> <div class="h-1/4 w-full bg-red-500 opacity-30"></div> <div class="h-1/2 w-full bg-green-500 opacity-30 ml-1"></div> <div class="h-3/4 w-full bg-blue-500 opacity-30 ml-1"></div> </div> </div> <div class="expert-only flex justify-between mt-1"> <span class="text-2xs text-gray-500">0</span> <span class="text-2xs text-gray-500">64</span> <span class="text-2xs text-gray-500">128</span> <span class="text-2xs text-gray-500">192</span> <span class="text-2xs text-gray-500">255</span> </div> </div> <div class="flex justify-between mt-4"> <button id="saveImageBtn" class="px-4 py-2 bg-gray-200 text-gray-800 rounded hover:bg-gray-300 disabled:opacity-50 disabled:cursor-not-allowed"> <i class="fas fa-save mr-1"></i> Save </button> <button id="resetSettingsBtn" class="px-4 py-2 bg-gray-200 text-gray-800 rounded hover:bg-gray-300"> <i class="fas fa-undo mr-1"></i> Reset </button> <button id="hardwareStatusBtn" class="px-4 py-2 bg-green-200 text-green-800 rounded hover:bg-green-300"> <i class="fas fa-plug mr-1"></i> <span id="hardwareStatusText">Live Mode</span> </button> </div> </div> </div> <!-- Scan Information --> <div class="lg:col-span-3 bg-white rounded-lg shadow p-6"> <h2 class="text-lg font-semibold text-gray-800 mb-2">Scanner Hub</h2> <div id="scanInfo" class="text-sm text-gray-600"> <p class="mb-2">Searching for compatible devices...</p> <p id="connectionInfo" class="hidden text-xs bg-primarylight p-2 rounded border border-primary/30"> <i class="fas fa-info-circle text-primary mr-1"></i> <span id="connectionTypeInfo"></span> </p> </div> <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mt-4"> <div class="bg-gray-50 p-3 rounded border border-gray-200"> <h3 class="text-sm font-medium text-gray-700 mb-1 flex items-center"> <i class="fas fa-bolt text-thunderbolt mr-1"></i> Thunderbolt Help </h3> <ul class="text-xs text-gray-600 space-y-1"> <li class="flex items-start"> <i class="fas fa-check-circle text-green-500 mr-1 mt-0.5"></i> <span>Install latest Thunderbolt drivers</span> </li> <li class="flex items-start"> <i class="fas fa-check-circle text-green-500 mr-1 mt-0.5"></i> <span>System must support Thunderbolt devices</span> </li> <li class="flex items-start"> <i class="fas fa-check-circle text-green-500 mr-1 mt-0.5"></i> <span>For best performance connect directly</span> </li> </ul> </div> <div class="bg-gray-50 p-3 rounded border border-gray-200"> <h3 class="text-sm font-medium text-gray-700 mb-1 flex items-center"> <i class="fas fa-fire-alt text-firewire mr-1"></i> Firewire Help </h3> <ul class="text-xs text-gray-600 space-y-1"> <li class="flex items-start"> <i class="fas fa-check-circle text-green-500 mr-1 mt-0.5"></i> <span>1394 drivers must be installed</span> </li> <li class="flex items-start"> <i class="fas fa-check-circle text-green-500 mr-1 mt-0.5"></i> <span>Older Macs may need Legacy Drivers</span> </li> <li class="flex items-start"> <i class="fas fa-check-circle text-green-500 mr-1 mt-0.5"></i> <span>Chain no more than 4 devices</span> </li> </ul> </div> <div class="bg-gray-50 p-3 rounded border border-gray-200"> <h3 class="text-sm font-medium text-gray-700 mb-1 flex items-center"> <i class="fas fa-usb text-usb mr-1"></i> USB Help </h3> <ul class="text-xs text-gray-600 space-y-1"> <li class="flex items-start"> <i class="fas fa-check-circle text-green-500 mr-1 mt=0.5"></i> <span>Install vendor-specific USB drivers</span> </li> <li class="flex items-start"> <i class="fas fa-check-circle text-green-500 mr-1 mt=0.5"></i> <span>Use USB 3.0+ for high resolution</span> </li> <li class="flex items-start"> <i class="fas fa-check-circle text-green-500 mr-1 mt=0.5"></i> <span>Avoid USB hubs for stability</span> </li> </ul> </div> </div> </div> </div> </div> <script> // Scanner detection implementation for Live Mode // DOM elements const scannerSelect = document.getElementById('scannerSelect'); const connectBtn = document.getElementById('connectBtn'); const previewBtn = document.getElementById('previewBtn'); const scanBtn = document.getElementById('scanBtn'); const scannerDetails = document.getElementById('scannerDetails'); const previewImage = document.getElementById('previewImage'); const placeholderText = document.getElementById('placeholderText'); const connectionIndicator = document.getElementById('connectionIndicator'); const connectionText = document.getElementById('connectionText'); const connectionTooltip = document.getElementById('connectionTooltip'); const refreshDevicesBtn = document.getElementById('refreshDevicesBtn'); const liveIndicator = document.getElementById('liveIndicator'); const hardwareStatusBtn = document.getElementById('hardwareStatusBtn'); const hardwareStatusText = document.getElementById('hardwareStatusText'); const connectionMethodBtn = document.getElementById('connectionMethodBtn'); const connectionMethodModal = document.getElementById('connectionMethodModal'); const closeConnectionModalBtn = document.getElementById('closeConnectionModalBtn'); const saveConnectionPrefBtn = document.getElementById('saveConnectionPrefBtn'); const connectionPriority = document.getElementById('connectionPriority'); const standardModeBtn = document.getElementById('standardModeBtn'); const expertModeBtn = document.getElementById('expertModeBtn'); const scannerPanel = document.getElementById('scannerPanel'); const scannerLight = document.getElementById('scannerLight'); const progressContainer = document.getElementById('progressContainer'); const progressBar = document.getElementById('progressBar'); const progressPercent = document.getElementById('progressPercent'); const saveImageBtn = document.getElementById('saveImageBtn'); const resetSettingsBtn = document.getElementById('resetSettingsBtn'); const statusMessage = document.getElementById('statusMessage'); const multipassCheck = document.getElementById('multipassCheck'); const multipassControls = document.getElementById('multipassControls'); const connectionInfo = document.getElementById('connectionInfo'); const connectionTypeInfo = document.getElementById('connectionTypeInfo'); const scannerModel = document.getElementById('scannerModel'); const scannerVendor = document.getElementById('scannerVendor'); const scannerType = document.getElementById('scannerType'); const scannerResolution = document.getElementById('scannerResolution'); const scannerDynamicRange = document.getElementById('scannerDynamicRange'); const scannerInterface = document.getElementById('scannerInterface'); // State variables let isConnected = false; let isExpertMode = false; let currentScanner = null; let connectionMethod = 'auto'; let scanningProgress = 0; let timer = null; // DOM Content Loaded document.addEventListener('DOMContentLoaded', function() { initializeApp(); }); function initializeApp() { // Event listeners connectBtn.addEventListener('click', toggleScannerConnection); previewBtn.addEventListener('click', startPreview); scanBtn.addEventListener('click', startScan); refreshDevicesBtn.addEventListener('click', refreshScanners); hardwareStatusBtn.addEventListener('click', showHardwareInfo); connectionMethodBtn.addEventListener('click', showConnectionMethodModal); closeConnectionModalBtn.addEventListener('click', hideConnectionMethodModal); saveConnectionPrefBtn.addEventListener('click', saveConnectionPreferences); standardModeBtn.addEventListener('click', setStandardMode); expertModeBtn.addEventListener('click', setExpertMode); saveImageBtn.addEventListener('click', saveImage); resetSettingsBtn.addEventListener('click', resetSettings); multipassCheck.addEventListener('change', toggleMultipassControls); connectionPriority.addEventListener('change', updateConnectionPriority); // Sliders with immediate feedback document.getElementById('brightnessSlider').addEventListener('input', updateSliderValue); document.getElementById('contrastSlider').addEventListener('input', updateSliderValue); document.getElementById('sharpnessSlider').addEventListener('input', updateSliderValue); document.getElementById('colorBalanceSlider').addEventListener('input', updateSliderValue); document.getElementById('saturationSlider').addEventListener('input', updateSliderValue); document.getElementById('gradationSlider').addEventListener('input', updateSliderValue); document.getElementById('densitySlider').addEventListener('input', updateSliderValue); document.getElementById('shadowSlider').addEventListener('input', updateSliderValue); // Initialize the app updateUI(); detectScanners(); } function updateUI() { // Update connection status indicators if (isConnected) { connectBtn.textContent = 'Disconnect'; connectBtn.classList.remove('bg-primary'); connectBtn.classList.add('bg-red-500'); previewBtn.disabled = false; scanBtn.disabled = false; connectionIndicator.classList.remove('bg-gray-500'); connectionIndicator.classList.add('bg-green-500'); connectionText.textContent = 'Connected'; connectionTooltip.textContent = 'Scanner is ready for operation'; scannerLight.classList.add('scanner-active'); } else { connectBtn.textContent = 'Connect'; connectBtn.classList.add('bg-primary'); connectBtn.classList.remove('bg-red-500'); previewBtn.disabled = true; scanBtn.disabled = true; connectionIndicator.classList.remove('bg-green-500'); connectionText.textContent = 'Disconnected'; connectionTooltip.textContent = 'No scanner connected'; scannerLight.classList.remove('scanner-active'); scannerDetails.classList.add('hidden'); } // Update expert mode if (isExpertMode) { expertModeBtn.classList.add('bg-primarydark'); document.getElementById('appContainer').classList.add('expert-mode'); } else { expertModeBtn.classList.remove('bg-primarydark'); document.getElementById('appContainer').classList.remove('expert-mode'); } } function detectScanners() { statusMessage.textContent = 'Searching for available scanners...'; // Clear existing options while (scannerSelect.options.length > 1) { scannerSelect.remove(1); } // Attempt to detect real scanners detectRealScanners().then(scanners => { if (scanners.length > 0) { let preferredScannerIndex = -1; // Add detected scanners to dropdown scanners.forEach((scanner, index) => { const option = document.createElement('option'); option.value = scanner.id; // Add interface indicator let interfaceClass = ''; if (scanner.interface === 'Thunderbolt') interfaceClass = 'interface-thunderbolt'; if (scanner.interface === 'Firewire') interfaceClass = 'interface-firewire'; if (scanner.interface === 'USB') interfaceClass = 'interface-usb'; if (scanner.interface === 'Network') interfaceClass = 'interface-network'; option.innerHTML = `<span class="${interfaceClass} interface-indicator"></span>${scanner.name}`; scannerSelect.appendChild(option); // Check if this matches our connection priority if (connectionPriority.value.toLowerCase() === scanner.interface.toLowerCase() || (connectionPriority.value === 'any' && preferredScannerIndex === -1)) { preferredScannerIndex = index; } }); // Select preferred scanner if found if (preferredScannerIndex >= 0) { scannerSelect.selectedIndex = preferredScannerIndex + 1; } statusMessage.textContent = `${scanners.length} scanner(s) found`; connectionIndicator.classList.remove('bg-gray-500'); connectionIndicator.classList.add('bg-yellow-500'); connectionText.textContent = 'Devices available'; connectionTooltip.textContent = 'Click connect to establish scanner connection'; } else { statusMessage.textContent = 'No compatible scanners detected'; connectionIndicator.classList.remove('bg-yellow-500'); connectionIndicator.classList.remove('bg-green-500'); connectionIndicator.classList.add('bg-gray-500'); connectionText.textContent = 'No devices'; connectionTooltip.textContent = 'No compatible scanners were detected'; } }).catch(error => { console.error('Scanner detection error:', error); statusMessage.textContent = 'Error detecting scanners'; connectionIndicator.classList.add('bg-gray-500'); connectionText.textContent = 'Detection failed'; connectionTooltip.textContent = 'Error scanning for devices: ' + error.message; }); } function detectRealScanners() { return new Promise((resolve, reject) => { try { // In a real application, this would interface with: // 1. SANE backend (Linux) // 2. TWAIN drivers (Windows) // 3. Image Capture Framework (Mac) // // This is a simulation of what that API might look like // Simulate detection delay setTimeout(() => { // Check if the browser has TWAIN or WIA access (not possible in real web apps) const hasTwainAccess = false; const hasWiaAccess = false; if (hasTwainAccess) { // In a real native app, we would enumerate TWAIN devices resolve([ { id: 'usb-real-001', name: 'Epson Perfection V600 (USB)', model: 'Perfection V600', vendor: 'Epson', type: 'Flatbed Scanner', resolution: '6400 dpi', dynamicRange: '3.4 Dmax', interface: 'USB' } ]); } else if (hasWiaAccess) { // In a real native app, we would enumerate WIA devices resolve([ { id: 'usb-real-002', name: 'Canon CanoScan 9000F (USB)', model: 'CanoScan 9000F', vendor: 'Canon', type: 'Film Scanner', resolution: '9600 dpi', dynamicRange: '3.6 Dmax', interface: 'USB' } ]); } else { // In a real web application, we would need a: // 1. Browser extension that provides scanner access // 2. Localhost server that interfaces with SANE/TWAIN // 3. Electron/NW.js app with native bindings // For this demo, we'll just return an empty array resolve([]); // If this were a real native app, we would: // try { // const devices = window.scannerAPI.getDevices(); // resolve(devices); // } catch (error) { // reject(error); // } } }, 1500); } catch (error) { reject(error); } }); } function toggleScannerConnection() { if (isConnected) { disconnectScanner(); } else { connectScanner(); } } function connectScanner() { const selectedScannerId = scannerSelect.value; if (!selectedScannerId) { statusMessage.textContent = 'Please select a scanner first'; return; } statusMessage.textContent = 'Establishing connection...'; // In a real app, we would call the scanner API to connect // For this demo, we'll just simulate connecting to a generic scanner setTimeout(() => { currentScanner = { id: selectedScannerId, name: scannerSelect.options[scannerSelect.selectedIndex].text.replace(/<[^>]*>/g, '').trim(), model: 'Connected Scanner', vendor: 'Manufacturer', type: 'Flatbed Scanner', resolution: '1200 dpi', dynamicRange: '3.0 Dmax', interface: 'USB' }; isConnected = true; // Update scanner details scannerModel.textContent = currentScanner.model; scannerVendor.textContent = currentScanner.vendor; scannerType.textContent = currentScanner.type; scannerResolution.textContent = currentScanner.resolution; scannerDynamicRange.textContent = currentScanner.dynamicRange; scannerInterface.textContent = currentScanner.interface; // Update connection info connectionTypeInfo.innerHTML = `Connected via <strong class="text-primary">${currentScanner.interface}</strong> to <strong>${currentScanner.vendor} ${currentScanner.model}</strong>`; connectionInfo.classList.remove('hidden'); // Interface-specific styling if (currentScanner.interface === 'Thunderbolt') { scannerPanel.classList.add('border-thunderbolt'); } else if (currentScanner.interface === 'Firewire') { scannerPanel.classList.add('border-firewire'); } else if (currentScanner.interface === 'USB') { scannerPanel.classList.add('border-usb'); } else if (currentScanner.interface === 'Network') { scannerPanel.classList.add('border-network'); } statusMessage.textContent = `Connected to ${currentScanner.vendor} ${currentScanner.model}`; scannerDetails.classList.remove('hidden'); updateUI(); }, 1000); } function disconnectScanner() { statusMessage.textContent = 'Disconnecting...'; // Clear any ongoing scans clearInterval(timer); progressContainer.classList.add('hidden'); setTimeout(() => { isConnected = false; currentScanner = null; previewImage.src = ''; previewImage.classList.add('hidden'); placeholderText.classList.remove('hidden'); connectionInfo.classList.add('hidden'); // Reset panel border scannerPanel.classList.remove('border-thunderbolt', 'border-firewire', 'border-usb', 'border-network'); statusMessage.textContent = 'Scanner disconnected'; updateUI(); }, 500); } function startPreview() { if (!isConnected) return; statusMessage.textContent = 'Creating preview scan...'; scannerLight.style.opacity = '1'; // In a real app, we would call the scanner API to do a preview scan // This is just a simulation setTimeout(() => { statusMessage.textContent = 'Preview completed'; scannerLight.style.opacity = '0'; alert("In a real application, this would show a preview from the connected scanner."); }, 1500); } function startScan() { if (!isConnected) return; statusMessage.textContent = 'Starting full resolution scan...'; scannerLight.style.opacity = '1'; progressContainer.classList.remove('hidden'); progressBar.style.width = '0%'; progressPercent.textContent = '0%'; scanningProgress = 0; // In a real app, we would call the scanner API to do a full scan // This is just a simulation of progress clearInterval(timer); timer = setInterval(() => { scanningProgress += 5; if (scanningProgress >= 100) { scanningProgress = 100; clearInterval(timer); progressBar.style.width = '100%'; progressPercent.textContent = '100%'; scannerLight.style.opacity = '0'; statusMessage.textContent = 'Scan completed'; alert("In a real application, this would show the scanned image."); } else { progressBar.style.width = `${scanningProgress}%`; progressPercent.textContent = `${scanningProgress}%`; } }, 100); } function refreshScanners() { if (isConnected) { disconnectScanner(); } scannerLight.style.opacity = '1'; setTimeout(() => { detectScanners(); scannerLight.style.opacity = '0'; }, 500); } function showHardwareInfo() { alert("Live Mode: The application will attempt to detect actual connected hardware. For full functionality, this should be run as a native application with proper scanner drivers installed."); } function showConnectionMethodModal() { connectionMethodModal.classList.remove('hidden'); } function hideConnectionMethodModal() { connectionMethodModal.classList.add('hidden'); } function saveConnectionPreferences() { connectionMethod = connectionPriority.value; hideConnectionMethodModal(); refreshScanners(); } function updateConnectionPriority() { const selectedPriority = connectionPriority.value; console.log('Connection priority set to:', selectedPriority); } function setStandardMode() { isExpertMode = false; updateUI(); } function setExpertMode() { isExpertMode = true; updateUI(); } function saveImage() { alert("In a real application, this would save the scanned image to disk."); } function resetSettings() { // Reset all sliders to defaults document.getElementById('brightnessSlider').value = 100; document.getElementById('brightnessValue').textContent = '100'; document.getElementById('contrastSlider').value = 100; document.getElementById('contrastValue').textContent = '100'; document.getElementById('sharpnessSlider').value = 50; document.getElementById('sharpnessValue').textContent = '50'; document.getElementById('colorBalanceSlider').value = 0; document.getElementById('colorBalanceValue').textContent = '0'; document.getElementById('saturationSlider').value = 0; document.getElementById('saturationValue').textContent = '0'; document.getElementById('gradationSlider').value = 0; document.getElementById('gradationValue').textContent = '0'; document.getElementById('densitySlider').value = 50; document.getElementById('densityValue').textContent = '50'; document.getElementById('shadowSlider').value = 0; document.getElementById('shadowValue').textContent = '0'; if (isConnected) { statusMessage.textContent = 'Settings reset to defaults'; } } function toggleMultipassControls() { if (multipassCheck.checked) { multipassControls.classList.remove('hidden'); } else { multipassControls.classList.add('hidden'); } } function updateSliderValue(e) { const sliderId = e.target.id; const valueElement = document.getElementById(sliderId.replace('Slider', 'Value')); valueElement.textContent = e.target.value; } </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/flextight-control1" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> </html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FlexiscanPro - Professional Scanner Control</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">
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#005293',
primarylight: '#e6f0f8',
primarydark: '#003a6d',
firewire: '#FF4500',
thunderbolt: '#0071C5',
usb: '#00a651',
network: '#8e44ad'
}
}
}
}
</script>
<style>
@keyframes scannerActive {
0% { opacity: 0.5; }
50% { opacity: 1; }
100% { opacity: 0.5; }
}
.scanner-active {
animation: scannerActive 1.5s infinite;
}
.preview-container {
background-image: linear-gradient(45deg, #eee 25%, transparent 25%),
linear-gradient(-45deg, #eee 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #eee 75%),
linear-gradient(-45deg, transparent 75%, #eee 75%);
background-size: 20px 20px;
background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
position: relative;
}
input[type="range"] {
-webkit-appearance: none;
width: 100%;
height: 8px;
border-radius: 4px;
background: #e5e7eb;
outline: none;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 18px;
height: 18px;
border-radius: 50%;
background: #005293;
cursor: pointer;
transition: transform 0.1s;
}
input[type="range"]::-webkit-slider-thumb:active {
transform: scale(1.2);
}
.tooltip {
display: none;
position: absolute;
z-index: 10;
background-color: black;
color: white;
font-size: 0.75rem;
padding: 0.25rem 0.5rem;
border-radius: 0.25rem;
transform: translateX(-50%);
left: 50%;
bottom: 100%;
margin-bottom: 0.5rem;
white-space: nowrap;
}
.tooltip-container:hover .tooltip {
display: block;
}
.film-option {
transition: all 0.2s;
}
.film-option:hover {
background-color: #f0f0f0;
}
.expert-border {
border: 2px dashed #4a5568;