File size: 26,580 Bytes
10aaf2c
 
 
 
 
b171689
10aaf2c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b9aef14
10aaf2c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b171689
10aaf2c
 
b171689
10aaf2c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b171689
 
10aaf2c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
<!DOCTYPE html>
<html lang="en" class="h-full">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>OCR Time Capsule</title>
    
    <!-- External Dependencies -->
    <script src="https://unpkg.com/[email protected]"></script>
    <script src="https://unpkg.com/[email protected]/dist/cdn.min.js" defer></script>
    <script src="https://cdn.tailwindcss.com"></script>
    
    <!-- Tailwind Config -->
    <script>
        tailwind.config = {
            darkMode: 'class',
            theme: {
                extend: {
                    animation: {
                        'fade-in': 'fadeIn 0.3s ease-in-out',
                    },
                    keyframes: {
                        fadeIn: {
                            '0%': { opacity: '0' },
                            '100%': { opacity: '1' },
                        }
                    }
                }
            }
        }
    </script>
    
    <!-- Custom Styles -->
    <link rel="stylesheet" href="css/styles.css">
</head>
<body class="h-full bg-gray-50 dark:bg-gray-900" x-data="ocrExplorer">
    <!-- Header -->
    <header class="bg-white dark:bg-gray-800 shadow-sm border-b border-gray-200 dark:border-gray-700">
        <div class="px-4 sm:px-6 lg:px-8 py-4">
            <div class="flex items-center justify-between">
                <div class="flex-1">
                    <div class="flex items-center space-x-4">
                        <h1 class="text-xl font-semibold text-gray-900 dark:text-white">
                            πŸ“¦ OCR Time Capsule
                        </h1>
                        <span class="text-sm text-gray-600 dark:text-gray-400 hidden sm:inline">
                            Compare original and AI-improved OCR text from historical documents
                        </span>
                    </div>
                    <div class="flex items-center space-x-2 mt-3">
                        <input 
                            type="text" 
                            x-model="datasetId"
                            @keyup.enter="loadDataset()"
                            class="px-3 py-1.5 text-sm border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-transparent dark:bg-gray-700 dark:border-gray-600 dark:text-white"
                            placeholder="Dataset ID (e.g., username/dataset-name)"
                            style="width: 300px;"
                        >
                        <button 
                            @click="loadDataset()"
                            class="px-4 py-1.5 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500"
                        >
                            Load
                        </button>
                    </div>
                </div>
                
                <!-- Settings -->
                <div class="flex items-center space-x-4">
                    <button
                        @click="showAbout = !showAbout"
                        class="px-3 py-1.5 text-sm text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-200"
                        title="About this tool"
                    >
                        <svg class="w-5 h-5 inline-block mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
                        </svg>
                        <span class="hidden sm:inline">About</span>
                    </button>
                    
                    <button
                        @click="darkMode = !darkMode"
                        class="p-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"
                        title="Toggle dark mode"
                    >
                        <svg x-show="!darkMode" class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"></path>
                        </svg>
                        <svg x-show="darkMode" class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"></path>
                        </svg>
                    </button>
                    
                    <select
                        x-model="diffMode"
                        class="px-3 py-1.5 text-sm border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white"
                    >
                        <option value="char">Character Diff</option>
                        <option value="word">Word Diff</option>
                        <option value="line">Line Diff</option>
                    </select>
                    
                    <button
                        @click="exportComparison()"
                        class="p-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"
                        title="Export comparison"
                    >
                        <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
                        </svg>
                    </button>
                </div>
            </div>
        </div>
    </header>
    
    <!-- About Panel -->
    <div x-show="showAbout" x-transition class="bg-blue-50 dark:bg-blue-950/30 border-b border-blue-200 dark:border-blue-800">
        <div class="px-4 sm:px-6 lg:px-8 py-6">
            <div class="max-w-4xl">
                <h2 class="text-lg font-semibold text-gray-900 dark:text-white mb-3">About OCR Time Capsule</h2>
                <div class="prose prose-sm dark:prose-invert text-gray-700 dark:text-gray-300">
                    <p class="mb-3">
                        OCR Time Capsule helps researchers and digital humanities professionals compare original OCR text 
                        with AI-improved versions from historical documents. This tool is designed for browsing pre-processed 
                        OCR improvements stored in HuggingFace datasets.
                    </p>
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
                        <div>
                            <h3 class="font-medium mb-2">🎯 Use Cases</h3>
                            <ul class="list-disc list-inside space-y-1 text-sm">
                                <li>Review OCR corrections from historical newspapers</li>
                                <li>Quality assessment of digitization projects</li>
                                <li>Training data validation for OCR models</li>
                                <li>Accessibility improvements for scanned texts</li>
                            </ul>
                        </div>
                        <div>
                            <h3 class="font-medium mb-2">⚑ Key Features</h3>
                            <ul class="list-disc list-inside space-y-1 text-sm">
                                <li>Side-by-side text comparison</li>
                                <li>Character, word, and line-level diffs</li>
                                <li>Keyboard navigation (J/K or arrows)</li>
                                <li>Direct HuggingFace dataset integration</li>
                            </ul>
                        </div>
                    </div>
                    <p class="text-sm">
                        πŸ’‘ <strong>Tip:</strong> For live OCR processing with vision-language models, check out 
                        <a href="https://huggingface.co/spaces/davanstrien/ocr-time-machine" class="text-blue-600 dark:text-blue-400 underline">OCR Time Machine</a>.
                        OCR Time Capsule focuses on exploring already-processed datasets for faster navigation and analysis.
                    </p>
                </div>
                <button 
                    @click="showAbout = false"
                    class="mt-4 text-sm text-blue-600 dark:text-blue-400 hover:underline"
                >
                    Close
                </button>
            </div>
        </div>
    </div>
    
    <!-- Main Content -->
    <main class="h-full flex">
        <!-- Loading State -->
        <div x-show="loading" class="flex-1 flex items-center justify-center">
            <div class="text-center">
                <div class="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"></div>
                <p class="mt-4 text-gray-600 dark:text-gray-400">Loading dataset...</p>
            </div>
        </div>
        
        <!-- Error State -->
        <div x-show="error" class="flex-1 flex items-center justify-center p-8">
            <div class="max-w-md w-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-6">
                <h3 class="text-lg font-medium text-red-800 dark:text-red-400 mb-2">Error</h3>
                <p class="text-red-600 dark:text-red-300" x-text="error"></p>
                <button 
                    @click="error = null; loadDataset()"
                    class="mt-4 px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700"
                >
                    Try Again
                </button>
            </div>
        </div>
        
        <!-- Content Area -->
        <div x-show="!loading && !error && currentSample" class="flex-1 flex h-full">
            <!-- Image Panel -->
            <div class="w-1/3 bg-gray-100 dark:bg-gray-800 p-4 overflow-hidden border-r border-gray-200 dark:border-gray-700">
                <div class="sticky top-0">
                    <div class="bg-white dark:bg-gray-700 rounded-lg shadow-sm overflow-hidden">
                        <img 
                            :src="getImageSrc()" 
                            :alt="`Page ${currentIndex + 1}`"
                            class="w-full h-auto"
                            @error="handleImageError"
                        >
                        <div class="p-3 border-t border-gray-200 dark:border-gray-600">
                            <p class="text-sm text-gray-600 dark:text-gray-400">
                                <span x-text="`Page ${currentIndex + 1} of ${totalSamples || '?'}`"></span>
                                <span x-show="getImageDimensions()" class="ml-2">
                                    β€’ <span x-text="getImageDimensions()"></span>
                                </span>
                            </p>
                        </div>
                    </div>
                    
                    <!-- Statistics Panel -->
                    <div class="mt-4 bg-white dark:bg-gray-700 rounded-lg shadow-sm p-4">
                        <h3 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-3">OCR Quality Metrics</h3>
                        <div class="space-y-2">
                            <div class="flex justify-between items-center">
                                <span class="text-xs text-gray-600 dark:text-gray-400">Similarity</span>
                                <span class="text-xs font-medium text-gray-900 dark:text-gray-100" x-text="`${similarity}%`"></span>
                            </div>
                            <div class="w-full bg-gray-200 dark:bg-gray-600 rounded-full h-2">
                                <div class="bg-blue-600 h-2 rounded-full transition-all duration-300" :style="`width: ${similarity}%`"></div>
                            </div>
                            
                            <div class="grid grid-cols-3 gap-2 mt-3">
                                <div class="text-center">
                                    <div class="text-lg font-semibold text-gray-900 dark:text-gray-100" x-text="charStats.total || '-'"></div>
                                    <div class="text-xs text-gray-600 dark:text-gray-400">Characters</div>
                                </div>
                                <div class="text-center">
                                    <div class="text-lg font-semibold text-green-600 dark:text-green-400" x-text="charStats.added || '0'"></div>
                                    <div class="text-xs text-gray-600 dark:text-gray-400">Added</div>
                                </div>
                                <div class="text-center">
                                    <div class="text-lg font-semibold text-red-600 dark:text-red-400" x-text="charStats.removed || '0'"></div>
                                    <div class="text-xs text-gray-600 dark:text-gray-400">Removed</div>
                                </div>
                            </div>
                            
                            <div class="mt-3 pt-3 border-t border-gray-200 dark:border-gray-600">
                                <div class="flex justify-between text-xs">
                                    <span class="text-gray-600 dark:text-gray-400">Words</span>
                                    <span class="text-gray-900 dark:text-gray-100">
                                        <span x-text="wordStats.original || '-'"></span> β†’ <span x-text="wordStats.improved || '-'"></span>
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- Text Comparison Panel -->
            <div class="flex-1 bg-white dark:bg-gray-900 overflow-hidden">
                <!-- Tab Navigation -->
                <div class="border-b border-gray-200 dark:border-gray-700">
                    <nav class="flex -mb-px">
                        <button
                            @click="activeTab = 'comparison'"
                            :class="activeTab === 'comparison' ? 'border-blue-500 text-blue-600 dark:text-blue-400' : 'border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200'"
                            class="px-6 py-3 border-b-2 font-medium text-sm transition-colors"
                        >
                            Side by Side
                        </button>
                        <button
                            @click="activeTab = 'diff'"
                            :class="activeTab === 'diff' ? 'border-blue-500 text-blue-600 dark:text-blue-400' : 'border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200'"
                            class="px-6 py-3 border-b-2 font-medium text-sm transition-colors"
                        >
                            Inline Diff
                        </button>
                        <button
                            @click="activeTab = 'improved'"
                            :class="activeTab === 'improved' ? 'border-blue-500 text-blue-600 dark:text-blue-400' : 'border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200'"
                            class="px-6 py-3 border-b-2 font-medium text-sm transition-colors"
                        >
                            Improved Only
                        </button>
                    </nav>
                </div>
                
                <!-- Tab Content -->
                <div class="p-6 overflow-y-auto" style="height: calc(100% - 49px);">
                    <!-- Side by Side Comparison -->
                    <div x-show="activeTab === 'comparison'" class="grid grid-cols-2 gap-6">
                        <div>
                            <h3 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-3">Original OCR</h3>
                            <div class="prose prose-sm dark:prose-invert max-w-none">
                                <pre class="whitespace-pre-wrap font-mono text-xs bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 p-4 rounded-lg" x-text="getOriginalText()"></pre>
                            </div>
                        </div>
                        <div>
                            <h3 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-3">Improved OCR</h3>
                            <div class="prose prose-sm dark:prose-invert max-w-none">
                                <pre class="whitespace-pre-wrap font-mono text-xs bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 p-4 rounded-lg" x-text="getImprovedText()"></pre>
                            </div>
                        </div>
                    </div>
                    
                    <!-- Inline Diff -->
                    <div x-show="activeTab === 'diff'" class="prose prose-sm dark:prose-invert max-w-none">
                        <div x-html="diffHtml" class="diff-content"></div>
                    </div>
                    
                    <!-- Improved Only -->
                    <div x-show="activeTab === 'improved'" class="prose prose-sm dark:prose-invert max-w-none">
                        <pre class="whitespace-pre-wrap font-mono text-xs bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 p-4 rounded-lg" x-text="getImprovedText()"></pre>
                    </div>
                </div>
            </div>
        </div>
    </main>
    
    <!-- Navigation Footer -->
    <footer x-show="!loading && !error && currentSample" class="fixed bottom-0 left-0 right-0">
        <!-- Enhanced Visual Page Browser -->
        <div x-show="showDock" 
             x-transition:enter="transition ease-out duration-300"
             x-transition:enter-start="transform translate-y-full opacity-0"
             x-transition:enter-end="transform translate-y-0 opacity-100"
             x-transition:leave="transition ease-in duration-200"
             x-transition:leave-start="transform translate-y-0 opacity-100"
             x-transition:leave-end="transform translate-y-full opacity-0"
             @mouseenter="showDockPreview()"
             @mouseleave="hideDockPreview()"
             class="bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 shadow-lg">
            <div class="relative px-16 py-4">
                <!-- Left scroll button -->
                <button @click="scrollDockLeft()"
                        :disabled="dockStartIndex <= 0"
                        class="absolute left-2 top-1/2 -translate-y-1/2 p-2 rounded-full bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed transition-all">
                    <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path>
                    </svg>
                </button>
                
                <!-- Thumbnails container -->
                <div class="flex items-center justify-center space-x-3 overflow-hidden">
                    <template x-for="item in dockItems" :key="item.index">
                        <div @click="jumpToDockPage(item.index)"
                             class="relative cursor-pointer transition-all duration-200 hover:scale-105 flex-shrink-0"
                             :class="item.index === currentIndex ? 'ring-2 ring-blue-500 scale-105' : ''">
                            <img :src="item.imageSrc" 
                                 :alt="`Page ${item.index + 1}`"
                                 class="w-32 h-44 object-cover rounded shadow-lg"
                                 @error="handleFlowImageError($event, item.index)">
                            <div class="absolute bottom-0 inset-x-0 bg-gradient-to-t from-black/80 to-transparent p-2 rounded-b">
                                <p class="text-sm text-white font-medium text-center" x-text="`${item.index + 1}`"></p>
                            </div>
                        </div>
                    </template>
                </div>
                
                <!-- Right scroll button -->
                <button @click="scrollDockRight()"
                        :disabled="dockStartIndex >= totalSamples - dockVisibleCount"
                        class="absolute right-2 top-1/2 -translate-y-1/2 p-2 rounded-full bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed transition-all">
                    <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
                    </svg>
                </button>
                
                <!-- Position indicator -->
                <div class="absolute bottom-1 left-1/2 -translate-x-1/2 flex items-center space-x-2">
                    <div class="w-32 h-1 bg-gray-200 dark:bg-gray-600 rounded-full overflow-hidden">
                        <div class="h-full bg-blue-500 transition-all duration-300"
                             :style="`width: ${((dockStartIndex + Math.floor(dockVisibleCount/2)) / (totalSamples - 1)) * 100}%`"></div>
                    </div>
                    <span class="text-xs text-gray-500 dark:text-gray-400" 
                          x-text="`${dockStartIndex + 1}-${Math.min(dockStartIndex + dockVisibleCount, totalSamples)} of ${totalSamples}`"></span>
                </div>
            </div>
        </div>
        
        <!-- Navigation controls -->
        <div class="bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 px-6 py-3">
            <div class="flex items-center justify-between">
            <div class="flex items-center space-x-4">
                <button 
                    @click="previousSample()"
                    :disabled="currentIndex <= 0"
                    class="px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-md hover:bg-gray-300 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed"
                >
                    ← Previous
                </button>
                
                <!-- Interactive Page Counter with Dock Trigger -->
                <div class="relative">
                    <div @mouseenter="showDockPreview()"
                         @mouseleave="hideDockPreview()"
                         class="flex items-center space-x-2 px-4 py-2 rounded-md cursor-pointer transition-all duration-200 hover:bg-gray-100 dark:hover:bg-gray-700">
                        <div class="flex items-center space-x-2">
                            <span class="text-sm font-medium text-gray-700 dark:text-gray-300">
                                Page <span x-text="currentIndex + 1"></span> of <span x-text="totalSamples || '?'"></span>
                            </span>
                            <svg class="w-4 h-4 text-gray-400 transition-transform duration-200"
                                 :class="showDock ? 'rotate-180' : ''"
                                 fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7"></path>
                            </svg>
                        </div>
                        <!-- Visual progress bar -->
                        <div class="w-32 h-1 bg-gray-200 dark:bg-gray-600 rounded-full overflow-hidden">
                            <div class="h-full bg-blue-500 transition-all duration-300"
                                 :style="`width: ${(currentIndex / (totalSamples - 1)) * 100}%`"></div>
                        </div>
                    </div>
                </div>
                
                <div class="flex items-center space-x-1">
                    <input 
                        type="number" 
                        x-model.number="jumpToPage"
                        @keyup.enter="jumpToSample()"
                        :min="1"
                        :max="totalSamples"
                        class="w-20 px-2 py-1 text-sm border border-gray-300 rounded focus:ring-2 focus:ring-blue-500 focus:border-transparent dark:bg-gray-700 dark:border-gray-600 dark:text-white"
                        placeholder="Go to"
                    >
                    <button 
                        @click="jumpToSample()"
                        class="px-2 py-1 text-sm bg-blue-600 text-white rounded hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500"
                    >
                        Go
                    </button>
                </div>
                
                <button 
                    @click="nextSample()"
                    :disabled="currentIndex >= (totalSamples - 1)"
                    class="px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-md hover:bg-gray-300 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed"
                >
                    Next β†’
                </button>
            </div>
            
            <div class="text-sm text-gray-500 dark:text-gray-400">
                Press <kbd class="px-2 py-1 bg-gray-100 dark:bg-gray-700 rounded">J</kbd> / <kbd class="px-2 py-1 bg-gray-100 dark:bg-gray-700 rounded">K</kbd> or <kbd class="px-2 py-1 bg-gray-100 dark:bg-gray-700 rounded">←</kbd> / <kbd class="px-2 py-1 bg-gray-100 dark:bg-gray-700 rounded">β†’</kbd> to navigate | <kbd class="px-2 py-1 bg-gray-100 dark:bg-gray-700 rounded">V</kbd> for visual browser
            </div>
        </div>
    </footer>
    
    <!-- Local Scripts -->
    <script src="js/diff-utils.js"></script>
    <script src="js/dataset-api.js"></script>
    <script src="js/app.js"></script>
</body>
</html>