Spaces:
Running

WDFluho commited on
Commit
279e484
·
verified ·
1 Parent(s): ed7b5b0

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +6 -4
  2. index.html +629 -19
  3. prompts.txt +2 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Flextight Control
3
- emoji: 👁
4
  colorFrom: red
5
- colorTo: pink
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: flextight-control
3
+ emoji: 🐳
4
  colorFrom: red
5
+ colorTo: purple
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,629 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="de">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Imacon Flextight X5 Scanner Control</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <script>
10
+ tailwind.config = {
11
+ theme: {
12
+ extend: {
13
+ colors: {
14
+ imacon: '#005293',
15
+ imaconlight: '#e6f0f8',
16
+ }
17
+ }
18
+ }
19
+ }
20
+ </script>
21
+ <style>
22
+ @keyframes scannerActive {
23
+ 0% { opacity: 0.5; }
24
+ 50% { opacity: 1; }
25
+ 100% { opacity: 0.5; }
26
+ }
27
+
28
+ .scanner-active {
29
+ animation: scannerActive 1.5s infinite;
30
+ }
31
+
32
+ .preview-container {
33
+ background-image: linear-gradient(45deg, #eee 25%, transparent 25%),
34
+ linear-gradient(-45deg, #eee 25%, transparent 25%),
35
+ linear-gradient(45deg, transparent 75%, #eee 75%),
36
+ linear-gradient(-45deg, transparent 75%, #eee 75%);
37
+ background-size: 20px 20px;
38
+ background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
39
+ }
40
+ </style>
41
+ </head>
42
+ <body class="bg-gray-100">
43
+ <div class="container mx-auto px-4 py-6 max-w-7xl">
44
+ <!-- Header -->
45
+ <header class="flex justify-between items-center mb-8">
46
+ <div class="flex items-center">
47
+ <img src="https://via.placeholder.com/50x50/005293/ffffff?text=IM" alt="Imacon Logo" class="mr-3 rounded">
48
+ <h1 class="text-2xl font-bold text-imacon">Flextight X5 Control</h1>
49
+ </div>
50
+ <div class="flex items-center space-x-4">
51
+ <div id="connectionStatus" class="flex items-center">
52
+ <span class="h-3 w-3 rounded-full bg-gray-500 mr-2"></span>
53
+ <span class="text-sm">Nicht verbunden</span>
54
+ </div>
55
+ <button id="refreshDevicesBtn" class="text-imacon hover:text-imacon/80">
56
+ <i class="fas fa-sync-alt text-xl"></i>
57
+ </button>
58
+ <button id="infoBtn" class="text-imacon hover:text-imacon/80">
59
+ <i class="fas fa-info-circle text-xl"></i>
60
+ </button>
61
+ </div>
62
+ </header>
63
+
64
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
65
+ <!-- Left Column - Scanner Control -->
66
+ <div class="bg-white p-6 rounded-lg shadow col-span-1">
67
+ <h2 class="text-xl font-semibold mb-4 text-imacon border-b pb-2">Scanner-Steuerung</h2>
68
+
69
+ <div class="mb-6">
70
+ <h3 class="font-medium mb-2">Scanner auswählen</h3>
71
+ <div class="flex mb-2">
72
+ <select id="scannerSelect" class="flex-1 p-2 border rounded-l focus:ring-2 focus:ring-imacon/50 focus:border-imacon">
73
+ <option value="">Scanner suchen...</option>
74
+ </select>
75
+ <button id="connectScannerBtn" class="bg-imacon text-white px-4 rounded-r hover:bg-imacon/90 transition">
76
+ Verbinden
77
+ </button>
78
+ </div>
79
+ <div id="scannerDetails" class="text-xs text-gray-500 hidden">
80
+ <div>Modell: <span id="scannerModel">-</span></div>
81
+ <div>Hersteller: <span id="scannerVendor">-</span></div>
82
+ <div>Typ: <span id="scannerType">-</span></div>
83
+ </div>
84
+ </div>
85
+
86
+ <div class="mb-6">
87
+ <h3 class="font-medium mb-2">Betriebsmodus</h3>
88
+ <div class="grid grid-cols-2 gap-2">
89
+ <button id="singleScanBtn" class="bg-imacon text-white py-2 px-4 rounded hover:bg-imacon/90 transition">
90
+ <i class="fas fa-image mr-2"></i>Einzelbild
91
+ </button>
92
+ <button id="batchScanBtn" class="bg-gray-200 text-gray-700 py-2 px-4 rounded hover:bg-gray-300 transition">
93
+ <i class="fas fa-images mr-2"></i>Stapelbetrieb
94
+ </button>
95
+ </div>
96
+ </div>
97
+
98
+ <div class="mb-6">
99
+ <h3 class="font-medium mb-2">Transparenzmodus</h3>
100
+ <div class="grid grid-cols-3 gap-2">
101
+ <button id="photoModeBtn" class="bg-imacon text-white py-2 px-3 rounded hover:bg-imacon/90 transition">
102
+ <i class="fas fa-sun mr-1"></i>Foto
103
+ </button>
104
+ <button id="slideModeBtn" class="bg-gray-200 text-gray-700 py-2 px-3 rounded hover:bg-gray-300 transition">
105
+ <i class="fas fa-expand mr-1"></i>Dia
106
+ </button>
107
+ <button id="negativeModeBtn" class="bg-gray-200 text-gray-700 py-2 px-3 rounded hover:bg-gray-300 transition">
108
+ <i class="fas fa-film mr-1"></i>Negativ
109
+ </button>
110
+ </div>
111
+ </div>
112
+
113
+ <div class="mb-6">
114
+ <h3 class="font-medium mb-2">Scan-Parameter</h3>
115
+ <div class="space-y-3">
116
+ <div>
117
+ <label class="block text-sm text-gray-600 mb-1">Auflösung (dpi)</label>
118
+ <select id="resolutionSelect" class="w-full p-2 border rounded focus:ring-2 focus:ring-imacon/50 focus:border-imacon">
119
+ <option>600</option>
120
+ <option selected>1200</option>
121
+ <option>2400</option>
122
+ <option>3200</option>
123
+ <option>4800</option>
124
+ <option>6300</option>
125
+ </select>
126
+ </div>
127
+
128
+ <div>
129
+ <label class="block text-sm text-gray-600 mb-1">Farbmodus</label>
130
+ <select id="colorModeSelect" class="w-full p-2 border rounded focus:ring-2 focus:ring-imacon/50 focus:border-imacon">
131
+ <option selected>RGB (24-bit)</option>
132
+ <option>RGB (48-bit)</option>
133
+ <option>Graustufen (16-bit)</option>
134
+ <option>Graustufen (8-bit)</option>
135
+ <option>S/W (1-bit)</option>
136
+ </select>
137
+ </div>
138
+
139
+ <div>
140
+ <label class="block text-sm text-gray-600 mb-1">Dateiformat</label>
141
+ <select id="formatSelect" class="w-full p-2 border rounded focus:ring-2 focus:ring-imacon/50 focus:border-imacon">
142
+ <option>TIFF (unkomprimiert)</option>
143
+ <option selected>TIFF (LZW)</option>
144
+ <option>JPEG</option>
145
+ <option>PNG</option>
146
+ <option>PSD</option>
147
+ </select>
148
+ </div>
149
+ </div>
150
+ </div>
151
+
152
+ <div class="mb-6">
153
+ <h3 class="font-medium mb-2">Bildkorrekturen</h3>
154
+ <div class="space-y-2">
155
+ <div class="flex items-center">
156
+ <input type="checkbox" id="dustRemoval" class="mr-2 h-4 w-4 text-imacon focus:ring-imacon">
157
+ <label for="dustRemoval">Staubentfernung (iSRD)</label>
158
+ </div>
159
+ <div class="flex items-center">
160
+ <input type="checkbox" id="colorRestoration" class="mr-2 h-4 w-4 text-imacon focus:ring-imacon">
161
+ <label for="colorRestoration">Farbwiederherstellung</label>
162
+ </div>
163
+ <div class="flex items-center">
164
+ <input type="checkbox" id="autoExposure" checked class="mr-2 h-4 w-4 text-imacon focus:ring-imacon">
165
+ <label for="autoExposure">Automatische Belichtung</label>
166
+ </div>
167
+ </div>
168
+ </div>
169
+
170
+ <div class="flex space-x-3">
171
+ <button id="scanBtn" class="flex-1 bg-green-600 hover:bg-green-700 text-white py-3 px-4 rounded-lg font-medium transition flex items-center justify-center" disabled>
172
+ <i class="fas fa-play mr-2"></i> Scan starten
173
+ </button>
174
+ <button id="previewBtn" class="flex-1 bg-imacon hover:bg-imacon/90 text-white py-3 px-4 rounded-lg font-medium transition flex items-center justify-center" disabled>
175
+ <i class="fas fa-eye mr-2"></i> Vorschau
176
+ </button>
177
+ </div>
178
+ </div>
179
+
180
+ <!-- Middle Column - Preview and Results -->
181
+ <div class="bg-white p-6 rounded-lg shadow col-span-2">
182
+ <div class="flex justify-between items-center mb-4">
183
+ <h2 class="text-xl font-semibold text-imacon border-b pb-2">Scan-Vorschau & Ergebnisse</h2>
184
+ <div class="flex space-x-2">
185
+ <button id="openFolderBtn" class="text-imacon hover:text-imacon/80">
186
+ <i class="fas fa-folder-open text-lg"></i>
187
+ </button>
188
+ <button id="downloadBtn" class="text-imacon hover:text-imacon/80">
189
+ <i class="fas fa-download text-lg"></i>
190
+ </button>
191
+ <button id="deleteBtn" class="text-imacon hover:text-imacon/80">
192
+ <i class="fas fa-trash-alt text-lg"></i>
193
+ </button>
194
+ </div>
195
+ </div>
196
+
197
+ <div id="scanInfo" class="hidden flex mb-4 items-center bg-gray-100 p-2 rounded">
198
+ <div class="flex items-center mr-4">
199
+ <i class="fas fa-info-circle text-imacon mr-2"></i>
200
+ <span id="scanModeInfo" class="text-sm">Einzelbildmodus • 35mm Foto • 1200dpi</span>
201
+ </div>
202
+ <div class="flex items-center">
203
+ <i class="fas fa-clock text-imacon mr-2"></i>
204
+ <span id="scanTimeInfo" class="text-sm">Geschätzte Zeit: 1m 15s</span>
205
+ </div>
206
+ </div>
207
+
208
+ <!-- Preview Area -->
209
+ <div class="preview-container mb-4 w-full h-96 bg-white rounded-lg border border-gray-300 flex items-center justify-center relative overflow-hidden">
210
+ <div id="scannerLight" class="absolute inset-0 bg-yellow-100 opacity-0 pointer-events-none"></div>
211
+ <img id="previewImage" src="" alt="Scan Preview" class="max-w-full max-h-full object-contain hidden">
212
+ <div id="placeholderText" class="text-gray-400 text-center p-4">
213
+ <i class="fas fa-image fa-3x mb-3"></i>
214
+ <p>Keine Vorschau verfügbar</p>
215
+ <p class="text-sm mt-2">Klicken Sie auf "Vorschau" oder "Scan starten"</p>
216
+ </div>
217
+ </div>
218
+
219
+ <!-- Status Bar -->
220
+ <div class="bg-gray-100 rounded-lg p-3 mb-4">
221
+ <div id="progressContainer" class="hidden">
222
+ <div class="flex justify-between text-sm mb-1">
223
+ <span>Scanfortschritt</span>
224
+ <span id="progressPercent">0%</span>
225
+ </div>
226
+ <div class="w-full bg-gray-300 rounded-full h-2.5">
227
+ <div id="progressBar" class="bg-imacon h-2.5 rounded-full" style="width: 0%"></div>
228
+ </div>
229
+ </div>
230
+ <div id="statusMessage" class="text-sm text-center py-2">
231
+ Kein Scanner verbunden
232
+ </div>
233
+ </div>
234
+
235
+ <!-- Image Thumbnails -->
236
+ <h3 class="font-medium mb-2">Gescannte Bilder</h3>
237
+ <div id="thumbnailContainer" class="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-2">
238
+ <!-- Thumbnails werden dynamisch eingefügt -->
239
+ </div>
240
+ </div>
241
+ </div>
242
+
243
+ <!-- Info Modal -->
244
+ <div id="infoModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50">
245
+ <div class="bg-white rounded-lg p-6 max-w-md w-full">
246
+ <h3 class="text-xl font-bold text-imacon mb-4">Scanner Informationen</h3>
247
+ <p class="mb-4">Diese Webanwendung ermöglicht die Steuerung eines Imacon Flextight X5 Scanners über eine lokale Verbindung.</p>
248
+ <p class="mb-4"><strong>Anforderungen:</strong></p>
249
+ <ul class="list-disc pl-5 mb-4 text-sm">
250
+ <li>Der Scanner muss über USB angeschlossen sein</li>
251
+ <li>Es muss ein SANE-Backend installiert sein (z.B. unter Linux)</li>
252
+ <li>Der Webserver muss lokalen Zugriff auf den Scanner haben</li>
253
+ </ul>
254
+ <div class="flex justify-end">
255
+ <button id="closeModalBtn" class="px-4 py-2 bg-imacon text-white rounded hover:bg-imacon/90">Schließen</button>
256
+ </div>
257
+ </div>
258
+ </div>
259
+
260
+ <script>
261
+ // Scanner-Simulation mit SANE-Integration
262
+ const scanBtn = document.getElementById('scanBtn');
263
+ const previewBtn = document.getElementById('previewBtn');
264
+ const scannerLight = document.getElementById('scannerLight');
265
+ const previewImage = document.getElementById('previewImage');
266
+ const placeholderText = document.getElementById('placeholderText');
267
+ const progressContainer = document.getElementById('progressContainer');
268
+ const progressBar = document.getElementById('progressBar');
269
+ const progressPercent = document.getElementById('progressPercent');
270
+ const statusMessage = document.getElementById('statusMessage');
271
+ const scanInfo = document.getElementById('scanInfo');
272
+ const scanModeInfo = document.getElementById('scanModeInfo');
273
+ const scanTimeInfo = document.getElementById('scanTimeInfo');
274
+ const singleScanBtn = document.getElementById('singleScanBtn');
275
+ const batchScanBtn = document.getElementById('batchScanBtn');
276
+ const photoModeBtn = document.getElementById('photoModeBtn');
277
+ const slideModeBtn = document.getElementById('slideModeBtn');
278
+ const negativeModeBtn = document.getElementById('negativeModeBtn');
279
+ const thumbnailContainer = document.getElementById('thumbnailContainer');
280
+ const scannerSelect = document.getElementById('scannerSelect');
281
+ const connectScannerBtn = document.getElementById('connectScannerBtn');
282
+ const scannerDetails = document.getElementById('scannerDetails');
283
+ const scannerModel = document.getElementById('scannerModel');
284
+ const scannerVendor = document.getElementById('scannerVendor');
285
+ const scannerType = document.getElementById('scannerType');
286
+ const connectionStatus = document.getElementById('connectionStatus');
287
+ const refreshDevicesBtn = document.getElementById('refreshDevicesBtn');
288
+ const infoBtn = document.getElementById('infoBtn');
289
+ const infoModal = document.getElementById('infoModal');
290
+ const closeModalBtn = document.getElementById('closeModalBtn');
291
+
292
+ // Zustandsvariablen
293
+ let isConnected = false;
294
+ let currentScanner = null;
295
+ let currentMode = 'single';
296
+ let currentScanMode = 'photo';
297
+ let scannedFiles = [];
298
+
299
+ // Event Listener
300
+ infoBtn.addEventListener('click', () => {
301
+ infoModal.classList.remove('hidden');
302
+ });
303
+
304
+ closeModalBtn.addEventListener('click', () => {
305
+ infoModal.classList.add('hidden');
306
+ });
307
+
308
+ refreshDevicesBtn.addEventListener('click', () => {
309
+ discoverScanners();
310
+ });
311
+
312
+ connectScannerBtn.addEventListener('click', () => {
313
+ const selectedScanner = scannerSelect.value;
314
+ if (selectedScanner) {
315
+ connectToScanner(selectedScanner);
316
+ } else {
317
+ statusMessage.textContent = "Bitte wählen Sie einen Scanner aus";
318
+ }
319
+ });
320
+
321
+ // Mode selection
322
+ singleScanBtn.addEventListener('click', () => {
323
+ setScanMode('single');
324
+ });
325
+
326
+ batchScanBtn.addEventListener('click', () => {
327
+ setScanMode('batch');
328
+ });
329
+
330
+ photoModeBtn.addEventListener('click', () => {
331
+ setScanOption('photo');
332
+ });
333
+
334
+ slideModeBtn.addEventListener('click', () => {
335
+ setScanOption('slide');
336
+ });
337
+
338
+ negativeModeBtn.addEventListener('click', () => {
339
+ setScanOption('negative');
340
+ });
341
+
342
+ // Preview button
343
+ previewBtn.addEventListener('click', () => {
344
+ if (!isConnected) {
345
+ statusMessage.textContent = "Bitte zuerst mit einem Scanner verbinden";
346
+ return;
347
+ }
348
+
349
+ statusMessage.textContent = "Erstelle Vorschau...";
350
+ scannerLight.classList.add('scanner-active');
351
+
352
+ // SANE-Aufruf für die Vorschau würde hier stattfinden
353
+ setTimeout(() => {
354
+ simulatePreview();
355
+ }, 1000);
356
+ });
357
+
358
+ // Scan button
359
+ scanBtn.addEventListener('click', () => {
360
+ if (!isConnected) {
361
+ statusMessage.textContent = "Bitte zuerst mit einem Scanner verbinden";
362
+ return;
363
+ }
364
+
365
+ startScan();
366
+ });
367
+
368
+ // Funktionen
369
+ function setScanMode(mode) {
370
+ currentMode = mode;
371
+
372
+ if (mode === 'single') {
373
+ singleScanBtn.classList.remove('bg-gray-200', 'text-gray-700');
374
+ singleScanBtn.classList.add('bg-imacon', 'text-white');
375
+ batchScanBtn.classList.remove('bg-imacon', 'text-white');
376
+ batchScanBtn.classList.add('bg-gray-200', 'text-gray-700');
377
+ } else {
378
+ batchScanBtn.classList.remove('bg-gray-200', 'text-gray-700');
379
+ batchScanBtn.classList.add('bg-imacon', 'text-white');
380
+ singleScanBtn.classList.remove('bg-imacon', 'text-white');
381
+ singleScanBtn.classList.add('bg-gray-200', 'text-gray-700');
382
+ }
383
+
384
+ updateScanInfo();
385
+ }
386
+
387
+ function setScanOption(mode) {
388
+ currentScanMode = mode;
389
+
390
+ photoModeBtn.classList.remove('bg-imacon', 'text-white');
391
+ photoModeBtn.classList.add('bg-gray-200', 'text-gray-700');
392
+ slideModeBtn.classList.remove('bg-imacon', 'text-white');
393
+ slideModeBtn.classList.add('bg-gray-200', 'text-gray-700');
394
+ negativeModeBtn.classList.remove('bg-imacon', 'text-white');
395
+ negativeModeBtn.classList.add('bg-gray-200', 'text-gray-700');
396
+
397
+ if (mode === 'photo') {
398
+ photoModeBtn.classList.remove('bg-gray-200', 'text-gray-700');
399
+ photoModeBtn.classList.add('bg-imacon', 'text-white');
400
+ } else if (mode === 'slide') {
401
+ slideModeBtn.classList.remove('bg-gray-200', 'text-gray-700');
402
+ slideModeBtn.classList.add('bg-imacon', 'text-white');
403
+ } else {
404
+ negativeModeBtn.classList.remove('bg-gray-200', 'text-gray-700');
405
+ negativeModeBtn.classList.add('bg-imacon', 'text-white');
406
+ }
407
+
408
+ updateScanInfo();
409
+ }
410
+
411
+ function updateScanInfo() {
412
+ const resolution = document.getElementById('resolutionSelect').value;
413
+ const colorMode = document.getElementById('colorModeSelect').value;
414
+
415
+ let modeText = currentMode === 'single' ? 'Einzelbildmodus' : 'Stapelbetrieb';
416
+ let typeText = '';
417
+
418
+ if (currentScanMode === 'photo') typeText = 'Foto';
419
+ else if (currentScanMode === 'slide') typeText = 'Dia';
420
+ else typeText = 'Negativ';
421
+
422
+ scanModeInfo.textContent = `${modeText} • ${typeText} • ${resolution}dpi • ${colorMode}`;
423
+ scanInfo.classList.remove('hidden');
424
+ }
425
+
426
+ function discoverScanners() {
427
+ statusMessage.textContent = "Suche nach Scannern...";
428
+
429
+ // In einer echten Anwendung würden wir hier die SANE-API aufrufen
430
+ // Für die Simulation geben wir einige Dummy-Scanner zurück
431
+ setTimeout(() => {
432
+ const dummyScanners = [
433
+ { name: 'imacon:libusb:001:003', model: 'Flextight X5', vendor: 'Imacon', type: 'Filmscanner' },
434
+ { name: 'epson:libusb:001:005', model: 'Perfection V850', vendor: 'Epson', type: 'Flachbettscanner' }
435
+ ];
436
+
437
+ // Nur Imacon Scanner für diese Demo behalten
438
+ const imaconScanners = dummyScanners.filter(s => s.vendor === 'Imacon');
439
+
440
+ populateScannerList(imaconScanners);
441
+
442
+ if (imaconScanners.length > 0) {
443
+ statusMessage.textContent = `${imaconScanners.length} Scanner gefunden`;
444
+ } else {
445
+ statusMessage.textContent = "Keine Imacon Scanner gefunden";
446
+ }
447
+ }, 1000);
448
+ }
449
+
450
+ function populateScannerList(scanners) {
451
+ scannerSelect.innerHTML = '<option value="">Scanner auswählen...</option>';
452
+
453
+ scanners.forEach(scanner => {
454
+ const option = document.createElement('option');
455
+ option.value = scanner.name;
456
+ option.textContent = `${scanner.vendor} ${scanner.model} (${scanner.type})`;
457
+ scannerSelect.appendChild(option);
458
+ });
459
+ }
460
+
461
+ function connectToScanner(scannerName) {
462
+ statusMessage.textContent = "Verbinde mit Scanner...";
463
+
464
+ // In einer echten Anwendung würden wir hier die SANE-API aufrufen
465
+ setTimeout(() => {
466
+ // Für die Demo nehmen wir an, es ist ein Imacon Flextight X5
467
+ currentScanner = {
468
+ name: scannerName,
469
+ model: 'Flextight X5',
470
+ vendor: 'Imacon',
471
+ type: 'Filmscanner'
472
+ };
473
+
474
+ isConnected = true;
475
+
476
+ // UI aktualisieren
477
+ scannerModel.textContent = currentScanner.model;
478
+ scannerVendor.textContent = currentScanner.vendor;
479
+ scannerType.textContent = currentScanner.type;
480
+ scannerDetails.classList.remove('hidden');
481
+
482
+ connectionStatus.innerHTML = '<span class="h-3 w-3 rounded-full bg-green-500 mr-2"></span><span class="text-sm">Verbunden</span>';
483
+
484
+ scanBtn.disabled = false;
485
+ previewBtn.disabled = false;
486
+
487
+ statusMessage.textContent = `${currentScanner.vendor} ${currentScanner.model} erfolgreich verbunden`;
488
+ updateScanInfo();
489
+
490
+ // Beispiel-Scans für die Demo
491
+ scannedFiles = [
492
+ { id: 1, name: 'scan_001.tiff', thumb: 'https://via.placeholder.com/150x100/005293/ffffff?text=Scan1' },
493
+ { id: 2, name: 'scan_002.tiff', thumb: 'https://via.placeholder.com/150x100/005293/ffffff?text=Scan2' }
494
+ ];
495
+
496
+ renderThumbnails();
497
+ }, 1500);
498
+ }
499
+
500
+ function simulatePreview() {
501
+ scannerLight.classList.remove('scanner-active');
502
+ placeholderText.classList.add('hidden');
503
+ previewImage.classList.remove('hidden');
504
+
505
+ // Unterschiedliche Vorschaubilder für verschiedene Modi
506
+ let previewUrl = '';
507
+ if (currentScanMode === 'photo') {
508
+ previewUrl = 'https://via.placeholder.com/800x800/e3f2fd/005293?text=Foto-Vorschau';
509
+ } else if (currentScanMode === 'slide') {
510
+ previewUrl = 'https://via.placeholder.com/800x800/fff8e1/005293?text=Dia-Vorschau';
511
+ } else {
512
+ previewUrl = 'https://via.placeholder.com/800x800/f5f5f5/005293?text=Negativ-Vorschau';
513
+ }
514
+
515
+ previewImage.src = previewUrl;
516
+ statusMessage.textContent = "Vorschau abgeschlossen";
517
+ }
518
+
519
+ function startScan() {
520
+ statusMessage.textContent = "Scanvorgang gestartet...";
521
+ progressContainer.classList.remove('hidden');
522
+ scannerLight.classList.add('scanner-active');
523
+ placeholderText.classList.add('hidden');
524
+
525
+ // Simulate scan progress
526
+ let progress = 0;
527
+ const interval = setInterval(() => {
528
+ progress += Math.floor(Math.random() * 5) + 1;
529
+ if (progress > 100) progress = 100;
530
+
531
+ progressBar.style.width = `${progress}%`;
532
+ progressPercent.textContent = `${progress}%`;
533
+
534
+ if (progress === 100) {
535
+ clearInterval(interval);
536
+ completeScan();
537
+ }
538
+ }, 200);
539
+ }
540
+
541
+ function completeScan() {
542
+ scannerLight.classList.remove('scanner-active');
543
+
544
+ // Scannen abschließen
545
+ const resolution = document.getElementById('resolutionSelect').value;
546
+ const colorMode = document.getElementById('colorModeSelect').value;
547
+
548
+ const newScanId = scannedFiles.length + 1;
549
+ const newScan = {
550
+ id: newScanId,
551
+ name: `scan_${String(newScanId).padStart(3, '0')}.tiff`,
552
+ thumb: `https://via.placeholder.com/150x100/005293/ffffff?text=Scan${newScanId}`,
553
+ full: 'https://via.placeholder.com/800x800/ffffff/005293?text=Beispiel-Scan'
554
+ };
555
+
556
+ scannedFiles.push(newScan);
557
+ renderThumbnails();
558
+
559
+ previewImage.src = newScan.full;
560
+ statusMessage.textContent = `Scan ${newScanId} erfolgreich abgeschlossen (${resolution}dpi, ${colorMode})`;
561
+
562
+ // In einer echten Anwendung würde die Datei hier gespeichert werden
563
+ console.log(`Scan ${newScanId} wurde gespeichert als ${newScan.name}`);
564
+ }
565
+
566
+ function renderThumbnails() {
567
+ thumbnailContainer.innerHTML = '';
568
+
569
+ scannedFiles.forEach(file => {
570
+ const thumbElement = document.createElement('div');
571
+ thumbElement.className = 'border rounded p-1 relative group';
572
+ thumbElement.innerHTML = `
573
+ <img src="${file.thumb}" alt="${file.name}" class="w-full h-auto">
574
+ <div class="absolute inset-0 bg-black/50 hidden group-hover:flex items-center justify-center space-x-1">
575
+ <button class="text-white hover:text-imaconlight" onclick="viewScan(${file.id})">
576
+ <i class="fas fa-search-plus"></i>
577
+ </button>
578
+ <button class="text-white hover:text-imaconlight" onclick="downloadScan(${file.id})">
579
+ <i class="fas fa-download"></i>
580
+ </button>
581
+ <button class="text-white hover:text-imaconlight" onclick="deleteScan(${file.id})">
582
+ <i class="fas fa-trash"></i>
583
+ </button>
584
+ </div>
585
+ `;
586
+ thumbnailContainer.appendChild(thumbElement);
587
+ });
588
+ }
589
+
590
+ // Globale Funktionen für die Thumbnail-Aktionen
591
+ window.viewScan = function(id) {
592
+ const scan = scannedFiles.find(f => f.id === id);
593
+ if (scan) {
594
+ previewImage.src = scan.full;
595
+ previewImage.classList.remove('hidden');
596
+ placeholderText.classList.add('hidden');
597
+ statusMessage.textContent = `Viewing: ${scan.name}`;
598
+ }
599
+ };
600
+
601
+ window.downloadScan = function(id) {
602
+ const scan = scannedFiles.find(f => f.id === id);
603
+ if (scan) {
604
+ statusMessage.textContent = `Download gestartet: ${scan.name}`;
605
+ // In einer echten App würden wir den Download hier initiieren
606
+ console.log(`Downloading ${scan.name}`);
607
+ }
608
+ };
609
+
610
+ window.deleteScan = function(id) {
611
+ scannedFiles = scannedFiles.filter(f => f.id !== id);
612
+ renderThumbnails();
613
+
614
+ if (scannedFiles.length === 0) {
615
+ previewImage.classList.add('hidden');
616
+ placeholderText.classList.remove('hidden');
617
+ }
618
+
619
+ statusMessage.textContent = `Scan ${id} wurde gelöscht`;
620
+ };
621
+
622
+ // Initialisierung
623
+ discoverScanners();
624
+ setScanMode('single');
625
+ setScanOption('photo');
626
+ </script>
627
+ </div>
628
+ <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-control" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
629
+ </html>
prompts.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ erstelle ein Webinterface zur Ansteuerung eines Imacon Flextight X5 Scanners
2
+ debugge die Seite, sie soll lokal mit einem per USB angeschlossenen Scanner funktionieren