-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
256 lines (239 loc) · 11.6 KB
/
Copy pathindex.html
File metadata and controls
256 lines (239 loc) · 11.6 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta
name="description"
content="Remove same-colour date stamps and labels from a folder of photos, entirely in your browser."
>
<meta name="theme-color" content="#f8fafc">
<title>Batch Erase — remove matching text from photos</title>
<link rel="icon" href="./favicon.svg" type="image/svg+xml">
<link rel="stylesheet" href="./styles.css">
</head>
<body>
<header class="site-header">
<a class="brand" href="./" aria-label="Batch Erase home">
<span class="brand-mark" aria-hidden="true">
<svg viewBox="0 0 24 24" role="img">
<path d="m14.8 4.2 5 5a2.4 2.4 0 0 1 0 3.4l-7.2 7.2H6.8a2.4 2.4 0 0 1-1.7-.7l-2-2a2.4 2.4 0 0 1 0-3.4l8.3-9.5a2.4 2.4 0 0 1 3.4 0Z" />
<path d="m8.4 19.8 8-8" />
</svg>
</span>
<span>Batch Erase</span>
</a>
<div class="privacy-pill">
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M10 2.2 16 4v4.8c0 4-2.5 7-6 8.8-3.5-1.8-6-4.8-6-8.8V4l6-1.8Z" /><path d="m7.3 9.8 1.8 1.8 3.7-4" /></svg>
Photos stay on this device
</div>
</header>
<main>
<section class="intro" aria-labelledby="page-title">
<div>
<p class="eyebrow">Private, browser-based photo cleanup</p>
<h1 id="page-title">Remove matching text from a folder of photos.</h1>
<p class="intro-copy">
Mark it once, choose its colour, then erase the same date stamp or label from every photo.
</p>
</div>
<ol class="mini-steps">
<li><span>1</span> Choose a folder</li>
<li><span>2</span> Mark and sample</li>
<li><span>3</span> Download a ZIP</li>
</ol>
</section>
<section id="folderCard" class="folder-card" aria-labelledby="folder-heading">
<div class="folder-icon" aria-hidden="true">
<svg viewBox="0 0 24 24"><path d="M3.5 6.5A2.5 2.5 0 0 1 6 4h4l2 2h6A2.5 2.5 0 0 1 20.5 8v9.5A2.5 2.5 0 0 1 18 20H6a2.5 2.5 0 0 1-2.5-2.5v-11Z" /></svg>
</div>
<div class="folder-copy">
<h2 id="folder-heading">Start with a photo folder</h2>
<p id="folderDescription">Select a folder containing JPG, JPEG, or PNG images. Nothing is uploaded.</p>
</div>
<label id="folderButton" class="button button-primary folder-button" for="folderInput">
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M3 5.5h5l1.5 1.7H17v8.3H3v-10Z" /><path d="M10 9v4m-2-2h4" /></svg>
Choose photo folder
</label>
<input
id="folderInput"
class="visually-hidden"
type="file"
accept="image/jpeg,image/png,.jpg,.jpeg,.png"
webkitdirectory
multiple
>
</section>
<section id="workspace" class="workspace" hidden aria-label="Photo cleanup workspace">
<div class="preview-card">
<div class="preview-toolbar">
<div class="photo-nav">
<button id="previousPhoto" class="icon-button" type="button" aria-label="Previous photo">
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="m12.5 5-5 5 5 5" /></svg>
</button>
<label class="select-wrap">
<span class="visually-hidden">Representative photo</span>
<select id="photoSelect" aria-label="Representative photo"></select>
</label>
<button id="nextPhoto" class="icon-button" type="button" aria-label="Next photo">
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="m7.5 5 5 5-5 5" /></svg>
</button>
</div>
<div class="preview-actions">
<button id="zoomToggle" class="zoom-button" type="button" aria-pressed="false" title="Show the preview at 100%">100%</button>
<div class="view-toggle" role="group" aria-label="Preview mode">
<button id="showOriginal" class="toggle-button is-active" type="button" aria-pressed="true">Original</button>
<button id="showTarget" class="toggle-button" type="button" aria-pressed="false" disabled>Target</button>
<button id="showResult" class="toggle-button" type="button" aria-pressed="false" disabled>Result</button>
</div>
</div>
</div>
<div id="canvasStage" class="canvas-stage">
<canvas
id="photoCanvas"
tabindex="0"
aria-describedby="canvasKeyboardHelp"
aria-label="Photo preview. Drag a rectangle around the text to remove."
></canvas>
<p id="canvasKeyboardHelp" class="visually-hidden">
Keyboard users can press Home to create a top-left starting box, End or Enter for a bottom-right box, use arrow keys to move it, Shift plus arrow keys to resize it, and Alt for larger steps.
</p>
<div id="canvasHint" class="canvas-hint">
<span class="hint-icon" aria-hidden="true">
<svg viewBox="0 0 20 20"><path d="M4 7V4h3M13 4h3v3M16 13v3h-3M7 16H4v-3" /></svg>
</span>
Drag a tight box around the text
</div>
</div>
<div class="preview-footer">
<p id="imageDetails">No photo loaded</p>
<p id="anchorDetails" class="anchor-badge" hidden></p>
</div>
</div>
<aside class="controls-card" aria-label="Cleanup controls">
<div class="control-section">
<div class="section-heading">
<span class="step-number">1</span>
<div>
<h2>Photo folder</h2>
<p id="folderSummary">No folder selected</p>
</div>
</div>
<button id="changeFolder" class="text-button" type="button">Choose another</button>
</div>
<div class="control-section">
<div class="section-heading">
<span class="step-number">2</span>
<div>
<h2>Mark the text</h2>
<p>Draw one tight box around the stamp or label.</p>
</div>
</div>
<div id="selectionStatus" class="status-row is-pending">
<span class="status-dot" aria-hidden="true"></span>
<span id="selectionStatusText">Waiting for a selection</span>
<button id="clearSelection" class="inline-action" type="button" hidden>Draw again</button>
</div>
</div>
<div class="control-section">
<div class="section-heading">
<span class="step-number">3</span>
<div>
<h2>Choose the text colour</h2>
<p>Pick it from the photo, or set it precisely.</p>
</div>
</div>
<div class="colour-tools">
<button id="sampleColour" class="button button-secondary" type="button" disabled>
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="m12.8 3.2 4 4-8.3 8.3-4.8.8.8-4.8 8.3-8.3Z" /><path d="m10.6 5.4 4 4" /></svg>
Pick from photo
</button>
<label class="colour-input-wrap" aria-label="Selected text colour">
<input id="colourInput" type="color" value="#e67e22">
<span id="colourHex">#E67E22</span>
</label>
</div>
<fieldset class="match-fieldset">
<legend>Colour range</legend>
<div class="segmented-control">
<label><input type="radio" name="tolerance" value="11"><span>Precise</span></label>
<label><input type="radio" name="tolerance" value="18" checked><span>Balanced</span></label>
<label><input type="radio" name="tolerance" value="28"><span>Broad</span></label>
</div>
</fieldset>
<div id="matchSummary" class="match-summary" aria-live="polite">
<span class="match-swatch" aria-hidden="true"></span>
<span><strong>Draw a box</strong><small>Matching pixels will be highlighted</small></span>
</div>
<details class="advanced-controls">
<summary>Advanced position and edge controls</summary>
<div class="range-row">
<span class="range-label"><label for="flexibilityInput">Position flexibility</label><output id="flexibilityOutput">Medium</output></span>
<input id="flexibilityInput" type="range" min="1" max="3" step="1" value="2">
</div>
<div class="range-row">
<span class="range-label"><label for="cleanupInput">Edge cleanup</label><output id="cleanupOutput">Medium</output></span>
<input id="cleanupInput" type="range" min="1" max="3" step="1" value="2">
</div>
</details>
</div>
<div class="action-area">
<button id="previewErase" class="button button-secondary button-wide" type="button" disabled>
Preview one photo
</button>
<button id="processFolder" class="button button-primary button-wide" type="button" disabled>
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M4 4h12v12H4z" /><path d="M7 10h6m-3-3v6" /></svg>
Erase folder & make ZIP
</button>
<p class="action-note">Original photos are never changed.</p>
</div>
</aside>
</section>
<section id="progressCard" class="progress-card" hidden>
<div class="progress-topline">
<div>
<p class="eyebrow">Working locally</p>
<h2 id="progressTitle">Preparing the repair engine…</h2>
<p id="progressDetail">The first run may take a moment.</p>
</div>
<span id="progressPercent">0%</span>
</div>
<progress
id="progressTrack"
class="progress-track"
aria-label="Folder processing progress"
max="100"
value="0"
>0%</progress>
<button id="cancelProcessing" class="text-button danger-text" type="button">Cancel</button>
</section>
<section id="downloadCard" class="download-card" hidden aria-live="polite">
<div class="success-icon" aria-hidden="true">
<svg viewBox="0 0 24 24"><path d="M20 11a8 8 0 1 1-4-6.9" /><path d="m8.5 11.5 2.3 2.3L21 3.5" /></svg>
</div>
<div>
<p class="eyebrow">All done</p>
<h2>Your edited folder is ready.</h2>
<p id="downloadSummary"></p>
</div>
<a id="downloadZip" class="button button-success" href="#" download>
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M10 3v9m-3-3 3 3 3-3M4 14v3h12v-3" /></svg>
Download edited ZIP
</a>
</section>
<section class="privacy-note" aria-label="Privacy and format notes">
<div>
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3 20 6v6c0 4.7-3.2 7.6-8 9-4.8-1.4-8-4.3-8-9V6l8-3Z" /><path d="M9 12h6M12 9v6" /></svg>
</div>
<p>
<strong>Your photos never leave your browser.</strong>
Processing happens on this device. Edited JPEGs are re-encoded and photo metadata such as EXIF and location is not copied into the new files.
</p>
</section>
</main>
<div id="toast" class="toast" role="status" aria-live="polite" hidden></div>
<script src="./processing-core.js"></script>
<script src="./vendor/fflate.min.js"></script>
<script src="./app.js" defer></script>
</body>
</html>