-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
494 lines (473 loc) · 28.3 KB
/
index.html
File metadata and controls
494 lines (473 loc) · 28.3 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Professional Image Converter - Convert, Resize, Crop & Compress</title>
<meta name="description" content="Free online image converter. Convert between PNG, JPG, WebP, BMP, GIF, TIFF, ICO. Resize, crop, rotate, and compress images.">
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
</head>
<body>
<div class="app-container">
<!-- Dark Mode Toggle -->
<button class="dark-mode-toggle" id="darkModeToggle" aria-label="Toggle dark mode">
<svg class="sun-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="5"/>
<line x1="12" y1="1" x2="12" y2="3"/>
<line x1="12" y1="21" x2="12" y2="23"/>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/>
<line x1="1" y1="12" x2="3" y2="12"/>
<line x1="21" y1="12" x2="23" y2="12"/>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>
</svg>
<svg class="moon-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>
</svg>
</button>
<div class="container">
<header class="header">
<div class="logo">
<svg class="logo-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<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>Image Converter</span>
</div>
<p class="tagline">Convert, resize, crop, rotate & compress images instantly</p>
</header>
<main class="main-content">
<!-- Upload Section -->
<div class="upload-section">
<div class="upload-area" id="uploadArea">
<div class="upload-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
<polyline points="17 8 12 3 7 8"/>
<line x1="12" y1="3" x2="12" y2="15"/>
</svg>
</div>
<h3>Drag & Drop your image(s) here</h3>
<p>or click to browse</p>
<p class="upload-hint">Supports multiple files for batch conversion</p>
<input type="file" id="fileInput" accept="image/*" multiple hidden>
</div>
<!-- File List for Bulk Upload -->
<div class="file-list" id="fileList"></div>
</div>
<!-- Editor Panel -->
<div class="editor-panel" id="editorPanel">
<!-- Image Preview -->
<div class="preview-section">
<div class="preview-container">
<div class="preview-box main-preview">
<div class="preview-header">
<h4>Original Image</h4>
<div class="preview-actions">
<button class="action-btn" id="zoomInBtn" title="Zoom In">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"/>
<line x1="21" y1="21" x2="16.65" y2="16.65"/>
<line x1="11" y1="8" x2="11" y2="14"/>
<line x1="8" y1="11" x2="14" y2="11"/>
</svg>
</button>
<button class="action-btn" id="zoomOutBtn" title="Zoom Out">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"/>
<line x1="21" y1="21" x2="16.65" y2="16.65"/>
<line x1="8" y1="11" x2="14" y2="11"/>
</svg>
</button>
<button class="action-btn" id="resetZoomBtn" title="Reset">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/>
<path d="M3 3v5h5"/>
</svg>
</button>
</div>
</div>
<div class="preview-image-wrapper" id="originalWrapper">
<img id="originalPreview" src="" alt="Original preview">
</div>
<p class="file-info" id="originalInfo"></p>
</div>
<!-- Before/After Comparison -->
<div class="preview-box comparison-preview" id="comparisonPreview">
<div class="preview-header">
<h4>Before / After</h4>
</div>
<div class="comparison-wrapper">
<div class="comparison-container" id="comparisonContainer">
<img id="comparisonOriginal" src="" alt="Original">
<img id="comparisonConverted" src="" alt="Converted">
</div>
<input type="range" id="comparisonSlider" min="0" max="100" value="50">
</div>
</div>
<div class="preview-box">
<div class="preview-header">
<h4>Converted Image</h4>
<span class="badge" id="sizeBadge"></span>
</div>
<div class="preview-image-wrapper">
<img id="convertedPreview" src="" alt="Converted preview">
</div>
<p class="file-info" id="convertedInfo"></p>
</div>
</div>
</div>
<!-- Tools Panel -->
<div class="tools-panel">
<div class="tools-tabs">
<button class="tool-tab active" data-tab="convert">Convert</button>
<button class="tool-tab" data-tab="resize">Resize</button>
<button class="tool-tab" data-tab="crop">Crop</button>
<button class="tool-tab" data-tab="rotate">Rotate</button>
<button class="tool-tab" data-tab="compress">Compress</button>
</div>
<!-- Convert Tab -->
<div class="tool-content active" id="convertTab">
<div class="setting-group">
<label for="formatSelect">Output Format</label>
<select id="formatSelect">
<option value="image/jpeg">JPEG</option>
<option value="image/png">PNG</option>
<option value="image/webp">WebP</option>
<option value="image/bmp">BMP</option>
<option value="image/gif">GIF</option>
<option value="image/tiff">TIFF</option>
<option value="image/x-icon">ICO</option>
</select>
</div>
<div class="setting-group" id="qualityGroup">
<label for="qualitySlider">Quality: <span id="qualityValue">90%</span></label>
<input type="range" id="qualitySlider" min="1" max="100" value="90">
</div>
</div>
<!-- Resize Tab -->
<div class="tool-content" id="resizeTab">
<div class="resize-options">
<div class="setting-group">
<label for="resizeWidth">Width (px)</label>
<input type="number" id="resizeWidth" value="" min="1">
</div>
<div class="setting-group">
<label for="resizeHeight">Height (px)</label>
<input type="number" id="resizeHeight" value="" min="1">
</div>
</div>
<div class="setting-group">
<label class="checkbox-label">
<input type="checkbox" id="maintainAspect" checked>
<span>Maintain aspect ratio</span>
</label>
</div>
<div class="preset-sizes">
<label>Quick Sizes:</label>
<div class="preset-buttons">
<button class="preset-btn" data-width="1920" data-height="1080">1920×1080</button>
<button class="preset-btn" data-width="1280" data-height="720">1280×720</button>
<button class="preset-btn" data-width="800" data-height="600">800×600</button>
<button class="preset-btn" data-width="640" data-height="480">640×480</button>
</div>
</div>
</div>
<!-- Crop Tab -->
<div class="tool-content" id="cropTab">
<div class="crop-instructions">
<p>Click and drag on the original image to select the crop area</p>
</div>
<div class="crop-settings">
<div class="setting-group">
<label for="cropRatio">Aspect Ratio</label>
<select id="cropRatio">
<option value="free">Free</option>
<option value="1:1">1:1 (Square)</option>
<option value="16:9">16:9</option>
<option value="4:3">4:3</option>
<option value="3:2">3:2</option>
<option value="2:3">2:3 (Portrait)</option>
<option value="9:16">9:16</option>
</select>
</div>
</div>
<div class="crop-actions">
<button class="btn-secondary" id="applyCropBtn">Apply Crop</button>
<button class="btn-secondary" id="resetCropBtn">Reset</button>
</div>
</div>
<!-- Rotate Tab -->
<div class="tool-content" id="rotateTab">
<div class="rotate-options">
<button class="rotate-btn" id="rotateLeftBtn" title="Rotate Left 90°">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="1 4 1 10 7 10"/>
<path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"/>
</svg>
<span>Rotate Left</span>
</button>
<button class="rotate-btn" id="rotateRightBtn" title="Rotate Right 90°">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="23 4 23 10 17 10"/>
<path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/>
</svg>
<span>Rotate Right</span>
</button>
<button class="rotate-btn" id="flipHBtn" title="Flip Horizontal">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M16 3h5v5"/>
<line x1="4" y1="20" x2="21" y2="3"/>
<path d="M21 16v5h-5"/>
<line x1="15" y1="15" x2="21" y2="21"/>
<line x1="4" y1="4" x2="9" y2="9"/>
</svg>
<span>Flip H</span>
</button>
<button class="rotate-btn" id="flipVBtn" title="Flip Vertical">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="3" x2="12" y2="21"/>
<polyline points="16 3 21 3 21 8"/>
<line x1="4" y1="20" x2="9" y2="15"/>
<polyline points="21 16 21 21 16 21"/>
<line x1="15" y1="15" x2="21" y2="21"/>
<line x1="4" y1="4" x2="9" y2="9"/>
</svg>
<span>Flip V</span>
</button>
</div>
<div class="setting-group">
<label for="rotateAngle">Custom Rotation: <span id="rotateAngleValue">0°</span></label>
<input type="range" id="rotateAngle" min="-180" max="180" value="0">
</div>
</div>
<!-- Compress Tab -->
<div class="tool-content" id="compressTab">
<div class="setting-group">
<label for="compressLevel">Compression Level: <span id="compressLevelValue">Balanced</span></label>
<select id="compressLevel">
<option value="0.9">Maximum Quality</option>
<option value="0.7" selected>Balanced</option>
<option value="0.5">Maximum Compression</option>
</select>
</div>
<div class="compression-stats" id="compressionStats">
<div class="stat-item">
<span class="stat-label">Original Size:</span>
<span class="stat-value" id="originalSize">-</span>
</div>
<div class="stat-item">
<span class="stat-label">Compressed Size:</span>
<span class="stat-value" id="compressedSize">-</span>
</div>
<div class="stat-item">
<span class="stat-label">Reduction:</span>
<span class="stat-value" id="reductionPercent">-</span>
</div>
</div>
</div>
<!-- Action Buttons -->
<div class="action-buttons">
<button class="convert-btn" id="convertBtn">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="20 6 9 17 4 12"/>
</svg>
Convert Image
</button>
<button class="download-btn" id="downloadBtn" disabled>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
<polyline points="7 10 12 15 17 10"/>
<line x1="12" y1="15" x2="12" y2="3"/>
</svg>
Download
</button>
<button class="download-all-btn" id="downloadAllBtn">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
<polyline points="7 10 12 15 17 10"/>
<line x1="12" y1="15" x2="12" y2="3"/>
</svg>
Download All
</button>
<button class
<button class="reset-btn" id="resetBtn">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="1 4 1 10 7 10"/>
<path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"/>
</svg>
Reset
</button>
</div>
</div>
</div>
<!-- Batch Processing Panel -->
<div class="batch-panel" id="batchPanel">
<div class="batch-header">
<h3>Batch Processing</h3>
<span class="batch-count" id="batchCount">0 files</span>
</div>
<div class="batch-list" id="batchList"></div>
<div class="batch-actions">
<button class="btn-secondary" id="clearBatchBtn">Clear All</button>
<button class="convert-btn" id="convertAllBtn">Convert All</button>
</div>
</div>
<!-- History Panel -->
<div class="history-panel" id="historyPanel">
<div class="history-header">
<h3>Conversion History</h3>
<button class="btn-small" id="clearHistoryBtn">Clear</button>
</div>
<div class="history-list" id="historyList"></div>
</div>
</main>
<!-- Features Section -->
<section class="features">
<div class="feature">
<div class="feature-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
</svg>
</div>
<h4>Secure Processing</h4>
<p>All conversions happen in your browser. Your images never leave your device.</p>
</div>
<div class="feature">
<div class="feature-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"/>
<polyline points="12 6 12 12 16 14"/>
</svg>
</div>
<h4>Instant Conversion</h4>
<p>Fast processing powered by modern browser technologies.</p>
</div>
<div class="feature">
<div class="feature-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"/>
<line x1="3" y1="9" x2="21" y2="9"/>
<line x1="9" y1="21" x2="9" y2="9"/>
</svg>
</div>
<h4>Multiple Formats</h4>
<p>Convert between PNG, JPEG, WebP, BMP, GIF, TIFF, and ICO formats.</p>
</div>
<div class="feature">
<div class="feature-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
<polyline points="17 8 12 3 7 8"/>
<line x1="12" y1="3" x2="12" y2="15"/>
</svg>
</div>
<h4>Batch Processing</h4>
<p>Convert multiple images at once with our batch processing feature.</p>
</div>
<div class="feature">
<div class="feature-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="3" width="18" height="18" rx="2"/>
<circle cx="8.5" cy="8.5" r="1.5"/>
<path d="M21 15l-5-5L5 21"/>
</svg>
</div>
<h4>Image Editing</h4>
<p>Resize, crop, rotate, and compress images with powerful editing tools.</p>
</div>
<div class="feature">
<div class="feature-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="5" y="2" width="14" height="20" rx="2" ry="2"/>
<line x1="12" y1="18" x2="12.01" y2="18"/>
</svg>
</div>
<h4>Mobile Friendly</h4>
<p>Fully responsive design that works perfectly on all devices.</p>
</div>
</section>
<!-- FAQ Section -->
<section class="faq-section">
<h2>Frequently Asked Questions</h2>
<div class="faq-grid">
<div class="faq-item">
<h4>Is my data secure?</h4>
<p>Yes! All image processing happens directly in your browser. Your images are never uploaded to any server.</p>
</div>
<div class="faq-item">
<h4>What formats are supported?</h4>
<p>We support JPEG, PNG, WebP, BMP, GIF, TIFF, and ICO formats for conversion.</p>
</div>
<div class="faq-item">
<h4>Is there a file size limit?</h4>
<p>For best performance, we recommend files under 10MB. Larger files may take longer to process.</p>
</div>
<div class="faq-item">
<h4>Can I convert multiple images at once?</h4>
<p>Yes! You can upload multiple files and use our batch processing feature to convert them all at once.</p>
</div>
<div class="faq-item">
<h4>Do I need to install anything?</h4>
<p>No! This is a fully web-based tool. Just open the website and start converting.</p>
</div>
<div class="faq-item">
<h4>Will I lose image quality?</h4>
<p>Quality depends on the format and settings you choose. You can adjust quality settings for lossy formats like JPEG and WebP.</p>
</div>
</div>
</section>
<footer class="footer">
<div class="footer-content">
<div class="footer-section">
<h4>Image Converter</h4>
<p>Free online image conversion tool. Convert, resize, crop, rotate, and compress images instantly.</p>
</div>
<div class="footer-section">
<h4>Quick Links</h4>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Features</a></li>
<li><a href="#">FAQ</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
<div class="footer-section">
<h4>Formats</h4>
<ul>
<li><a href="#">Convert to JPEG</a></li>
<li><a href="#">Convert to PNG</a></li>
<li><a href="#">Convert to WebP</a></li>
<li><a href="#">Convert to BMP</a></li>
</ul>
</div>
<div class="footer-section">
<h4>Legal</h4>
<ul>
<li><a href="#">Privacy Policy</a></li>
<li><a href="#">Terms of Service</a></li>
<li><a href="#">Cookie Policy</a></li>
</ul>
</div>
</div>
<div class="footer-bottom">
<p>© 2024 Image Converter. All rights reserved.</p>
</div>
</footer>
</div>
<!-- Loading Overlay -->
<div class="loading-overlay" id="loadingOverlay">
<div class="spinner"></div>
<p>Processing your image...</p>
</div>
<!-- Toast Notifications -->
<div class="toast-container" id="toastContainer"></div>
</div>
<script src="script.js"></script>
</body>
</html>