263 lines
9.3 KiB
HTML
263 lines
9.3 KiB
HTML
<!doctype html>
|
|||
|
|
<html lang="en">
|
||
|
|
<head>
|
||
|
|
<meta charset="UTF-8" />
|
||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
|
|
<title>ImagePro Toolkit | Professional Image Manipulation</title>
|
||
|
|
<!-- Google Fonts -->
|
||
|
|
<link
|
||
|
|
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap"
|
||
|
|
rel="stylesheet"
|
||
|
|
/>
|
||
|
|
<!-- Font Awesome -->
|
||
|
|
<link
|
||
|
|
rel="stylesheet"
|
||
|
|
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
|
||
|
|
/>
|
||
|
|
<link rel="stylesheet" href="/styles.css" />
|
||
|
|
</head>
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<!-- Ambient lights -->
|
||
|
|
<div class="ambient-light light-1"></div>
|
||
|
|
<div class="ambient-light light-2"></div>
|
||
|
|
<div class="ambient-light light-3"></div>
|
||
|
|
|
||
|
|
<!-- Sidebar -->
|
||
|
|
<div class="sidebar">
|
||
|
|
<div class="logo">
|
||
|
|
<i class="fa-solid fa-layer-group"></i>
|
||
|
|
<span>ImagePro</span>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="nav-links">
|
||
|
|
<div class="section-title">Single File Tools</div>
|
||
|
|
<div class="nav-item active" data-tool="resize" onclick="switchTool('resize', this)">
|
||
|
|
<i class="fa-solid fa-ruler-combined"></i> Resize
|
||
|
|
</div>
|
||
|
|
<div class="nav-item" data-tool="convert" onclick="switchTool('convert', this)">
|
||
|
|
<i class="fa-solid fa-rotate"></i> Convert
|
||
|
|
</div>
|
||
|
|
<div class="nav-item" data-tool="compress" onclick="switchTool('compress', this)">
|
||
|
|
<i class="fa-solid fa-file-zipper"></i> Compress
|
||
|
|
</div>
|
||
|
|
<div class="nav-item" data-tool="crop" onclick="switchTool('crop', this)">
|
||
|
|
<i class="fa-solid fa-crop-simple"></i> Crop
|
||
|
|
</div>
|
||
|
|
<div class="nav-item" data-tool="filter" onclick="switchTool('filter', this)">
|
||
|
|
<i class="fa-solid fa-wand-magic-sparkles"></i> Filters
|
||
|
|
</div>
|
||
|
|
<div class="nav-item" data-tool="rotate" onclick="switchTool('rotate', this)">
|
||
|
|
<i class="fa-solid fa-arrows-rotate"></i> Rotate
|
||
|
|
</div>
|
||
|
|
<div class="nav-item" data-tool="watermark" onclick="switchTool('watermark', this)">
|
||
|
|
<i class="fa-solid fa-stamp"></i> Watermark
|
||
|
|
</div>
|
||
|
|
<div class="nav-item" data-tool="masker" onclick="switchTool('masker', this)">
|
||
|
|
<i class="fa-solid fa-mask"></i> Masker
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="divider"></div>
|
||
|
|
|
||
|
|
<div class="section-title">Batch Operations</div>
|
||
|
|
<div class="nav-item" data-tool="batch" onclick="switchTool('batch', this)">
|
||
|
|
<i class="fa-solid fa-folder-tree"></i> Batch Process
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<!-- Main Content -->
|
||
|
|
<div class="main-content">
|
||
|
|
<!-- Header -->
|
||
|
|
<div class="header">
|
||
|
|
<div class="page-title">
|
||
|
|
<h2 id="tool-title">Resize Images</h2>
|
||
|
|
<p id="tool-desc">
|
||
|
|
Change image dimensions while maintaining quality.
|
||
|
|
</p>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<!-- Single File Tools (Generic Wrapper) -->
|
||
|
|
<div id="single-tool-wrapper">
|
||
|
|
<div class="upload-area" id="drop-zone" onclick="triggerFileInput()">
|
||
|
|
<div id="upload-content">
|
||
|
|
<div class="upload-icon">
|
||
|
|
<i class="fa-solid fa-cloud-arrow-up"></i>
|
||
|
|
</div>
|
||
|
|
<h3>Drag & Drop images here</h3>
|
||
|
|
<p style="color: var(--text-secondary); margin-top: 8px">
|
||
|
|
or click to browse from computer
|
||
|
|
</p>
|
||
|
|
<div style="margin-top: 16px; font-size: 0.8rem; color: #64748b">
|
||
|
|
Supported: PNG, JPG, WEBP, HEIC, BMP, TIFF, ICO
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<input
|
||
|
|
type="file"
|
||
|
|
id="file-input"
|
||
|
|
multiple
|
||
|
|
accept="image/*,.heic"
|
||
|
|
style="display: none"
|
||
|
|
onchange="handleFileSelect(this)"
|
||
|
|
/>
|
||
|
|
|
||
|
|
<!-- Dynamic Controls Section -->
|
||
|
|
<div class="controls-panel" id="controls-area">
|
||
|
|
<!-- Injected via JS based on selected tool -->
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<button class="btn" onclick="executeProcess()">
|
||
|
|
<i class="fa-solid fa-bolt"></i> Process Images
|
||
|
|
</button>
|
||
|
|
|
||
|
|
<div
|
||
|
|
class="results-grid"
|
||
|
|
id="results-area"
|
||
|
|
style="margin-top: 40px"
|
||
|
|
></div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<!-- Batch Tool View -->
|
||
|
|
<div id="batch-view" class="tool-view">
|
||
|
|
<div class="controls-panel">
|
||
|
|
<div class="input-group">
|
||
|
|
<label
|
||
|
|
><i class="fa-solid fa-cloud-upload"></i> Upload Images for Batch
|
||
|
|
Processing</label
|
||
|
|
>
|
||
|
|
<input
|
||
|
|
type="file"
|
||
|
|
id="batch-files"
|
||
|
|
multiple
|
||
|
|
accept="image/*"
|
||
|
|
hidden
|
||
|
|
/>
|
||
|
|
<input
|
||
|
|
type="file"
|
||
|
|
id="batch-folder"
|
||
|
|
webkitdirectory
|
||
|
|
directory
|
||
|
|
multiple
|
||
|
|
hidden
|
||
|
|
/>
|
||
|
|
<div style="display: flex; gap: 10px; margin: 10px 0">
|
||
|
|
<button
|
||
|
|
class="btn"
|
||
|
|
onclick="document.getElementById('batch-files').click()"
|
||
|
|
style="flex: 1"
|
||
|
|
>
|
||
|
|
<i class="fa-solid fa-images"></i> Select Files
|
||
|
|
</button>
|
||
|
|
<button
|
||
|
|
class="btn"
|
||
|
|
onclick="document.getElementById('batch-folder').click()"
|
||
|
|
style="flex: 1"
|
||
|
|
>
|
||
|
|
<i class="fa-solid fa-folder-open"></i> Select Folder
|
||
|
|
</button>
|
||
|
|
</div>
|
||
|
|
<div
|
||
|
|
id="batchUploadZone"
|
||
|
|
style="
|
||
|
|
min-height: 80px;
|
||
|
|
border: 2px dashed var(--border);
|
||
|
|
border-radius: 12px;
|
||
|
|
padding: 20px;
|
||
|
|
text-align: center;
|
||
|
|
background: rgba(255, 255, 255, 0.03);
|
||
|
|
"
|
||
|
|
>
|
||
|
|
<i
|
||
|
|
class="fa-solid fa-cloud-upload-alt"
|
||
|
|
style="font-size: 2em; color: var(--primary)"
|
||
|
|
></i>
|
||
|
|
<div
|
||
|
|
style="
|
||
|
|
color: var(--text-secondary);
|
||
|
|
font-size: 0.85em;
|
||
|
|
margin-top: 8px;
|
||
|
|
"
|
||
|
|
>
|
||
|
|
Or drag & drop files/folders here
|
||
|
|
</div>
|
||
|
|
<div
|
||
|
|
id="batchFileInfo"
|
||
|
|
style="
|
||
|
|
margin-top: 10px;
|
||
|
|
color: var(--primary);
|
||
|
|
font-weight: 500;
|
||
|
|
"
|
||
|
|
></div>
|
||
|
|
</div>
|
||
|
|
<p style="font-size: 0.8rem; color: #64748b; margin-top: 8px">
|
||
|
|
Files will be uploaded and processed. Results will download as a
|
||
|
|
ZIP file.
|
||
|
|
</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="grid-2">
|
||
|
|
<div class="input-group">
|
||
|
|
<label>Operation</label>
|
||
|
|
<select id="batch-operation" onchange="updateBatchControls()">
|
||
|
|
<option value="resize">Resize</option>
|
||
|
|
<option value="convert">Convert</option>
|
||
|
|
<option value="compress">Compress</option>
|
||
|
|
<option value="crop">Crop</option>
|
||
|
|
<option value="filter">Filter</option>
|
||
|
|
<option value="rotate">Rotate</option>
|
||
|
|
<option value="watermark">Watermark</option>
|
||
|
|
</select>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<!-- Dynamic Batch Params -->
|
||
|
|
<div id="batch-params"></div>
|
||
|
|
|
||
|
|
<div
|
||
|
|
style="
|
||
|
|
display: grid;
|
||
|
|
grid-template-columns: 1fr 2fr;
|
||
|
|
gap: 12px;
|
||
|
|
margin-top: 20px;
|
||
|
|
"
|
||
|
|
>
|
||
|
|
<button class="btn outline" onclick="previewBatch()">
|
||
|
|
<i class="fa-solid fa-eye"></i> Preview Files
|
||
|
|
</button>
|
||
|
|
<button class="btn" onclick="executeBatch()">
|
||
|
|
<i class="fa-solid fa-play"></i> Start Batch Processing
|
||
|
|
</button>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="console" id="batch-console">
|
||
|
|
<div class="console-line">> Ready to process...</div>
|
||
|
|
</div>
|
||
|
|
<!-- Progress Bar -->
|
||
|
|
<div id="batch-progress-container" style="display: none; margin-top: 12px; padding: 16px; background: rgba(15, 23, 42, 0.8); border: 1px solid var(--border); border-radius: 10px;">
|
||
|
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;">
|
||
|
|
<span id="batch-progress-label" style="color: var(--text-main); font-weight: 600; font-size: 0.95rem;">Processing...</span>
|
||
|
|
<span id="batch-progress-percent" style="color: var(--primary); font-weight: 700; font-size: 1.1rem;">0%</span>
|
||
|
|
</div>
|
||
|
|
<div style="width: 100%; height: 10px; background: rgba(100,116,139,0.2); border-radius: 5px; overflow: hidden;">
|
||
|
|
<div id="batch-progress-bar" style="height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 5px; transition: width 0.3s ease;"></div>
|
||
|
|
</div>
|
||
|
|
<div id="batch-progress-detail" style="color: var(--text-secondary); font-size: 0.85rem; margin-top: 8px;"></div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<!-- Loading Overlay -->
|
||
|
|
<div class="loader" id="loader">
|
||
|
|
<div class="spinner"></div>
|
||
|
|
<h3 style="color: white">Processing...</h3>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<!-- Toast Container -->
|
||
|
|
<div class="toast-container" id="toast-container"></div>
|
||
|
|
|
||
|
|
<script src="/app.js" defer></script>
|
||
|
|
</body>
|
||
|
|
</html>
|