tokimeki-image-editor 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,306 +12,344 @@ function resetAll() {
12
12
  shadows: 0,
13
13
  brightness: 0,
14
14
  saturation: 0,
15
- hue: 0,
15
+ temperature: 0,
16
16
  vignette: 0,
17
17
  sepia: 0,
18
- grayscale: 0
18
+ grayscale: 0,
19
+ blur: 0,
20
+ grain: 0
19
21
  });
20
22
  }
21
- </script>
22
-
23
- <div class="adjust-tool">
24
- <div class="tool-header">
25
- <h3>{$_('editor.adjust')}</h3>
26
- <button class="close-btn" onclick={onClose} title={$_('editor.close')}>
27
- <X size={20} />
28
- </button>
29
- </div>
30
-
31
- <div class="adjustments-grid">
32
- <!-- Exposure -->
33
- <div class="adjustment-control">
34
- <label for="exposure">
35
- <span>{$_('adjustments.exposure')}</span>
36
- <span class="value">{adjustments.exposure}</span>
37
- </label>
38
- <input
39
- id="exposure"
40
- type="range"
41
- min="-100"
42
- max="100"
43
- value={adjustments.exposure}
44
- oninput={(e) => handleChange('exposure', Number(e.currentTarget.value))}
45
- />
46
- </div>
47
-
48
- <!-- Brightness -->
49
- <div class="adjustment-control">
50
- <label for="brightness">
51
- <span>{$_('adjustments.brightness')}</span>
52
- <span class="value">{adjustments.brightness}</span>
53
- </label>
54
- <input
55
- id="brightness"
56
- type="range"
57
- min="-100"
58
- max="100"
59
- value={adjustments.brightness}
60
- oninput={(e) => handleChange('brightness', Number(e.currentTarget.value))}
61
- />
62
- </div>
63
-
64
- <!-- Contrast -->
65
- <div class="adjustment-control">
66
- <label for="contrast">
67
- <span>{$_('adjustments.contrast')}</span>
68
- <span class="value">{adjustments.contrast}</span>
69
- </label>
70
- <input
71
- id="contrast"
72
- type="range"
73
- min="-100"
74
- max="100"
75
- value={adjustments.contrast}
76
- oninput={(e) => handleChange('contrast', Number(e.currentTarget.value))}
77
- />
78
- </div>
79
-
80
- <!-- Highlights -->
81
- <div class="adjustment-control">
82
- <label for="highlights">
83
- <span>{$_('adjustments.highlights')}</span>
84
- <span class="value">{adjustments.highlights}</span>
85
- </label>
86
- <input
87
- id="highlights"
88
- type="range"
89
- min="-100"
90
- max="100"
91
- value={adjustments.highlights}
92
- oninput={(e) => handleChange('highlights', Number(e.currentTarget.value))}
93
- />
94
- </div>
95
-
96
- <!-- Shadows -->
97
- <div class="adjustment-control">
98
- <label for="shadows">
99
- <span>{$_('adjustments.shadows')}</span>
100
- <span class="value">{adjustments.shadows}</span>
101
- </label>
102
- <input
103
- id="shadows"
104
- type="range"
105
- min="-100"
106
- max="100"
107
- value={adjustments.shadows}
108
- oninput={(e) => handleChange('shadows', Number(e.currentTarget.value))}
109
- />
110
- </div>
111
-
112
- <!-- Saturation -->
113
- <div class="adjustment-control">
114
- <label for="saturation">
115
- <span>{$_('adjustments.saturation')}</span>
116
- <span class="value">{adjustments.saturation}</span>
117
- </label>
118
- <input
119
- id="saturation"
120
- type="range"
121
- min="-100"
122
- max="100"
123
- value={adjustments.saturation}
124
- oninput={(e) => handleChange('saturation', Number(e.currentTarget.value))}
125
- />
126
- </div>
127
-
128
- <!-- Hue -->
129
- <div class="adjustment-control">
130
- <label for="hue">
131
- <span>{$_('adjustments.hue')}</span>
132
- <span class="value">{adjustments.hue}°</span>
133
- </label>
134
- <input
135
- id="hue"
136
- type="range"
137
- min="-180"
138
- max="180"
139
- value={adjustments.hue}
140
- oninput={(e) => handleChange('hue', Number(e.currentTarget.value))}
141
- />
142
- </div>
143
-
144
- <!-- Vignette -->
145
- <div class="adjustment-control">
146
- <label for="vignette">
147
- <span>{$_('adjustments.vignette')}</span>
148
- <span class="value">{adjustments.vignette}</span>
149
- </label>
150
- <input
151
- id="vignette"
152
- type="range"
153
- min="-100"
154
- max="100"
155
- value={adjustments.vignette}
156
- oninput={(e) => handleChange('vignette', Number(e.currentTarget.value))}
157
- />
158
- </div>
159
- </div>
160
-
161
- <div class="tool-actions">
162
- <button class="btn btn-secondary" onclick={resetAll}>
163
- {$_('editor.reset')}
164
- </button>
165
- </div>
166
- </div>
167
-
168
- <style>
169
- .adjust-tool {
170
- display: flex;
171
- flex-direction: column;
172
- gap: 1rem;
173
- }
174
-
175
- .tool-header {
176
- display: flex;
177
- justify-content: space-between;
178
- align-items: center;
179
- }
180
-
181
- .tool-header h3 {
182
- margin: 0;
183
- font-size: 1.1rem;
184
- color: #fff;
185
- }
186
-
187
- .close-btn {
188
- display: flex;
189
- align-items: center;
190
- justify-content: center;
191
- padding: 0.25rem;
192
- background: transparent;
193
- border: none;
194
- color: #999;
195
- cursor: pointer;
196
- border-radius: 4px;
197
- transition: all 0.2s;
198
- }
199
-
200
- .close-btn:hover {
201
- background: #444;
202
- color: #fff;
203
- }
204
-
205
- .adjustments-grid {
206
- display: grid;
207
- grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
208
- gap: 1rem;
209
- }
210
-
211
- @media (max-width: 767px) {
212
-
213
- .adjustments-grid {
214
- grid-template-columns: 1fr;
215
- gap: 0.75rem;
216
- max-height: 35vh;
217
- overflow-y: auto
218
- }
219
- }
220
-
221
- .adjustment-control {
222
- display: flex;
223
- flex-direction: column;
224
- gap: 0.5rem;
225
- }
226
-
227
- @media (max-width: 767px) {
228
-
229
- .adjustment-control {
230
- gap: 0.3rem
231
- }
232
- }
233
-
234
- .adjustment-control label {
235
- display: flex;
236
- justify-content: space-between;
237
- align-items: center;
238
- font-size: 0.85rem;
239
- color: #ccc;
240
- }
241
-
242
- @media (max-width: 767px) {
243
-
244
- .adjustment-control label {
245
- font-size: 0.8rem
246
- }
247
- }
248
-
249
- .adjustment-control .value {
250
- color: var(--primary-color, #63b97b);
251
- font-weight: 600;
252
- min-width: 3rem;
253
- text-align: right;
254
- }
255
-
256
- .adjustment-control input[type='range'] {
257
- width: 100%;
258
- height: 6px;
259
- background: #444;
260
- border-radius: 3px;
261
- outline: none;
262
- cursor: pointer;
263
- }
264
-
265
- .adjustment-control input[type='range']::-webkit-slider-thumb {
266
- appearance: none;
267
- width: 16px;
268
- height: 16px;
269
- background: var(--primary-color, #63b97b);
270
- border-radius: 50%;
271
- cursor: pointer;
272
- transition: all 0.2s;
273
- }
274
-
275
- .adjustment-control input[type='range']::-webkit-slider-thumb:hover {
276
- background: var(--primary-color, #63b97b);
277
- transform: scale(1.1);
278
- }
279
-
280
- .adjustment-control input[type='range']::-moz-range-thumb {
281
- width: 16px;
282
- height: 16px;
283
- background: var(--primary-color, #63b97b);
284
- border: none;
285
- border-radius: 50%;
286
- cursor: pointer;
287
- transition: all 0.2s;
288
- }
289
-
290
- .adjustment-control input[type='range']::-moz-range-thumb:hover {
291
- background: var(--primary-color, #63b97b);
292
- transform: scale(1.1);
293
- }
294
-
295
- .tool-actions {
296
- display: flex;
297
- justify-content: flex-end;
298
- gap: 0.5rem;
299
- }
300
-
301
- .btn {
302
- padding: 0.5rem 1rem;
303
- border: none;
304
- border-radius: 4px;
305
- cursor: pointer;
306
- font-size: 0.9rem;
307
- transition: all 0.2s;
308
- }
309
-
310
- .btn-secondary {
311
- background: #666;
312
- color: #fff;
313
- }
314
-
315
- .btn-secondary:hover {
316
- background: #777;
317
- }</style>
23
+ // Prevent wheel events from propagating to canvas zoom handler
24
+ function handleWheel(e) {
25
+ e.stopPropagation();
26
+ }
27
+ </script>
28
+
29
+ <div class="adjust-tool" onwheel={handleWheel}>
30
+ <div class="tool-header">
31
+ <h3>{$_('editor.adjust')}</h3>
32
+ <button class="close-btn" onclick={onClose} title={$_('editor.close')}>
33
+ <X size={20} />
34
+ </button>
35
+ </div>
36
+
37
+ <div class="adjustments-grid">
38
+ <!-- Exposure -->
39
+ <div class="adjustment-control">
40
+ <label for="exposure">
41
+ <span>{$_('adjustments.exposure')}</span>
42
+ <span class="value">{adjustments.exposure}</span>
43
+ </label>
44
+ <input
45
+ id="exposure"
46
+ type="range"
47
+ min="-100"
48
+ max="100"
49
+ value={adjustments.exposure}
50
+ oninput={(e) => handleChange('exposure', Number(e.currentTarget.value))}
51
+ />
52
+ </div>
53
+
54
+ <!-- Brightness -->
55
+ <div class="adjustment-control">
56
+ <label for="brightness">
57
+ <span>{$_('adjustments.brightness')}</span>
58
+ <span class="value">{adjustments.brightness}</span>
59
+ </label>
60
+ <input
61
+ id="brightness"
62
+ type="range"
63
+ min="-100"
64
+ max="100"
65
+ value={adjustments.brightness}
66
+ oninput={(e) => handleChange('brightness', Number(e.currentTarget.value))}
67
+ />
68
+ </div>
69
+
70
+ <!-- Contrast -->
71
+ <div class="adjustment-control">
72
+ <label for="contrast">
73
+ <span>{$_('adjustments.contrast')}</span>
74
+ <span class="value">{adjustments.contrast}</span>
75
+ </label>
76
+ <input
77
+ id="contrast"
78
+ type="range"
79
+ min="-100"
80
+ max="100"
81
+ value={adjustments.contrast}
82
+ oninput={(e) => handleChange('contrast', Number(e.currentTarget.value))}
83
+ />
84
+ </div>
85
+
86
+ <!-- Highlights -->
87
+ <div class="adjustment-control">
88
+ <label for="highlights">
89
+ <span>{$_('adjustments.highlights')}</span>
90
+ <span class="value">{adjustments.highlights}</span>
91
+ </label>
92
+ <input
93
+ id="highlights"
94
+ type="range"
95
+ min="-100"
96
+ max="100"
97
+ value={adjustments.highlights}
98
+ oninput={(e) => handleChange('highlights', Number(e.currentTarget.value))}
99
+ />
100
+ </div>
101
+
102
+ <!-- Shadows -->
103
+ <div class="adjustment-control">
104
+ <label for="shadows">
105
+ <span>{$_('adjustments.shadows')}</span>
106
+ <span class="value">{adjustments.shadows}</span>
107
+ </label>
108
+ <input
109
+ id="shadows"
110
+ type="range"
111
+ min="-100"
112
+ max="100"
113
+ value={adjustments.shadows}
114
+ oninput={(e) => handleChange('shadows', Number(e.currentTarget.value))}
115
+ />
116
+ </div>
117
+
118
+ <!-- Saturation -->
119
+ <div class="adjustment-control">
120
+ <label for="saturation">
121
+ <span>{$_('adjustments.saturation')}</span>
122
+ <span class="value">{adjustments.saturation}</span>
123
+ </label>
124
+ <input
125
+ id="saturation"
126
+ type="range"
127
+ min="-100"
128
+ max="100"
129
+ value={adjustments.saturation}
130
+ oninput={(e) => handleChange('saturation', Number(e.currentTarget.value))}
131
+ />
132
+ </div>
133
+
134
+ <!-- Temperature -->
135
+ <div class="adjustment-control">
136
+ <label for="temperature">
137
+ <span>{$_('adjustments.temperature')}</span>
138
+ <span class="value">{adjustments.temperature}</span>
139
+ </label>
140
+ <input
141
+ id="temperature"
142
+ type="range"
143
+ min="-100"
144
+ max="100"
145
+ value={adjustments.temperature}
146
+ oninput={(e) => handleChange('temperature', Number(e.currentTarget.value))}
147
+ />
148
+ </div>
149
+
150
+ <!-- Vignette -->
151
+ <div class="adjustment-control">
152
+ <label for="vignette">
153
+ <span>{$_('adjustments.vignette')}</span>
154
+ <span class="value">{adjustments.vignette}</span>
155
+ </label>
156
+ <input
157
+ id="vignette"
158
+ type="range"
159
+ min="-100"
160
+ max="100"
161
+ value={adjustments.vignette}
162
+ oninput={(e) => handleChange('vignette', Number(e.currentTarget.value))}
163
+ />
164
+ </div>
165
+
166
+ <!-- Blur -->
167
+ <div class="adjustment-control">
168
+ <label for="blur">
169
+ <span>{$_('adjustments.blur')}</span>
170
+ <span class="value">{adjustments.blur}</span>
171
+ </label>
172
+ <input
173
+ id="blur"
174
+ type="range"
175
+ min="0"
176
+ max="100"
177
+ value={adjustments.blur}
178
+ oninput={(e) => handleChange('blur', Number(e.currentTarget.value))}
179
+ />
180
+ </div>
181
+
182
+ <!-- Film Grain -->
183
+ <div class="adjustment-control">
184
+ <label for="grain">
185
+ <span>{$_('adjustments.grain')}</span>
186
+ <span class="value">{adjustments.grain}</span>
187
+ </label>
188
+ <input
189
+ id="grain"
190
+ type="range"
191
+ min="0"
192
+ max="100"
193
+ value={adjustments.grain}
194
+ oninput={(e) => handleChange('grain', Number(e.currentTarget.value))}
195
+ />
196
+ </div>
197
+ </div>
198
+
199
+ <div class="tool-actions">
200
+ <button class="btn btn-secondary" onclick={resetAll}>
201
+ {$_('editor.reset')}
202
+ </button>
203
+ </div>
204
+ </div>
205
+
206
+ <style>
207
+ .adjust-tool {
208
+ display: flex;
209
+ flex-direction: column;
210
+ gap: 1rem;
211
+ }
212
+
213
+ .tool-header {
214
+ display: flex;
215
+ justify-content: space-between;
216
+ align-items: center;
217
+ }
218
+
219
+ .tool-header h3 {
220
+ margin: 0;
221
+ font-size: 1.1rem;
222
+ color: #fff;
223
+ }
224
+
225
+ .close-btn {
226
+ display: flex;
227
+ align-items: center;
228
+ justify-content: center;
229
+ padding: 0.25rem;
230
+ background: transparent;
231
+ border: none;
232
+ color: #999;
233
+ cursor: pointer;
234
+ border-radius: 4px;
235
+ transition: all 0.2s;
236
+ }
237
+
238
+ .close-btn:hover {
239
+ background: #444;
240
+ color: #fff;
241
+ }
242
+
243
+ .adjustments-grid {
244
+ display: grid;
245
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
246
+ gap: 1rem;
247
+ }
248
+
249
+ @media (max-width: 767px) {
250
+
251
+ .adjustments-grid {
252
+ grid-template-columns: 1fr;
253
+ gap: 0.75rem;
254
+ max-height: 35vh;
255
+ overflow-y: auto
256
+ }
257
+ }
258
+
259
+ .adjustment-control {
260
+ display: flex;
261
+ flex-direction: column;
262
+ gap: 0.5rem;
263
+ }
264
+
265
+ @media (max-width: 767px) {
266
+
267
+ .adjustment-control {
268
+ gap: 0.3rem
269
+ }
270
+ }
271
+
272
+ .adjustment-control label {
273
+ display: flex;
274
+ justify-content: space-between;
275
+ align-items: center;
276
+ font-size: 0.85rem;
277
+ color: #ccc;
278
+ }
279
+
280
+ @media (max-width: 767px) {
281
+
282
+ .adjustment-control label {
283
+ font-size: 0.8rem
284
+ }
285
+ }
286
+
287
+ .adjustment-control .value {
288
+ color: var(--primary-color, #63b97b);
289
+ font-weight: 600;
290
+ min-width: 3rem;
291
+ text-align: right;
292
+ }
293
+
294
+ .adjustment-control input[type='range'] {
295
+ width: 100%;
296
+ height: 6px;
297
+ background: #444;
298
+ border-radius: 3px;
299
+ outline: none;
300
+ cursor: pointer;
301
+ }
302
+
303
+ .adjustment-control input[type='range']::-webkit-slider-thumb {
304
+ appearance: none;
305
+ width: 16px;
306
+ height: 16px;
307
+ background: var(--primary-color, #63b97b);
308
+ border-radius: 50%;
309
+ cursor: pointer;
310
+ transition: all 0.2s;
311
+ }
312
+
313
+ .adjustment-control input[type='range']::-webkit-slider-thumb:hover {
314
+ background: var(--primary-color, #63b97b);
315
+ transform: scale(1.1);
316
+ }
317
+
318
+ .adjustment-control input[type='range']::-moz-range-thumb {
319
+ width: 16px;
320
+ height: 16px;
321
+ background: var(--primary-color, #63b97b);
322
+ border: none;
323
+ border-radius: 50%;
324
+ cursor: pointer;
325
+ transition: all 0.2s;
326
+ }
327
+
328
+ .adjustment-control input[type='range']::-moz-range-thumb:hover {
329
+ background: var(--primary-color, #63b97b);
330
+ transform: scale(1.1);
331
+ }
332
+
333
+ .tool-actions {
334
+ display: flex;
335
+ justify-content: flex-end;
336
+ gap: 0.5rem;
337
+ }
338
+
339
+ .btn {
340
+ padding: 0.5rem 1rem;
341
+ border: none;
342
+ border-radius: 4px;
343
+ cursor: pointer;
344
+ font-size: 0.9rem;
345
+ transition: all 0.2s;
346
+ }
347
+
348
+ .btn-secondary {
349
+ background: #666;
350
+ color: #fff;
351
+ }
352
+
353
+ .btn-secondary:hover {
354
+ background: #777;
355
+ }</style>