Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
586 lines (549 loc) · 33.9 KB
/
Copy pathindex.html
File metadata and controls
586 lines (549 loc) · 33.9 KB
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
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
<!DOCTYPE html>
<html lang="es" data-theme="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="CompressKit — Compresor profesional de imágenes, vídeo, audio y PDF. 100% en tu navegador, sin servidores.">
<title>CompressKit — Compresor Multimedia en el Navegador</title>
<!-- COOP/COEP for SharedArrayBuffer (inline meta fallback) -->
<meta http-equiv="Cross-Origin-Opener-Policy" content="same-origin">
<meta http-equiv="Cross-Origin-Embedder-Policy" content="require-corp">
<!-- Styles -->
<link rel="stylesheet" href="css/themes.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/components.css">
<!-- Favicon -->
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>📦</text></svg>">
</head>
<body>
<div class="app-wrapper">
<!-- ═══════════ HEADER ═══════════ -->
<header class="app-header" role="banner">
<div class="app-header__brand">
<svg class="app-header__logo" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<rect width="36" height="36" rx="8" fill="url(#logo-grad)"/>
<path d="M10 18h16M18 10v16M13 13l10 10M23 13l-10 10" stroke="#fff" stroke-width="2" stroke-linecap="round" opacity="0.9"/>
<defs><linearGradient id="logo-grad" x1="0" y1="0" x2="36" y2="36"><stop stop-color="#3b82f6"/><stop offset="1" stop-color="#8b5cf6"/></linearGradient></defs>
</svg>
<h1 class="app-header__title">CompressKit</h1>
</div>
<div class="app-header__actions">
<!-- History button -->
<button class="btn btn--ghost btn--icon" id="btnHistory" title="Historial de compresiones" aria-label="Historial de compresiones">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
</button>
<!-- Settings / Import-Export -->
<button class="btn btn--ghost btn--icon" id="btnSettings" title="Configuración y presets" aria-label="Configuración">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 01-2.83 2.83l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"/></svg>
</button>
<!-- Keyboard shortcuts help -->
<button class="btn btn--ghost btn--icon" id="btnShortcuts" title="Atajos de teclado" aria-label="Atajos de teclado">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="4" width="20" height="16" rx="2"/><line x1="6" y1="8" x2="6" y2="8"/><line x1="10" y1="8" x2="10" y2="8"/><line x1="14" y1="8" x2="14" y2="8"/><line x1="18" y1="8" x2="18" y2="8"/><line x1="8" y1="12" x2="16" y2="12"/><line x1="6" y1="16" x2="18" y2="16"/></svg>
</button>
<!-- Theme toggle -->
<button class="theme-toggle" id="themeToggle" title="Cambiar tema" aria-label="Cambiar tema claro/oscuro" role="switch" aria-checked="false">
<div class="theme-toggle__knob">
<svg class="icon-moon" viewBox="0 0 24 24" fill="currentColor"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg>
<svg class="icon-sun" viewBox="0 0 24 24" fill="currentColor" style="display:none"><circle cx="12" cy="12" r="5"/><path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"/></svg>
</div>
</button>
</div>
</header>
<!-- ═══════════ MAIN ═══════════ -->
<main class="app-main" role="main">
<!-- Privacy Banner -->
<div class="privacy-banner" role="status">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0110 0v4"/></svg>
Todo el procesamiento ocurre en tu dispositivo. Tus archivos nunca salen de tu navegador.
</div>
<!-- Type Tabs -->
<nav class="tab-nav" role="tablist" aria-label="Tipo de archivo">
<button class="tab-btn active" role="tab" aria-selected="true" aria-controls="panel-image" id="tab-image" data-type="image">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>
<span>Imagen</span>
</button>
<button class="tab-btn" role="tab" aria-selected="false" aria-controls="panel-video" id="tab-video" data-type="video">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="23 7 16 12 23 17 23 7"/><rect x="1" y="5" width="15" height="14" rx="2" ry="2"/></svg>
<span>Vídeo</span>
</button>
<button class="tab-btn" role="tab" aria-selected="false" aria-controls="panel-audio" id="tab-audio" data-type="audio">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>
<span>Audio</span>
</button>
<button class="tab-btn" role="tab" aria-selected="false" aria-controls="panel-pdf" id="tab-pdf" data-type="pdf">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>
<span>PDF</span>
</button>
</nav>
<!-- Workspace Grid -->
<div class="workspace">
<div class="workspace__main">
<!-- ═══ DROPZONE ═══ -->
<div class="dropzone" id="dropzone" role="button" tabindex="0" aria-label="Arrastra archivos aquí o haz clic para seleccionar">
<svg class="dropzone__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/>
<polyline points="17 8 12 3 7 8"/>
<line x1="12" y1="3" x2="12" y2="15"/>
</svg>
<p class="dropzone__text">Arrastra tus archivos aquí o <strong>haz clic para seleccionar</strong></p>
<p class="dropzone__hint" id="dropzoneHint">JPG, PNG, WebP, GIF, AVIF, MP4, MKV, MOV, AVI, WebM, MP3, WAV, OGG, AAC, FLAC, PDF</p>
<input type="file" id="fileInput" multiple aria-label="Seleccionar archivos" accept="image/*,video/*,audio/*,.pdf,.mkv,.flac,.ogg,.webm,.avif">
</div>
<!-- ═══ BATCH FILE LIST ═══ -->
<div id="fileListContainer" class="card card--no-hover" style="display:none">
<div class="card__header">
<h2 class="card__title">Archivos en cola</h2>
<div style="display:flex;gap:8px;flex-wrap:wrap">
<button class="btn btn--sm btn--secondary" id="btnApplyAll" title="Aplicar misma configuración a archivos del mismo tipo">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14"><polyline points="17 1 21 5 17 9"/><path d="M3 11V9a4 4 0 014-4h14"/></svg>
Aplicar a todos
</button>
<button class="btn btn--sm btn--primary" id="btnCompressAll">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14"><polyline points="16 16 12 12 8 16"/><line x1="12" y1="12" x2="12" y2="21"/><path d="M20.39 18.39A5 5 0 0018 9h-1.26A8 8 0 103 16.3"/></svg>
Comprimir todos
</button>
<button class="btn btn--sm btn--success" id="btnDownloadZip" style="display:none">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
Descargar ZIP
</button>
</div>
</div>
<div class="file-list" id="fileList" role="list"></div>
</div>
<!-- ═══ COMPARISON PANELS (one per type, toggled) ═══ -->
<!-- IMAGE COMPARATOR -->
<div id="imageComparator" class="card card--no-hover" style="display:none">
<div class="card__header">
<h2 class="card__title">Comparación</h2>
<button class="btn btn--sm btn--ghost" id="btnCopyClipboard" title="Copiar imagen al portapapeles">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/></svg>
Copiar
</button>
</div>
<div class="comparator" id="comparator" title="Doble clic para pantalla completa">
<img class="comparator__img comparator__img--before" id="imgBefore" alt="Imagen original">
<img class="comparator__img comparator__img--after" id="imgAfter" alt="Imagen comprimida">
<div class="comparator__divider" id="comparatorDivider"></div>
<span class="comparator__label comparator__label--before">Original</span>
<span class="comparator__label comparator__label--after">Comprimido</span>
</div>
</div>
<!-- VIDEO COMPARATOR -->
<div id="videoComparator" class="card card--no-hover" style="display:none">
<div class="card__header">
<h2 class="card__title">Comparación de vídeo</h2>
</div>
<div class="video-compare">
<div class="video-compare__panel">
<video id="videoOriginal" controls preload="metadata"></video>
<span class="video-compare__label">Original</span>
</div>
<div class="video-compare__panel">
<video id="videoCompressed" controls preload="metadata"></video>
<span class="video-compare__label">Comprimido</span>
</div>
</div>
</div>
<!-- AUDIO COMPARATOR -->
<div id="audioComparator" class="card card--no-hover" style="display:none">
<div class="card__header">
<h2 class="card__title">Comparación de audio</h2>
</div>
<div class="waveform-compare">
<div class="waveform-compare__panel">
<div class="waveform-compare__player" id="waveOriginal"></div>
<span class="waveform-compare__label">Original</span>
</div>
<div class="waveform-compare__panel">
<div class="waveform-compare__player" id="waveCompressed"></div>
<span class="waveform-compare__label">Comprimido</span>
</div>
</div>
</div>
<!-- PDF COMPARATOR -->
<div id="pdfComparator" class="card card--no-hover" style="display:none">
<div class="card__header">
<h2 class="card__title">Comparación de PDF</h2>
<div style="display:flex;gap:8px;align-items:center">
<button class="btn btn--sm btn--ghost" id="btnPdfPrev" aria-label="Página anterior">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14"><polyline points="15 18 9 12 15 6"/></svg>
</button>
<span id="pdfPageInfo" style="font-size:0.8rem;color:var(--text-secondary)">1 / 1</span>
<button class="btn btn--sm btn--ghost" id="btnPdfNext" aria-label="Página siguiente">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14"><polyline points="9 18 15 12 9 6"/></svg>
</button>
</div>
</div>
<div class="pdf-compare">
<div class="pdf-compare__panel">
<canvas class="pdf-compare__canvas" id="pdfCanvasOriginal"></canvas>
<span class="pdf-compare__label">Original</span>
</div>
<div class="pdf-compare__panel">
<canvas class="pdf-compare__canvas" id="pdfCanvasCompressed"></canvas>
<span class="pdf-compare__label">Comprimido</span>
</div>
</div>
</div>
</div>
<!-- ═══ SIDEBAR ═══ -->
<aside class="workspace__sidebar">
<!-- Controls Panel (dynamic per tab) -->
<div class="card card--no-hover" id="controlsCard">
<div class="card__header">
<h2 class="card__title">Configuración</h2>
</div>
<!-- IMAGE CONTROLS -->
<div id="imageControls" class="controls-panel tab-panel active">
<div class="range-group">
<div class="range-header">
<label class="range-label" for="imgQuality">Calidad</label>
<span class="range-value" id="imgQualityValue">80</span>
</div>
<input type="range" id="imgQuality" min="1" max="100" value="80" aria-label="Calidad de imagen">
</div>
<div class="form-group">
<label class="form-label" for="imgFormat">Formato de salida</label>
<select class="form-select" id="imgFormat">
<option value="jpeg">JPEG</option>
<option value="webp">WebP</option>
<option value="png">PNG</option>
<option value="avif">AVIF</option>
</select>
</div>
<div class="form-group">
<label class="form-label" for="imgMaxWidth">Ancho máximo (px)</label>
<input type="number" class="form-input" id="imgMaxWidth" placeholder="Sin límite" min="1">
</div>
<div class="form-group">
<label class="form-label" for="imgMaxHeight">Alto máximo (px)</label>
<input type="number" class="form-input" id="imgMaxHeight" placeholder="Sin límite" min="1">
</div>
<label class="checkbox-group">
<input type="checkbox" id="imgStripExif" checked>
Eliminar metadatos EXIF
</label>
<div class="form-group">
<label class="form-label" for="imgTargetSize">Tamaño objetivo (KB)</label>
<input type="number" class="form-input" id="imgTargetSize" placeholder="Ej: 500" min="1">
</div>
</div>
<!-- VIDEO CONTROLS -->
<div id="videoControls" class="controls-panel tab-panel">
<div class="form-group">
<label class="form-label" for="vidCodec">Codec</label>
<select class="form-select" id="vidCodec">
<option value="libx264">H.264</option>
<option value="libx265">H.265 / HEVC</option>
<option value="libvpx-vp9">VP9 (WebM)</option>
</select>
</div>
<div class="form-group">
<label class="form-label" for="vidMethod">Método de compresión</label>
<select class="form-select" id="vidMethod">
<option value="crf">CRF (calidad constante)</option>
<option value="bitrate">Bitrate objetivo</option>
<option value="size">Tamaño objetivo</option>
</select>
</div>
<div class="range-group" id="vidCrfGroup">
<div class="range-header">
<label class="range-label" for="vidCrf">CRF</label>
<span class="range-value" id="vidCrfValue">23</span>
</div>
<input type="range" id="vidCrf" min="0" max="51" value="23" aria-label="CRF">
</div>
<div class="form-group" id="vidBitrateGroup" style="display:none">
<label class="form-label" for="vidBitrate">Bitrate (kbps)</label>
<input type="number" class="form-input" id="vidBitrate" value="2000" min="100">
</div>
<div class="form-group" id="vidTargetSizeGroup" style="display:none">
<label class="form-label" for="vidTargetSize">Tamaño máximo (MB)</label>
<input type="number" class="form-input" id="vidTargetSize" placeholder="Ej: 25" min="1">
</div>
<div class="form-group">
<label class="form-label" for="vidResolution">Resolución</label>
<select class="form-select" id="vidResolution">
<option value="original">Original</option>
<option value="1080">1080p</option>
<option value="720">720p</option>
<option value="480">480p</option>
</select>
</div>
<div class="form-group">
<label class="form-label" for="vidFps">FPS</label>
<select class="form-select" id="vidFps">
<option value="original">Original</option>
<option value="60">60</option>
<option value="30">30</option>
<option value="24">24</option>
</select>
</div>
<div class="form-group">
<label class="form-label" for="vidAudioBitrate">Bitrate de audio</label>
<select class="form-select" id="vidAudioBitrate">
<option value="192">192 kbps</option>
<option value="128" selected>128 kbps</option>
<option value="64">64 kbps</option>
</select>
</div>
</div>
<!-- AUDIO CONTROLS -->
<div id="audioControls" class="controls-panel tab-panel">
<div class="form-group">
<label class="form-label" for="audFormat">Formato de salida</label>
<select class="form-select" id="audFormat">
<option value="mp3">MP3</option>
<option value="ogg">OGG</option>
<option value="aac">AAC</option>
</select>
</div>
<div class="form-group">
<label class="form-label" for="audBitrate">Bitrate</label>
<select class="form-select" id="audBitrate">
<option value="320">320 kbps</option>
<option value="192">192 kbps</option>
<option value="128" selected>128 kbps</option>
<option value="64">64 kbps</option>
</select>
</div>
<label class="checkbox-group">
<input type="checkbox" id="audNormalize">
Normalizar volumen
</label>
<div class="form-group">
<label class="form-label" for="audTargetSize">Tamaño objetivo (KB)</label>
<input type="number" class="form-input" id="audTargetSize" placeholder="Ej: 5000" min="1">
</div>
</div>
<!-- PDF CONTROLS -->
<div id="pdfControls" class="controls-panel tab-panel">
<div class="form-group">
<label class="form-label" for="pdfImageQuality">Compresión de imágenes internas</label>
<select class="form-select" id="pdfImageQuality">
<option value="low">Baja (mejor calidad)</option>
<option value="medium" selected>Media</option>
<option value="high">Alta</option>
<option value="max">Máxima compresión</option>
</select>
</div>
<label class="checkbox-group">
<input type="checkbox" id="pdfStripMeta" checked>
Eliminar metadatos del documento
</label>
<label class="checkbox-group">
<input type="checkbox" id="pdfStripFonts">
Eliminar fuentes no usadas
</label>
<label class="checkbox-group">
<input type="checkbox" id="pdfConvertWebp">
Convertir imágenes a WebP
</label>
</div>
</div>
<!-- Presets -->
<div class="card card--no-hover">
<div class="card__header">
<h2 class="card__title">Presets</h2>
<button class="btn btn--sm btn--ghost" id="btnSavePreset" title="Guardar preset actual">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14"><path d="M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg>
Guardar
</button>
</div>
<div class="preset-chips" id="presetChips">
<button class="preset-chip" data-preset="whatsapp">📱 WhatsApp (<1 MB)</button>
<button class="preset-chip" data-preset="email">✉️ Email (<5 MB)</button>
<button class="preset-chip" data-preset="web">🌐 Formulario (<500 KB)</button>
<button class="preset-chip" data-preset="maxquality">✨ Máxima calidad</button>
</div>
</div>
<!-- Stats Panel -->
<div class="card card--no-hover" id="statsCard" style="display:none">
<div class="card__header">
<h2 class="card__title">Estadísticas</h2>
</div>
<div class="stats-grid" id="statsGrid">
<div class="stat-item">
<span class="stat-item__label">Original</span>
<span class="stat-item__value" id="statOrigSize">—</span>
</div>
<div class="stat-item">
<span class="stat-item__label">Comprimido</span>
<span class="stat-item__value" id="statCompSize">—</span>
</div>
<div class="stat-item">
<span class="stat-item__label">Reducción</span>
<span class="stat-item__value" id="statReduction">—</span>
</div>
<div class="stat-item">
<span class="stat-item__label">Tiempo</span>
<span class="stat-item__value" id="statTime">—</span>
</div>
<div class="stat-item" id="statDimensionsItem" style="display:none">
<span class="stat-item__label">Dimensiones</span>
<span class="stat-item__value" id="statDimensions">—</span>
</div>
<div class="stat-item" id="statDurationItem" style="display:none">
<span class="stat-item__label">Duración</span>
<span class="stat-item__value" id="statDuration">—</span>
</div>
<div class="stat-item" id="statCodecItem" style="display:none">
<span class="stat-item__label">Codec</span>
<span class="stat-item__value" id="statCodec">—</span>
</div>
</div>
<div style="margin-top:var(--sp-3)">
<div class="progress" id="reductionProgress">
<div class="progress__bar progress__bar--green" id="reductionBar" style="width:0%"></div>
</div>
</div>
<div style="margin-top:var(--sp-4);display:flex;gap:8px;flex-wrap:wrap">
<button class="btn btn--sm btn--success" id="btnDownloadSingle" style="display:none">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
Descargar
</button>
</div>
</div>
<!-- Compress button (single) -->
<button class="btn btn--primary btn--lg" id="btnCompress" style="width:100%;display:none">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"><polyline points="16 16 12 12 8 16"/><line x1="12" y1="12" x2="12" y2="21"/><path d="M20.39 18.39A5 5 0 0018 9h-1.26A8 8 0 103 16.3"/></svg>
Comprimir
</button>
</aside>
</div>
</main>
<!-- ═══════════ FOOTER ═══════════ -->
<footer class="app-footer" role="contentinfo">
<p>CompressKit — Compresión multimedia 100% en tu navegador. Sin servidores, sin registro, sin límites.</p>
</footer>
</div>
<!-- ═══════════ MODALS ═══════════ -->
<!-- Fullscreen Comparator Modal -->
<div class="modal-overlay" id="modalFullscreen" role="dialog" aria-modal="true" aria-label="Comparador a pantalla completa">
<div class="modal modal--fullscreen">
<div class="modal__header">
<h2 class="modal__title">Comparador</h2>
<button class="modal__close" id="btnCloseFullscreen" aria-label="Cerrar">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
</button>
</div>
<div class="comparator" id="comparatorFullscreen" style="aspect-ratio:auto;height:calc(100vh - 100px)">
<img class="comparator__img comparator__img--before" id="imgBeforeFS" alt="Original">
<img class="comparator__img comparator__img--after" id="imgAfterFS" alt="Comprimida">
<div class="comparator__divider" id="comparatorDividerFS"></div>
<span class="comparator__label comparator__label--before">Original</span>
<span class="comparator__label comparator__label--after">Comprimido</span>
</div>
</div>
</div>
<!-- History Modal -->
<div class="modal-overlay" id="modalHistory" role="dialog" aria-modal="true" aria-label="Historial de compresiones">
<div class="modal">
<div class="modal__header">
<h2 class="modal__title">Historial de compresiones</h2>
<button class="modal__close" id="btnCloseHistory" aria-label="Cerrar">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
</button>
</div>
<div class="history-list" id="historyList">
<p style="color:var(--text-tertiary);font-size:0.85rem;text-align:center;padding:var(--sp-6)">No hay compresiones recientes.</p>
</div>
</div>
</div>
<!-- Settings Modal -->
<div class="modal-overlay" id="modalSettings" role="dialog" aria-modal="true" aria-label="Configuración">
<div class="modal">
<div class="modal__header">
<h2 class="modal__title">Configuración</h2>
<button class="modal__close" id="btnCloseSettings" aria-label="Cerrar">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
</button>
</div>
<div style="display:flex;flex-direction:column;gap:var(--sp-4)">
<button class="btn btn--secondary" id="btnExportConfig" style="width:100%">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
Exportar configuración (JSON)
</button>
<label class="btn btn--secondary" style="width:100%;cursor:pointer">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>
Importar configuración (JSON)
<input type="file" id="importConfigInput" accept=".json" style="display:none">
</label>
<hr style="border:none;border-top:1px solid var(--border-primary)">
<div>
<h3 class="section-title">Presets personalizados</h3>
<div id="customPresetsList" style="display:flex;flex-direction:column;gap:8px;margin-top:8px">
<p style="color:var(--text-tertiary);font-size:0.82rem">No hay presets personalizados.</p>
</div>
</div>
</div>
</div>
</div>
<!-- Shortcuts Modal -->
<div class="modal-overlay" id="modalShortcuts" role="dialog" aria-modal="true" aria-label="Atajos de teclado">
<div class="modal">
<div class="modal__header">
<h2 class="modal__title">Atajos de teclado</h2>
<button class="modal__close" id="btnCloseShortcuts" aria-label="Cerrar">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
</button>
</div>
<div style="display:flex;flex-direction:column;gap:var(--sp-3)">
<div style="display:flex;justify-content:space-between;align-items:center">
<span style="font-size:0.85rem;color:var(--text-secondary)">Abrir selector de archivos</span>
<kbd style="padding:2px 8px;background:var(--bg-input);border:1px solid var(--border-secondary);border-radius:4px;font-size:0.75rem;font-family:var(--font-mono)">Ctrl+O</kbd>
</div>
<div style="display:flex;justify-content:space-between;align-items:center">
<span style="font-size:0.85rem;color:var(--text-secondary)">Comprimir todos</span>
<kbd style="padding:2px 8px;background:var(--bg-input);border:1px solid var(--border-secondary);border-radius:4px;font-size:0.75rem;font-family:var(--font-mono)">Ctrl+Enter</kbd>
</div>
<div style="display:flex;justify-content:space-between;align-items:center">
<span style="font-size:0.85rem;color:var(--text-secondary)">Descargar archivo seleccionado</span>
<kbd style="padding:2px 8px;background:var(--bg-input);border:1px solid var(--border-secondary);border-radius:4px;font-size:0.75rem;font-family:var(--font-mono)">Ctrl+S</kbd>
</div>
<div style="display:flex;justify-content:space-between;align-items:center">
<span style="font-size:0.85rem;color:var(--text-secondary)">Cerrar modal</span>
<kbd style="padding:2px 8px;background:var(--bg-input);border:1px solid var(--border-secondary);border-radius:4px;font-size:0.75rem;font-family:var(--font-mono)">Escape</kbd>
</div>
</div>
</div>
</div>
<!-- Save Preset Modal -->
<div class="modal-overlay" id="modalSavePreset" role="dialog" aria-modal="true" aria-label="Guardar preset">
<div class="modal">
<div class="modal__header">
<h2 class="modal__title">Guardar preset</h2>
<button class="modal__close" id="btnCloseSavePreset" aria-label="Cerrar">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
</button>
</div>
<div class="form-group" style="margin-bottom:var(--sp-4)">
<label class="form-label" for="presetName">Nombre del preset</label>
<input type="text" class="form-input" id="presetName" placeholder="Mi preset personalizado">
</div>
<button class="btn btn--primary" id="btnConfirmSavePreset" style="width:100%">Guardar</button>
</div>
</div>
<!-- Processing Progress Overlay -->
<div class="modal-overlay" id="modalProgress" style="pointer-events:auto">
<div class="modal" style="max-width:420px;text-align:center">
<div style="margin-bottom:var(--sp-4)">
<svg viewBox="0 0 24 24" fill="none" stroke="var(--accent-blue)" stroke-width="2" width="48" height="48" style="animation:spin 1.5s linear infinite"><path d="M12 2a10 10 0 0110 10"/></svg>
</div>
<h3 style="font-size:1rem;font-weight:600;margin-bottom:var(--sp-2)" id="progressTitle">Procesando...</h3>
<p style="font-size:0.85rem;color:var(--text-secondary);margin-bottom:var(--sp-4)" id="progressSubtitle">Comprimiendo archivo</p>
<div class="progress progress--active" style="margin-bottom:var(--sp-3)">
<div class="progress__bar progress__bar--blue" id="progressBar" style="width:0%"></div>
</div>
<div style="display:flex;justify-content:space-between;font-size:0.75rem;color:var(--text-tertiary)">
<span id="progressPercent">0%</span>
<span id="progressEta">Estimando...</span>
</div>
</div>
</div>
<!-- Toast container -->
<div class="toast-container" id="toastContainer" aria-live="polite"></div>
<!-- Main Script -->
<script type="module" src="js/main.js"></script>
</body>
</html>