Spaces:
Running

WDFluho commited on
Commit
040d06f
·
verified ·
1 Parent(s): 16e36d2

Add 2 files

Browse files
Files changed (2) hide show
  1. index.html +761 -8
  2. prompts.txt +1 -1
index.html CHANGED
@@ -13,9 +13,13 @@
13
  colors: {
14
  primary: '#005293',
15
  primarylight: '#e6f0f8',
 
16
  firewire: '#FF4500',
17
  thunderbolt: '#0071C5',
18
- expertdark: '#2d3748'
 
 
 
19
  }
20
  }
21
  }
@@ -39,6 +43,7 @@
39
  linear-gradient(-45deg, transparent 75%, #eee 75%);
40
  background-size: 20px 20px;
41
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
 
42
  }
43
 
44
  input[type="range"] {
@@ -58,6 +63,11 @@
58
  border-radius: 50%;
59
  background: #005293;
60
  cursor: pointer;
 
 
 
 
 
61
  }
62
 
63
  .tooltip {
@@ -103,16 +113,59 @@
103
  .expert-setting {
104
  background-color: #f8fafc;
105
  border-left: 3px solid #4a5568;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  }
107
  </style>
108
  </head>
109
  <body class="bg-gray-100">
110
- <div class="container mx-auto px-4 py-6 max-w-7xl">
111
  <!-- Header -->
112
  <header class="flex justify-between items-center mb-8">
113
  <div class="flex items-center">
114
  <h1 class="text-2xl font-bold text-primary">FlexiscanPro</h1>
115
- <span class="ml-2 text-xs bg-primary text-white px-2 py-1 rounded">LIVE MODE</span>
116
  </div>
117
  <div class="flex items-center space-x-4">
118
  <div id="connectionStatus" class="flex items-center">
@@ -133,6 +186,10 @@
133
  <i class="fas fa-plug text-xl"></i>
134
  <span class="tooltip">Connection method</span>
135
  </button>
 
 
 
 
136
  <button id="infoBtn" class="text-primary hover:text-primary/80 tooltip-container">
137
  <i class="fas fa-info-circle text-xl"></i>
138
  <span class="tooltip">Information</span>
@@ -153,6 +210,7 @@
153
  <option value="thunderbolt">Thunderbolt (if available)</option>
154
  <option value="firewire">Firewire (if available)</option>
155
  <option value="usb">USB (if available)</option>
 
156
  </select>
157
  </div>
158
 
@@ -179,7 +237,7 @@
179
  <!-- Main Content -->
180
  <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
181
  <!-- Scanner Control Panel -->
182
- <div id="scannerPanel" class="lg:col-span-1 bg-white rounded-lg shadow p-6 expert-border">
183
  <h2 class="text-lg font-semibold text-gray-800 mb-4">Scanner Control</h2>
184
 
185
  <div class="space-y-4">
@@ -416,7 +474,7 @@
416
  <img id="previewImage" src="" alt="Scan Result" class="hidden max-w-full max-h-full object-contain">
417
 
418
  <!-- ROI Rectangle for Expert Mode -->
419
- <div id="roiRectangle" class="expert-only absolute border-2 border-yellow-400 pointer-events-none hidden" style="background-color: rgba(255, 255, 0, 0.2);"></div>
420
  </div>
421
 
422
  <!-- Advanced image settings -->
@@ -547,7 +605,7 @@
547
  <i class="fas fa-undo mr-1"></i> Reset
548
  </button>
549
  <button id="hardwareStatusBtn" class="px-4 py-2 bg-green-200 text-green-800 rounded hover:bg-green-300">
550
- <i class="fas fa-plug mr-1"></i> Live Mode
551
  </button>
552
  </div>
553
  </div>
@@ -555,7 +613,7 @@
555
 
556
  <!-- Scan Information -->
557
  <div class="lg:col-span-3 bg-white rounded-lg shadow p-6">
558
- <h2 class="text-lg font-semibold text-gray-800 mb-2">Scan Information</h2>
559
  <div id="scanInfo" class="text-sm text-gray-600">
560
  <p class="mb-2">Searching for compatible devices...</p>
561
  <p id="connectionInfo" class="hidden text-xs bg-primarylight p-2 rounded border border-primary/30">
@@ -581,5 +639,700 @@
581
  <i class="fas fa-check-circle text-green-500 mr-1 mt-0.5"></i>
582
  <span>For best performance connect directly</span>
583
  </li>
584
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
585
  </html>
 
13
  colors: {
14
  primary: '#005293',
15
  primarylight: '#e6f0f8',
16
+ primarydark: '#003a6d',
17
  firewire: '#FF4500',
18
  thunderbolt: '#0071C5',
19
+ usb: '#00a651',
20
+ network: '#8e44ad',
21
+ expertdark: '#2d3748',
22
+ devmode: '#6c757d'
23
  }
24
  }
25
  }
 
43
  linear-gradient(-45deg, transparent 75%, #eee 75%);
44
  background-size: 20px 20px;
45
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
46
+ position: relative;
47
  }
48
 
49
  input[type="range"] {
 
63
  border-radius: 50%;
64
  background: #005293;
65
  cursor: pointer;
66
+ transition: transform 0.1s;
67
+ }
68
+
69
+ input[type="range"]::-webkit-slider-thumb:active {
70
+ transform: scale(1.2);
71
  }
72
 
73
  .tooltip {
 
113
  .expert-setting {
114
  background-color: #f8fafc;
115
  border-left: 3px solid #4a5568;
116
+ transition: background-color 0.2s;
117
+ }
118
+
119
+ .expert-setting:hover {
120
+ background-color: #edf2f7;
121
+ }
122
+
123
+ /* Interface color indicators */
124
+ .interface-indicator {
125
+ display: inline-block;
126
+ width: 12px;
127
+ height: 12px;
128
+ border-radius: 50%;
129
+ margin-right: 5px;
130
+ }
131
+
132
+ .interface-thunderbolt {
133
+ background-color: #0071C5;
134
+ }
135
+
136
+ .interface-firewire {
137
+ background-color: #FF4500;
138
+ }
139
+
140
+ .interface-usb {
141
+ background-color: #00a651;
142
+ }
143
+
144
+ .interface-network {
145
+ background-color: #8e44ad;
146
+ }
147
+
148
+ /* Developer mode styles */
149
+ .dev-mode .scanner-panel {
150
+ border-color: #6c757d;
151
+ }
152
+
153
+ .dev-mode .hardware-indicator {
154
+ background-color: #6c757d !important;
155
+ }
156
+
157
+ .dev-mode .live-indicator {
158
+ background-color: #6c757d !important;
159
  }
160
  </style>
161
  </head>
162
  <body class="bg-gray-100">
163
+ <div class="container mx-auto px-4 py-6 max-w-7xl" id="appContainer">
164
  <!-- Header -->
165
  <header class="flex justify-between items-center mb-8">
166
  <div class="flex items-center">
167
  <h1 class="text-2xl font-bold text-primary">FlexiscanPro</h1>
168
+ <span id="liveIndicator" class="ml-2 text-xs bg-primary text-white px-2 py-1 rounded">LIVE MODE</span>
169
  </div>
170
  <div class="flex items-center space-x-4">
171
  <div id="connectionStatus" class="flex items-center">
 
186
  <i class="fas fa-plug text-xl"></i>
187
  <span class="tooltip">Connection method</span>
188
  </button>
189
+ <button id="devModeToggle" class="text-primary hover:text-primary/80 tooltip-container">
190
+ <i class="fas fa-code text-xl"></i>
191
+ <span class="tooltip">Toggle Dev Mode</span>
192
+ </button>
193
  <button id="infoBtn" class="text-primary hover:text-primary/80 tooltip-container">
194
  <i class="fas fa-info-circle text-xl"></i>
195
  <span class="tooltip">Information</span>
 
210
  <option value="thunderbolt">Thunderbolt (if available)</option>
211
  <option value="firewire">Firewire (if available)</option>
212
  <option value="usb">USB (if available)</option>
213
+ <option value="network">Network (if available)</option>
214
  </select>
215
  </div>
216
 
 
237
  <!-- Main Content -->
238
  <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
239
  <!-- Scanner Control Panel -->
240
+ <div id="scannerPanel" class="scanner-panel lg:col-span-1 bg-white rounded-lg shadow p-6 expert-border">
241
  <h2 class="text-lg font-semibold text-gray-800 mb-4">Scanner Control</h2>
242
 
243
  <div class="space-y-4">
 
474
  <img id="previewImage" src="" alt="Scan Result" class="hidden max-w-full max-h-full object-contain">
475
 
476
  <!-- ROI Rectangle for Expert Mode -->
477
+ <div id="roiRectangle" class="absolute border-2 border-yellow-400 pointer-events-none hidden" style="background-color: rgba(255, 255, 0, 0.2);"></div>
478
  </div>
479
 
480
  <!-- Advanced image settings -->
 
605
  <i class="fas fa-undo mr-1"></i> Reset
606
  </button>
607
  <button id="hardwareStatusBtn" class="px-4 py-2 bg-green-200 text-green-800 rounded hover:bg-green-300">
608
+ <i class="fas fa-plug mr-1"></i> <span id="hardwareStatusText">Live Mode</span>
609
  </button>
610
  </div>
611
  </div>
 
613
 
614
  <!-- Scan Information -->
615
  <div class="lg:col-span-3 bg-white rounded-lg shadow p-6">
616
+ <h2 class="text-lg font-semibold text-gray-800 mb-2">Scanner Hub</h2>
617
  <div id="scanInfo" class="text-sm text-gray-600">
618
  <p class="mb-2">Searching for compatible devices...</p>
619
  <p id="connectionInfo" class="hidden text-xs bg-primarylight p-2 rounded border border-primary/30">
 
639
  <i class="fas fa-check-circle text-green-500 mr-1 mt-0.5"></i>
640
  <span>For best performance connect directly</span>
641
  </li>
642
+ </ul>
643
+ </div>
644
+
645
+ <div class="bg-gray-50 p-3 rounded border border-gray-200">
646
+ <h3 class="text-sm font-medium text-gray-700 mb-1 flex items-center">
647
+ <i class="fas fa-fire-alt text-firewire mr-1"></i> Firewire Help
648
+ </h3>
649
+ <ul class="text-xs text-gray-600 space-y-1">
650
+ <li class="flex items-start">
651
+ <i class="fas fa-check-circle text-green-500 mr-1 mt-0.5"></i>
652
+ <span>1394 drivers must be installed</span>
653
+ </li>
654
+ <li class="flex items-start">
655
+ <i class="fas fa-check-circle text-green-500 mr-1 mt-0.5"></i>
656
+ <span>Older Macs may need Legacy Drivers</span>
657
+ </li>
658
+ <li class="flex items-start">
659
+ <i class="fas fa-check-circle text-green-500 mr-1 mt-0.5"></i>
660
+ <span>Chain no more than 4 devices</span>
661
+ </li>
662
+ </ul>
663
+ </div>
664
+
665
+ <div class="bg-gray-50 p-3 rounded border border-gray-200">
666
+ <h3 class="text-sm font-medium text-gray-700 mb-1 flex items-center">
667
+ <i class="fas fa-usb text-usb mr-1"></i> USB Help
668
+ </h3>
669
+ <ul class="text-xs text-gray-600 space-y-1">
670
+ <li class="flex items-start">
671
+ <i class="fas fa-check-circle text-green-500 mr-1 mt-0.5"></i>
672
+ <span>Install vendor-specific USB drivers</span>
673
+ </li>
674
+ <li class="flex items-start">
675
+ <i class="fas fa-check-circle text-green-500 mr-1 mt-0.5"></i>
676
+ <span>Use USB 3.0+ for high resolution</span>
677
+ </li>
678
+ <li class="flex items-start">
679
+ <i class="fas fa-check-circle text-green-500 mr-1 mt-0.5"></i>
680
+ <span>Avoid USB hubs for stability</span>
681
+ </li>
682
+ </ul>
683
+ </div>
684
+ </div>
685
+ </div>
686
+ </div>
687
+ </div>
688
+
689
+ <script>
690
+ // Debugging and enhancements:
691
+ // 1. Fixed missing closing tags
692
+ // 2. Improved connection detection
693
+ // 3. Added developer mode toggle
694
+ // 4. Enhanced interface detection
695
+ // 5. Added proper event handling
696
+
697
+ // DOM elements
698
+ const scannerSelect = document.getElementById('scannerSelect');
699
+ const connectBtn = document.getElementById('connectBtn');
700
+ const previewBtn = document.getElementById('previewBtn');
701
+ const scanBtn = document.getElementById('scanBtn');
702
+ const scannerDetails = document.getElementById('scannerDetails');
703
+ const previewImage = document.getElementById('previewImage');
704
+ const placeholderText = document.getElementById('placeholderText');
705
+ const connectionIndicator = document.getElementById('connectionIndicator');
706
+ const connectionText = document.getElementById('connectionText');
707
+ const connectionTooltip = document.getElementById('connectionTooltip');
708
+ const refreshDevicesBtn = document.getElementById('refreshDevicesBtn');
709
+ const devModeToggle = document.getElementById('devModeToggle');
710
+ const liveIndicator = document.getElementById('liveIndicator');
711
+ const hardwareStatusBtn = document.getElementById('hardwareStatusBtn');
712
+ const hardwareStatusText = document.getElementById('hardwareStatusText');
713
+ const connectionMethodBtn = document.getElementById('connectionMethodBtn');
714
+ const connectionMethodModal = document.getElementById('connectionMethodModal');
715
+ const closeConnectionModalBtn = document.getElementById('closeConnectionModalBtn');
716
+ const saveConnectionPrefBtn = document.getElementById('saveConnectionPrefBtn');
717
+ const connectionPriority = document.getElementById('connectionPriority');
718
+ const standardModeBtn = document.getElementById('standardModeBtn');
719
+ const expertModeBtn = document.getElementById('expertModeBtn');
720
+ const scannerPanel = document.getElementById('scannerPanel');
721
+ const appContainer = document.getElementById('appContainer');
722
+ const scannerLight = document.getElementById('scannerLight');
723
+ const progressContainer = document.getElementById('progressContainer');
724
+ const progressBar = document.getElementById('progressBar');
725
+ const progressPercent = document.getElementById('progressPercent');
726
+ const saveImageBtn = document.getElementById('saveImageBtn');
727
+ const resetSettingsBtn = document.getElementById('resetSettingsBtn');
728
+ const statusMessage = document.getElementById('statusMessage');
729
+ const multipassCheck = document.getElementById('multipassCheck');
730
+ const multipassControls = document.getElementById('multipassControls');
731
+ const connectionInfo = document.getElementById('connectionInfo');
732
+ const connectionTypeInfo = document.getElementById('connectionTypeInfo');
733
+ const scannerModel = document.getElementById('scannerModel');
734
+ const scannerVendor = document.getElementById('scannerVendor');
735
+ const scannerType = document.getElementById('scannerType');
736
+ const scannerResolution = document.getElementById('scannerResolution');
737
+ const scannerDynamicRange = document.getElementById('scannerDynamicRange');
738
+ const scannerInterface = document.getElementById('scannerInterface');
739
+
740
+ // State variables
741
+ let isConnected = false;
742
+ let isExpertMode = false;
743
+ let isDevMode = false;
744
+ let currentScanner = null;
745
+ let connectionMethod = 'auto';
746
+ let scanningProgress = 0;
747
+ let timer = null;
748
+
749
+ // Simulated scanner database
750
+ const simulatedScanners = [
751
+ {
752
+ id: 'usb-001',
753
+ name: 'Epson Perfection V850 Pro (USB)',
754
+ model: 'Perfection V850 Pro',
755
+ vendor: 'Epson',
756
+ type: 'Flatbed Scanner',
757
+ resolution: '6400 dpi',
758
+ dynamicRange: '4.0 Dmax',
759
+ interface: 'USB 3.0',
760
+ connection: 'usb'
761
+ },
762
+ {
763
+ id: 'thunderbolt-001',
764
+ name: 'Hasselblad Flextight X5 (Thunderbolt)',
765
+ model: 'Flextight X5',
766
+ vendor: 'Hasselblad',
767
+ type: 'Film Scanner',
768
+ resolution: '8000 dpi',
769
+ dynamicRange: '4.8 Dmax',
770
+ interface: 'Thunderbolt 3',
771
+ connection: 'thunderbolt'
772
+ },
773
+ {
774
+ id: 'firewire-001',
775
+ name: 'Nikon Coolscan 9000 ED (Firewire)',
776
+ model: 'Coolscan 9000 ED',
777
+ vendor: 'Nikon',
778
+ type: 'Film Scanner',
779
+ resolution: '4000 dpi',
780
+ dynamicRange: '4.2 Dmax',
781
+ interface: 'Firewire 400',
782
+ connection: 'firewire'
783
+ },
784
+ {
785
+ id: 'network-001',
786
+ name: 'Kodak i1120 Scanners (Network)',
787
+ model: 'i1120',
788
+ vendor: 'Kodak',
789
+ type: 'Document Scanner',
790
+ resolution: '600 dpi',
791
+ dynamicRange: '2.8 Dmax',
792
+ interface: 'Gigabit Ethernet',
793
+ connection: 'network'
794
+ }
795
+ ];
796
+
797
+ // DOM Content Loaded
798
+ document.addEventListener('DOMContentLoaded', function() {
799
+ initializeApp();
800
+ });
801
+
802
+ function initializeApp() {
803
+ // Event listeners
804
+ connectBtn.addEventListener('click', toggleScannerConnection);
805
+ previewBtn.addEventListener('click', startPreview);
806
+ scanBtn.addEventListener('click', startScan);
807
+ refreshDevicesBtn.addEventListener('click', refreshScanners);
808
+ devModeToggle.addEventListener('click', toggleDevMode);
809
+ hardwareStatusBtn.addEventListener('click', toggleHardwareStatus);
810
+ connectionMethodBtn.addEventListener('click', showConnectionMethodModal);
811
+ closeConnectionModalBtn.addEventListener('click', hideConnectionMethodModal);
812
+ saveConnectionPrefBtn.addEventListener('click', saveConnectionPreferences);
813
+ standardModeBtn.addEventListener('click', setStandardMode);
814
+ expertModeBtn.addEventListener('click', setExpertMode);
815
+ saveImageBtn.addEventListener('click', saveImage);
816
+ resetSettingsBtn.addEventListener('click', resetSettings);
817
+ multipassCheck.addEventListener('change', toggleMultipassControls);
818
+ connectionPriority.addEventListener('change', updateConnectionPriority);
819
+
820
+ // Sliders with immediate feedback
821
+ document.getElementById('brightnessSlider').addEventListener('input', updateSliderValue);
822
+ document.getElementById('contrastSlider').addEventListener('input', updateSliderValue);
823
+ document.getElementById('sharpnessSlider').addEventListener('input', updateSliderValue);
824
+ document.getElementById('colorBalanceSlider').addEventListener('input', updateSliderValue);
825
+ document.getElementById('saturationSlider').addEventListener('input', updateSliderValue);
826
+ document.getElementById('gradationSlider').addEventListener('input', updateSliderValue);
827
+ document.getElementById('densitySlider').addEventListener('input', updateSliderValue);
828
+ document.getElementById('shadowSlider').addEventListener('input', updateSliderValue);
829
+
830
+ // Initialize the app
831
+ updateUI();
832
+ detectScanners();
833
+ }
834
+
835
+ function updateUI() {
836
+ // Update connection status indicators
837
+ if (isConnected) {
838
+ connectBtn.textContent = 'Disconnect';
839
+ connectBtn.classList.remove('bg-primary');
840
+ connectBtn.classList.add('bg-red-500');
841
+ previewBtn.disabled = false;
842
+ scanBtn.disabled = false;
843
+ connectionIndicator.classList.remove('bg-gray-500');
844
+ connectionIndicator.classList.add('bg-green-500');
845
+ connectionText.textContent = 'Connected';
846
+ connectionTooltip.textContent = 'Scanner is ready for operation';
847
+ scannerLight.classList.add('scanner-active');
848
+ } else {
849
+ connectBtn.textContent = 'Connect';
850
+ connectBtn.classList.add('bg-primary');
851
+ connectBtn.classList.remove('bg-red-500');
852
+ previewBtn.disabled = true;
853
+ scanBtn.disabled = true;
854
+ connectionIndicator.classList.remove('bg-green-500');
855
+ connectionText.textContent = 'Disconnected';
856
+ connectionTooltip.textContent = 'No scanner connected';
857
+ scannerLight.classList.remove('scanner-active');
858
+ scannerDetails.classList.add('hidden');
859
+ }
860
+
861
+ // Update expert mode
862
+ if (isExpertMode) {
863
+ expertModeBtn.classList.add('bg-primarydark');
864
+ appContainer.classList.add('expert-mode');
865
+ } else {
866
+ expertModeBtn.classList.remove('bg-primarydark');
867
+ appContainer.classList.remove('expert-mode');
868
+ }
869
+
870
+ // Update dev mode
871
+ if (isDevMode) {
872
+ liveIndicator.textContent = 'DEV MODE';
873
+ liveIndicator.classList.remove('bg-primary');
874
+ liveIndicator.classList.add('bg-devmode');
875
+ appContainer.classList.add('dev-mode');
876
+ hardwareStatusText.textContent = 'Simulated Mode';
877
+ hardwareStatusBtn.classList.remove('bg-green-200', 'text-green-800');
878
+ hardwareStatusBtn.classList.add('bg-yellow-200', 'text-yellow-800');
879
+ } else {
880
+ liveIndicator.textContent = 'LIVE MODE';
881
+ liveIndicator.classList.add('bg-primary');
882
+ liveIndicator.classList.remove('bg-devmode');
883
+ appContainer.classList.remove('dev-mode');
884
+ hardwareStatusText.textContent = 'Live Mode';
885
+ hardwareStatusBtn.classList.add('bg-green-200', 'text-green-800');
886
+ hardwareStatusBtn.classList.remove('bg-yellow-200', 'text-yellow-800');
887
+ }
888
+ }
889
+
890
+ function detectScanners() {
891
+ statusMessage.textContent = 'Searching for available scanners...';
892
+
893
+ // Clear existing options
894
+ while (scannerSelect.options.length > 1) {
895
+ scannerSelect.remove(1);
896
+ }
897
+
898
+ // Simulate scanner detection
899
+ setTimeout(() => {
900
+ let availableScanners = [];
901
+
902
+ // In dev mode, use simulated scanners
903
+ if (isDevMode) {
904
+ availableScanners = simulatedScanners;
905
+ } else {
906
+ // In live mode, try to detect actual scanners (simulated here)
907
+ availableScanners = simulateRealScannerDetection();
908
+ }
909
+
910
+ if (availableScanners.length > 0) {
911
+ let preferredScannerIndex = -1;
912
+
913
+ // Add detected scanners to dropdown
914
+ availableScanners.forEach((scanner, index) => {
915
+ const option = document.createElement('option');
916
+ option.value = scanner.id;
917
+
918
+ // Add interface indicator
919
+ let interfaceClass = '';
920
+ if (scanner.connection === 'thunderbolt') interfaceClass = 'interface-thunderbolt';
921
+ if (scanner.connection === 'firewire') interfaceClass = 'interface-firewire';
922
+ if (scanner.connection === 'usb') interfaceClass = 'interface-usb';
923
+ if (scanner.connection === 'network') interfaceClass = 'interface-network';
924
+
925
+ option.innerHTML = `<span class="${interfaceClass} interface-indicator"></span>${scanner.name}`;
926
+ scannerSelect.appendChild(option);
927
+
928
+ // Check if this matches our connection priority
929
+ if (connectionPriority.value === scanner.connection) {
930
+ preferredScannerIndex = index;
931
+ }
932
+ });
933
+
934
+ // Select preferred scanner if found
935
+ if (preferredScannerIndex >= 0) {
936
+ scannerSelect.selectedIndex = preferredScannerIndex + 1; // +1 for the first "Select scanner" option
937
+ }
938
+
939
+ statusMessage.textContent = `${availableScanners.length} scanner(s) found`;
940
+ connectionIndicator.classList.remove('bg-gray-500');
941
+ connectionIndicator.classList.add('bg-yellow-500');
942
+ connectionText.textContent = 'Devices available';
943
+ connectionTooltip.textContent = 'Click connect to establish scanner connection';
944
+ } else {
945
+ statusMessage.textContent = 'No compatible scanners detected';
946
+ connectionIndicator.classList.remove('bg-yellow-500');
947
+ connectionIndicator.classList.remove('bg-green-500');
948
+ connectionIndicator.classList.add('bg-gray-500');
949
+ connectionText.textContent = 'No devices';
950
+ connectionTooltip.textContent = 'No compatible scanners were detected';
951
+ }
952
+ }, 1500);
953
+ }
954
+
955
+ function simulateRealScannerDetection() {
956
+ const detectedScanners = [];
957
+
958
+ // Simulate different connection types being detected
959
+ const connectionTypes = ['usb', 'thunderbolt', 'firewire', 'network'];
960
+
961
+ // Randomly decide which scanners are available
962
+ connectionTypes.forEach(type => {
963
+ if (Math.random() > 0.3) { // 70% chance of detecting each type
964
+ let scanner = null;
965
+
966
+ switch(type) {
967
+ case 'usb':
968
+ scanner = {
969
+ id: 'usb-detect-' + Math.floor(Math.random() * 1000),
970
+ name: 'USB Scanner ' + (Math.floor(Math.random() * 100) + 1000),
971
+ model: 'USB Model',
972
+ vendor: 'Manufacturer',
973
+ type: 'Document Scanner',
974
+ resolution: Math.floor(Math.random() * 4800) + 600 + ' dpi',
975
+ dynamicRange: (Math.random() * 2 + 2).toFixed(1) + ' Dmax',
976
+ interface: 'USB ' + (Math.random() > 0.5 ? '3.0' : '2.0'),
977
+ connection: 'usb'
978
+ };
979
+ break;
980
+ case 'thunderbolt':
981
+ scanner = {
982
+ id: 'tb-detect-' + Math.floor(Math.random() * 1000),
983
+ name: 'Thunderbolt Scanner ' + (Math.floor(Math.random() * 100) + 1000),
984
+ model: 'TB Model',
985
+ vendor: 'Manufacturer',
986
+ type: 'Film Scanner',
987
+ resolution: Math.floor(Math.random() * 4000) + 4000 + ' dpi',
988
+ dynamicRange: (Math.random() * 2 + 3).toFixed(1) + ' Dmax',
989
+ interface: 'Thunderbolt ' + (Math.random() > 0.5 ? '3' : '2'),
990
+ connection: 'thunderbolt'
991
+ };
992
+ break;
993
+ case 'firewire':
994
+ scanner = {
995
+ id: 'fw-detect-' + Math.floor(Math.random() * 1000),
996
+ name: 'Firewire Scanner ' + (Math.floor(Math.random() * 100) + 1000),
997
+ model: 'FW Model',
998
+ vendor: 'Manufacturer',
999
+ type: 'Photo Scanner',
1000
+ resolution: Math.floor(Math.random() * 3200) + 800 + ' dpi',
1001
+ dynamicRange: (Math.random() * 2 + 2.5).toFixed(1) + ' Dmax',
1002
+ interface: 'Firewire ' + (Math.random() > 0.5 ? '800' : '400'),
1003
+ connection: 'firewire'
1004
+ };
1005
+ break;
1006
+ case 'network':
1007
+ scanner = {
1008
+ id: 'net-detect-' + Math.floor(Math.random() * 1000),
1009
+ name: 'Network Scanner ' + (Math.floor(Math.random() * 100) + 1000),
1010
+ model: 'Network Model',
1011
+ vendor: 'Manufacturer',
1012
+ type: 'Document Scanner',
1013
+ resolution: Math.floor(Math.random() * 900) + 600 + ' dpi',
1014
+ dynamicRange: (Math.random() * 2 + 2).toFixed(1) + ' Dmax',
1015
+ interface: 'Gigabit Ethernet',
1016
+ connection: 'network'
1017
+ };
1018
+ break;
1019
+ }
1020
+
1021
+ if (scanner) detectedScanners.push(scanner);
1022
+ }
1023
+ });
1024
+
1025
+ return detectedScanners;
1026
+ }
1027
+
1028
+ function toggleScannerConnection() {
1029
+ if (isConnected) {
1030
+ disconnectScanner();
1031
+ } else {
1032
+ connectScanner();
1033
+ }
1034
+ }
1035
+
1036
+ function connectScanner() {
1037
+ const selectedScannerId = scannerSelect.value;
1038
+
1039
+ if (!selectedScannerId) {
1040
+ statusMessage.textContent = 'Please select a scanner first';
1041
+ return;
1042
+ }
1043
+
1044
+ statusMessage.textContent = 'Establishing connection...';
1045
+
1046
+ // Find the selected scanner
1047
+ let selectedScanner = null;
1048
+
1049
+ if (isDevMode) {
1050
+ selectedScanner = simulatedScanners.find(scanner => scanner.id === selectedScannerId);
1051
+ } else {
1052
+ // In live mode, use the simulated detection - in a real app this would query real devices
1053
+ const allScanners = simulateRealScannerDetection();
1054
+ selectedScanner = allScanners.find(scanner => scanner.id === selectedScannerId);
1055
+ }
1056
+
1057
+ if (selectedScanner) {
1058
+ // Simulate connection delay
1059
+ setTimeout(() => {
1060
+ currentScanner = selectedScanner;
1061
+ isConnected = true;
1062
+
1063
+ // Update scanner details
1064
+ scannerModel.textContent = currentScanner.model;
1065
+ scannerVendor.textContent = currentScanner.vendor;
1066
+ scannerType.textContent = currentScanner.type;
1067
+ scannerResolution.textContent = currentScanner.resolution;
1068
+ scannerDynamicRange.textContent = currentScanner.dynamicRange;
1069
+ scannerInterface.textContent = currentScanner.interface;
1070
+
1071
+ // Update connection info
1072
+ connectionTypeInfo.innerHTML = `Connected via <strong class="text-primary">${currentScanner.interface}</strong> to <strong>${currentScanner.vendor} ${currentScanner.model}</strong>`;
1073
+ connectionInfo.classList.remove('hidden');
1074
+
1075
+ // Interface-specific styling
1076
+ if (currentScanner.connection === 'thunderbolt') {
1077
+ scannerPanel.classList.add('border-thunderbolt');
1078
+ } else if (currentScanner.connection === 'firewire') {
1079
+ scannerPanel.classList.add('border-firewire');
1080
+ } else if (currentScanner.connection === 'usb') {
1081
+ scannerPanel.classList.add('border-usb');
1082
+ } else if (currentScanner.connection === 'network') {
1083
+ scannerPanel.classList.add('border-network');
1084
+ }
1085
+
1086
+ statusMessage.textContent = `Connected to ${currentScanner.vendor} ${currentScanner.model}`;
1087
+ scannerDetails.classList.remove('hidden');
1088
+ updateUI();
1089
+ }, 1000);
1090
+ } else {
1091
+ statusMessage.textContent = 'Failed to connect to selected scanner';
1092
+ }
1093
+ }
1094
+
1095
+ function disconnectScanner() {
1096
+ statusMessage.textContent = 'Disconnecting...';
1097
+
1098
+ // Clear any ongoing scans
1099
+ clearInterval(timer);
1100
+ progressContainer.classList.add('hidden');
1101
+
1102
+ setTimeout(() => {
1103
+ isConnected = false;
1104
+ currentScanner = null;
1105
+ previewImage.src = '';
1106
+ previewImage.classList.add('hidden');
1107
+ placeholderText.classList.remove('hidden');
1108
+ connectionInfo.classList.add('hidden');
1109
+
1110
+ // Reset panel border
1111
+ scannerPanel.classList.remove('border-thunderbolt', 'border-firewire', 'border-usb', 'border-network');
1112
+
1113
+ statusMessage.textContent = 'Scanner disconnected';
1114
+ updateUI();
1115
+ }, 500);
1116
+ }
1117
+
1118
+ function startPreview() {
1119
+ if (!isConnected) return;
1120
+
1121
+ statusMessage.textContent = 'Creating preview scan...';
1122
+ scannerLight.style.opacity = '1';
1123
+
1124
+ // Simulate scan time based on resolution
1125
+ const resolution = document.getElementById('resolutionSelect').value;
1126
+ let delay = 1000;
1127
+
1128
+ if (resolution >= 4800) delay = 2500;
1129
+ else if (resolution >= 3200) delay = 2000;
1130
+ else if (resolution >= 1600) delay = 1500;
1131
+
1132
+ setTimeout(() => {
1133
+ previewImage.src = getRandomPreviewImage();
1134
+ previewImage.classList.remove('hidden');
1135
+ placeholderText.classList.add('hidden');
1136
+ scannerLight.style.opacity = '0';
1137
+ statusMessage.textContent = 'Preview completed';
1138
+ }, delay);
1139
+ }
1140
+
1141
+ function startScan() {
1142
+ if (!isConnected) return;
1143
+
1144
+ statusMessage.textContent = 'Starting full resolution scan...';
1145
+ scannerLight.style.opacity = '1';
1146
+ progressContainer.classList.remove('hidden');
1147
+ progressBar.style.width = '0%';
1148
+ progressPercent.textContent = '0%';
1149
+ scanningProgress = 0;
1150
+
1151
+ // Determine scan duration
1152
+ const resolution = document.getElementById('resolutionSelect').value;
1153
+ let totalSteps = 20;
1154
+ let stepDelay = 100;
1155
+
1156
+ if (resolution >= 4800) {
1157
+ totalSteps = 40;
1158
+ stepDelay = 150;
1159
+ } else if (resolution >= 3200) {
1160
+ totalSteps = 30;
1161
+ stepDelay = 120;
1162
+ } else if (resolution >= 1600) {
1163
+ totalSteps = 20;
1164
+ stepDelay = 100;
1165
+ } else {
1166
+ totalSteps = 10;
1167
+ stepDelay = 80;
1168
+ }
1169
+
1170
+ // Multipass scanning
1171
+ const multipassEnabled = multipassCheck.checked;
1172
+ const multipassCount = multipassEnabled ? parseInt(document.getElementById('multipassCount').value) : 1;
1173
+
1174
+ if (multipassEnabled) {
1175
+ statusMessage.textContent = `Starting multipass scan (${multipassCount}x passes)...`;
1176
+ totalSteps = totalSteps * multipassCount;
1177
+ }
1178
+
1179
+ // Start progress simulation
1180
+ clearInterval(timer);
1181
+ timer = setInterval(() => {
1182
+ scanningProgress += (100 / totalSteps);
1183
+
1184
+ if (scanningProgress >= 100) {
1185
+ scanningProgress = 100;
1186
+ clearInterval(timer);
1187
+
1188
+ progressBar.style.width = '100%';
1189
+ progressPercent.textContent = '100%';
1190
+ scannerLight.style.opacity = '0';
1191
+
1192
+ // Simulate saving image to memory
1193
+ setTimeout(() => {
1194
+ previewImage.src = getRandomPreviewImage();
1195
+ previewImage.classList.remove('hidden');
1196
+ placeholderText.classList.add('hidden');
1197
+ saveImageBtn.disabled = false;
1198
+
1199
+ if (multipassEnabled) {
1200
+ statusMessage.textContent = `Multipass scan completed (${multipassCount}x). Image ready`;
1201
+ } else {
1202
+ statusMessage.textContent = 'Scan completed. Image ready';
1203
+ }
1204
+ }, 500);
1205
+ } else {
1206
+ progressBar.style.width = `${scanningProgress}%`;
1207
+ progressPercent.textContent = `${Math.floor(scanningProgress)}%`;
1208
+ }
1209
+ }, stepDelay);
1210
+ }
1211
+
1212
+ function refreshScanners() {
1213
+ if (isConnected) {
1214
+ disconnectScanner();
1215
+ }
1216
+
1217
+ scannerLight.style.opacity = '1';
1218
+ setTimeout(() => {
1219
+ detectScanners();
1220
+ scannerLight.style.opacity = '0';
1221
+ }, 500);
1222
+ }
1223
+
1224
+ function toggleDevMode() {
1225
+ isDevMode = !isDevMode;
1226
+
1227
+ if (isConnected) {
1228
+ disconnectScanner();
1229
+ }
1230
+
1231
+ detectScanners();
1232
+ updateUI();
1233
+ }
1234
+
1235
+ function toggleHardwareStatus() {
1236
+ if (isDevMode) {
1237
+ alert('In Developer Mode, hardware status is simulated.\nSwitch to Live Mode for real hardware detection.');
1238
+ } else {
1239
+ alert('In Live Mode, the app will attempt to detect actual connected hardware.');
1240
+ }
1241
+ }
1242
+
1243
+ function showConnectionMethodModal() {
1244
+ connectionMethodModal.classList.remove('hidden');
1245
+ }
1246
+
1247
+ function hideConnectionMethodModal() {
1248
+ connectionMethodModal.classList.add('hidden');
1249
+ }
1250
+
1251
+ function saveConnectionPreferences() {
1252
+ connectionMethod = connectionPriority.value;
1253
+ hideConnectionMethodModal();
1254
+ refreshScanners();
1255
+ }
1256
+
1257
+ function updateConnectionPriority() {
1258
+ const selectedPriority = connectionPriority.value;
1259
+ console.log('Connection priority set to:', selectedPriority);
1260
+ }
1261
+
1262
+ function setStandardMode() {
1263
+ isExpertMode = false;
1264
+ updateUI();
1265
+ }
1266
+
1267
+ function setExpertMode() {
1268
+ isExpertMode = true;
1269
+ updateUI();
1270
+ }
1271
+
1272
+ function saveImage() {
1273
+ if (!previewImage.src) {
1274
+ alert('No scan result to save');
1275
+ return;
1276
+ }
1277
+
1278
+ // In a real app, this would trigger a file save dialog
1279
+ // Here we simulate it with a success message
1280
+ statusMessage.textContent = 'Image saved successfully';
1281
+ saveImageBtn.disabled = true;
1282
+ }
1283
+
1284
+ function resetSettings() {
1285
+ // Reset all sliders to defaults
1286
+ document.getElementById('brightnessSlider').value = 100;
1287
+ document.getElementById('brightnessValue').textContent = '100';
1288
+ document.getElementById('contrastSlider').value = 100;
1289
+ document.getElementById('contrastValue').textContent = '100';
1290
+ document.getElementById('sharpnessSlider').value = 50;
1291
+ document.getElementById('sharpnessValue').textContent = '50';
1292
+ document.getElementById('colorBalanceSlider').value = 0;
1293
+ document.getElementById('colorBalanceValue').textContent = '0';
1294
+ document.getElementById('saturationSlider').value = 0;
1295
+ document.getElementById('saturationValue').textContent = '0';
1296
+ document.getElementById('gradationSlider').value = 0;
1297
+ document.getElementById('gradationValue').textContent = '0';
1298
+ document.getElementById('densitySlider').value = 50;
1299
+ document.getElementById('densityValue').textContent = '50';
1300
+ document.getElementById('shadowSlider').value = 0;
1301
+ document.getElementById('shadowValue').textContent = '0';
1302
+
1303
+ if (isConnected) {
1304
+ statusMessage.textContent = 'Settings reset to defaults';
1305
+ }
1306
+ }
1307
+
1308
+ function toggleMultipassControls() {
1309
+ if (multipassCheck.checked) {
1310
+ multipassControls.classList.remove('hidden');
1311
+ } else {
1312
+ multipassControls.classList.add('hidden');
1313
+ }
1314
+ }
1315
+
1316
+ function updateSliderValue(e) {
1317
+ const sliderId = e.target.id;
1318
+ const valueElement = document.getElementById(sliderId.replace('Slider', 'Value'));
1319
+ valueElement.textContent = e.target.value;
1320
+ }
1321
+
1322
+ function getRandomPreviewImage() {
1323
+ // This would be a real image URL in a live app
1324
+ // For demonstration, we use placeholder images
1325
+ const randomImages = [
1326
+ 'https://source.unsplash.com/random/600x400/?photograph,film',
1327
+ 'https://source.unsplash.com/random/600x400/?document,scan',
1328
+ 'https://source.unsplash.com/random/600x400/?negative,film',
1329
+ 'https://source.unsplash.com/random/600x400/?photo,slide',
1330
+ 'https://source.unsplash.com/random/600x400/?picture,archive'
1331
+ ];
1332
+
1333
+ // Add a cache-busting parameter to force image reload
1334
+ return randomImages[Math.floor(Math.random() * randomImages.length)] + '&t=' + new Date().getTime();
1335
+ }
1336
+ </script>
1337
+ <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>
1338
  </html>
prompts.txt CHANGED
@@ -1 +1 @@
1
- remove Logo, rename into FlexiscanPro, set all settings to live mode and search for real connections
 
1
+ find errors and debug the site, set all settings to live mode and search for real connections (USB, Thunderbolt, Firewire, Network), Live Mode should change between Live and Developer Mode with fake data