-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimage-editor.html
More file actions
3197 lines (2907 loc) · 130 KB
/
Copy pathimage-editor.html
File metadata and controls
3197 lines (2907 loc) · 130 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
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-CT8E5N460D"></script>
<script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','G-CT8E5N460D');</script>
<title>Image Editor - Free Online | No Ads, No Watermark, No Signup</title>
<meta name="description" content="Free online image editor with crop, flip, rotate, color adjustment, filters, annotations, and text overlay. Features grayscale, invert, blur, sharpen, emboss, pixelate effects. ✅ No ads ✅ No signup ✅ No watermark. Runs entirely in your browser.">
<meta name="keywords" content="image editor,online photo editor,crop image,image filter,color adjustment,annotation,text overlay,background removal,free tool, no ads, no signup, no watermark, no login, free unlimited, browser-based, no installation, local processing">
<meta name="author" content="UseMagicTools">
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1">
<meta name="googlebot" content="index, follow">
<meta name="bingbot" content="index, follow">
<meta name="revisit-after" content="7 days">
<meta name="rating" content="general">
<meta name="distribution" content="global">
<meta name="language" content="en">
<link rel="canonical" href="https://www.usemagictools.com/image-editor.html">
<link rel="alternate" hreflang="en" href="https://www.usemagictools.com/image-editor.html">
<link rel="alternate" hreflang="zh-CN" href="https://www.usemagictools.com/image-editor.html">
<link rel="alternate" hreflang="fr" href="https://www.usemagictools.com/image-editor.html">
<link rel="alternate" hreflang="es" href="https://www.usemagictools.com/image-editor.html">
<link rel="alternate" hreflang="x-default" href="https://www.usemagictools.com/image-editor.html">
<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>">
<!-- Open Graph -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://www.usemagictools.com/image-editor.html">
<meta property="og:title" content="Image Editor - Free Online | No Ads, No Watermark, No Signup">
<meta property="og:description" content="Free online image editor with crop, filter, color adjustment, and annotation features.">
<meta property="og:image" content="https://www.usemagictools.com/screenshots/image-editor-v1.webp">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:locale" content="en_US">
<meta property="og:locale:alternate" content="zh_CN">
<meta property="og:site_name" content="Magic Toolbox">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@usemagictools">
<meta name="twitter:creator" content="@usemagictools">
<meta name="twitter:title" content="Image Editor - Free Online | No Ads, No Watermark, No Signup">
<meta name="twitter:description" content="Free online image editor with crop, filter, color adjustment, and annotation.">
<meta name="twitter:image" content="https://www.usemagictools.com/screenshots/image-editor-v1.webp">
<!-- JSON-LD -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"inLanguage": ["en", "zh-CN", "fr", "es"],
"name": "Online Image Editor",
"alternateName": ["图片编辑器", "Online Photo Editor", "Image Editor"],
"url": "https://www.usemagictools.com/image-editor.html",
"description": "Online image editor with crop, filter, color adjustment, and annotation features",
"applicationCategory": "DesignApplication",
"operatingSystem": "Web Browser",
"offers": {"@type": "Offer", "price": "0", "priceCurrency": "USD"},
"featureList": ["No ads", "No signup required", "No watermark", "100% browser-based", "Unlimited usage", "Local processing"],
"author": {"@type": "Person", "name": "UseMagicTools"},
"publisher": {"@type": "Organization", "name": "Web Toolbox", "url": "https://www.usemagictools.com/"},
"screenshot": "https://www.usemagictools.com/screenshots/image-editor-v1.webp"
}
</script>
<!-- FAQ JSON-LD -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "What image formats are supported?",
"acceptedAnswer": {
"@type": "Answer",
"text": "This free online image editor supports all major formats including JPG/JPEG, PNG, WebP, GIF, and BMP. Simply drag and drop or upload your image file to start editing. The editor handles various color spaces and resolutions. All processing runs locally in your browser with no signup, no ads, and no server upload — your images remain completely private."
}
},
{
"@type": "Question",
"name": "Can I undo edits?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes, full undo and redo functionality is supported with keyboard shortcuts (Ctrl+Z for undo, Ctrl+Y for redo) and toolbar buttons. You can step back through multiple editing operations to recover any previous state of your image. The edit history is maintained throughout your session. This free browser-based editor requires no signup or account creation."
}
},
{
"@type": "Question",
"name": "What format is the edited image?",
"acceptedAnswer": {
"@type": "Answer",
"text": "You can choose to export your edited image in JPG, PNG, or WebP format with adjustable quality settings. PNG preserves transparency and lossless quality, JPG offers smaller file sizes for photographs, and WebP provides the best compression-to-quality ratio for web use. Export runs locally in your browser — this free tool requires no signup or ads."
}
},
{
"@type": "Question",
"name": "Can I batch edit images?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Currently, this editor processes one image at a time for the most precise editing control. Batch editing is not supported in this version. For bulk operations like resizing or format conversion, consider using our dedicated image compressor or image converter tools. All our tools are free, browser-based, and require no signup or installation."
}
},
{
"@type": "Question",
"name": "Are images uploaded to a server?",
"acceptedAnswer": {
"@type": "Answer",
"text": "No, absolutely not. All editing operations are performed 100% locally in your browser using Canvas API and JavaScript. Your images never leave your device and are never transmitted to any external server. This ensures complete privacy and security, making it safe to edit personal photos and sensitive images. Free to use with no signup or ads."
}
},
{
"@type": "Question",
"name": "Is this tool really free with no ads?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes, 100% free with no ads, no registration, no watermark, and no usage limits. All processing happens locally in your browser — your data is never uploaded to any server."
}
}
]
}
</script>
<!-- JSON-LD: BreadcrumbList -->
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [{"@type": "ListItem", "position": 1, "name": "Home", "item": "https://www.usemagictools.com/"}, {"@type": "ListItem", "position": 2, "name": "Image Editor", "item": "https://www.usemagictools.com/image-editor.html"}]}</script>
<!-- JSON-LD: HowTo -->
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "HowTo", "name": "How to Use Image Editor", "totalTime": "PT1M", "step": [{"@type": "HowToStep", "position": 1, "name": "Upload an Image", "text": "Drag and drop or click to upload the image you want to edit."}, {"@type": "HowToStep", "position": 2, "name": "Apply Edits", "text": "Use crop, resize, rotate, flip, adjust brightness/contrast, apply filters, and add text or drawings."}, {"@type": "HowToStep", "position": 3, "name": "Save Edited Image", "text": "Preview your changes and download the edited image in your preferred format."}]}</script>
<!-- Cropper.js -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/cropperjs@1.6.1/dist/cropper.min.css">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--bg-primary: #1a1a2e;
--bg-secondary: #16213e;
--bg-card: #0f3460;
--bg-hover: #1a4a7a;
--text-primary: #eee;
--text-secondary: #aaa;
--accent: #e94560;
--accent-light: #ff6b6b;
--success: #4ecdc4;
--warning: #ffd93d;
--border: #2a2a4a;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
min-height: 100vh;
overflow-x: hidden;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 40px;
}
/* 头部 */
.header {
background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
padding: 15px 0;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 10px;
position: relative;
}
.logo {
display: flex;
align-items: center;
gap: 10px;
}
.logo h1 {
font-size: 1.3rem;
background: linear-gradient(135deg, var(--accent), var(--accent-light));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.header-actions {
display: flex;
gap: 10px;
align-items: center;
}
/* 按钮 */
.btn {
padding: 8px 16px;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 0.85rem;
font-weight: 500;
transition: all 0.2s;
display: inline-flex;
align-items: center;
gap: 6px;
}
.btn-primary {
background: linear-gradient(135deg, var(--accent), var(--accent-light));
color: white;
}
.btn-primary:hover {
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(233, 69, 96, 0.3);
}
.btn-secondary {
background: var(--bg-card);
color: var(--text-primary);
border: 1px solid var(--border);
}
.btn-secondary:hover {
background: var(--bg-hover);
}
.btn-success {
background: linear-gradient(135deg, #22c55e, #16a34a);
color: white;
}
.btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* 主布局 */
.main-container {
display: flex;
height: calc(100vh - 60px);
}
/* 左侧工具栏 */
.toolbar {
width: 60px;
background: var(--bg-secondary);
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
padding: 10px 0;
}
.tool-btn {
width: 100%;
padding: 12px 0;
background: none;
border: none;
color: var(--text-secondary);
cursor: pointer;
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
font-size: 0.7rem;
transition: all 0.2s;
}
.tool-btn:hover {
color: var(--text-primary);
background: var(--bg-card);
}
.tool-btn.active {
color: var(--accent);
background: var(--bg-card);
border-left: 3px solid var(--accent);
}
.tool-btn .icon {
font-size: 1.2rem;
}
/* 画布区域 */
.canvas-area {
flex: 1;
display: flex;
flex-direction: column;
background: #0a0a15;
position: relative;
overflow: hidden;
}
.canvas-wrapper {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
overflow: auto;
}
#mainCanvas {
max-width: 100%;
max-height: 100%;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
/* 上传区域 */
.upload-area {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 60px;
text-align: center;
}
.upload-box {
border: 2px dashed var(--border);
border-radius: 16px;
padding: 60px 80px;
transition: all 0.3s;
cursor: pointer;
}
.upload-box:hover,
.upload-box.drag-over {
border-color: var(--accent);
background: rgba(233, 69, 96, 0.1);
}
.upload-icon {
font-size: 64px;
margin-bottom: 20px;
}
.upload-title {
font-size: 1.3rem;
margin-bottom: 10px;
}
.upload-desc {
color: var(--text-secondary);
font-size: 0.9rem;
}
/* 右侧面板 */
.panel {
width: 280px;
background: var(--bg-secondary);
border-left: 1px solid var(--border);
display: flex;
flex-direction: column;
overflow: hidden;
}
.panel-header {
padding: 15px;
border-bottom: 1px solid var(--border);
font-weight: 600;
display: flex;
align-items: center;
gap: 8px;
}
.panel-content {
flex: 1;
overflow-y: auto;
padding: 15px;
}
.panel-section {
margin-bottom: 20px;
}
.panel-section-title {
font-size: 0.8rem;
color: var(--text-secondary);
margin-bottom: 10px;
text-transform: uppercase;
}
/* 滑块 */
.slider-group {
margin-bottom: 15px;
}
.slider-label {
display: flex;
justify-content: space-between;
margin-bottom: 6px;
font-size: 0.85rem;
}
.slider-value {
color: var(--accent);
font-weight: 500;
}
input[type="range"] {
width: 100%;
height: 6px;
-webkit-appearance: none;
background: var(--bg-card);
border-radius: 3px;
outline: none;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 16px;
height: 16px;
background: var(--accent);
border-radius: 50%;
cursor: pointer;
}
/* 滤镜网格 */
.filter-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
}
.filter-item {
background: var(--bg-card);
border: 2px solid transparent;
border-radius: 8px;
padding: 8px;
cursor: pointer;
text-align: center;
transition: all 0.2s;
}
.filter-item:hover {
border-color: var(--border);
}
.filter-item.active {
border-color: var(--accent);
}
.filter-preview {
width: 100%;
aspect-ratio: 1;
background: linear-gradient(45deg, #666 25%, transparent 25%),
linear-gradient(-45deg, #666 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #666 75%),
linear-gradient(-45deg, transparent 75%, #666 75%);
background-size: 10px 10px;
background-position: 0 0, 0 5px, 5px -5px, -5px 0;
border-radius: 4px;
margin-bottom: 4px;
overflow: hidden;
}
.filter-preview img {
width: 100%;
height: 100%;
object-fit: cover;
}
.filter-name {
font-size: 0.7rem;
color: var(--text-secondary);
}
/* 颜色选择器 */
.color-picker-wrapper {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 10px;
}
input[type="color"] {
width: 40px;
height: 40px;
border: none;
border-radius: 8px;
cursor: pointer;
background: none;
}
/* 操作按钮组 */
.action-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 8px;
}
.action-btn {
padding: 10px;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 6px;
color: var(--text-primary);
cursor: pointer;
font-size: 0.8rem;
transition: all 0.2s;
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
}
.action-btn:hover {
background: var(--bg-hover);
border-color: var(--accent);
}
.action-btn .icon {
font-size: 1.2rem;
}
/* 画布尺寸输入 */
.canvas-size-inputs {
display: flex;
align-items: center;
gap: 8px;
}
.canvas-size-inputs label {
display: flex;
align-items: center;
gap: 4px;
font-size: 0.85rem;
color: var(--text-secondary);
}
.canvas-size-inputs input {
width: 80px;
padding: 6px 8px;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 6px;
color: var(--text-primary);
font-size: 0.85rem;
}
.canvas-color-row {
display: flex;
align-items: center;
gap: 10px;
}
.canvas-color-row input[type="color"] {
width: 36px;
height: 36px;
border: none;
cursor: pointer;
background: none;
padding: 0;
}
.canvas-color-row span {
font-size: 0.85rem;
color: var(--text-secondary);
}
/* 锚点 3x3 grid */
.anchor-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 4px;
width: 90px;
}
.anchor-btn {
width: 26px;
height: 26px;
border-radius: 4px;
border: 1px solid var(--border);
background: var(--bg-card);
cursor: pointer;
transition: all 0.2s;
}
.anchor-btn:hover {
border-color: var(--accent);
}
.anchor-btn.active {
background: var(--accent);
border-color: var(--accent);
}
/* 文字输入 */
.text-input {
width: 100%;
padding: 10px;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 6px;
color: var(--text-primary);
font-size: 0.9rem;
margin-bottom: 10px;
}
.text-input:focus {
outline: none;
border-color: var(--accent);
}
/* 底部工具栏 */
.bottom-bar {
padding: 10px 15px;
background: var(--bg-card);
border-top: 1px solid var(--border);
display: flex;
justify-content: space-between;
align-items: center;
}
.zoom-controls {
display: flex;
align-items: center;
gap: 10px;
}
.zoom-btn {
width: 30px;
height: 30px;
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: 4px;
color: var(--text-primary);
cursor: pointer;
font-size: 1rem;
}
.zoom-btn:hover {
background: var(--bg-hover);
}
.zoom-value {
font-size: 0.85rem;
min-width: 50px;
text-align: center;
}
/* 裁切模式 */
.crop-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.8);
display: none;
flex-direction: column;
z-index: 100;
}
.crop-overlay.active {
display: flex;
}
.crop-actions {
padding: 15px;
background: var(--bg-secondary);
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
gap: 10px;
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
.crop-container {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
overflow: auto;
min-height: 0;
}
.crop-container img {
max-width: 100%;
max-height: 100%;
}
.crop-ratio-btns {
display: flex;
gap: 8px;
}
.ratio-btn {
padding: 6px 12px;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 4px;
color: var(--text-primary);
cursor: pointer;
font-size: 0.8rem;
}
.ratio-btn:hover,
.ratio-btn.active {
border-color: var(--accent);
color: var(--accent);
}
/* 历史记录 */
.history-item {
display: flex;
align-items: center;
gap: 10px;
padding: 8px;
background: var(--bg-card);
border-radius: 6px;
margin-bottom: 6px;
font-size: 0.8rem;
cursor: pointer;
}
.history-item:hover {
background: var(--bg-hover);
}
.history-item.current {
border: 1px solid var(--accent);
}
/* 抠图模式 */
.chroma-controls {
margin-top: 10px;
}
/* 隐藏元素 */
.hidden {
display: none !important;
}
/* 响应式 */
@media (max-width: 900px) {
.main-container {
flex-direction: column;
}
.toolbar {
width: 100%;
flex-direction: row;
overflow-x: auto;
}
.tool-btn {
padding: 8px 12px;
}
.panel {
width: 100%;
max-height: 300px;
}
}
/* 文字图层样式 */
.text-layer {
position: absolute;
cursor: move;
user-select: none;
padding: 5px 10px;
border: 2px dashed transparent;
transition: border-color 0.2s;
}
.text-layer:hover,
.text-layer.selected {
border-color: var(--accent);
}
.text-layer .delete-btn {
position: absolute;
top: -10px;
right: -10px;
width: 20px;
height: 20px;
background: var(--accent);
border: none;
border-radius: 50%;
color: white;
cursor: pointer;
font-size: 12px;
display: none;
}
.text-layer:hover .delete-btn,
.text-layer.selected .delete-btn {
display: block;
}
#textLayerContainer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
display: flex;
align-items: center;
justify-content: center;
}
#textLayerContainer .text-layer {
pointer-events: auto;
white-space: nowrap;
}
/* 绘图画布 */
#drawCanvas {
position: absolute;
top: 0;
left: 0;
pointer-events: none;
}
#drawCanvas.active {
pointer-events: auto;
cursor: crosshair;
}
.features-section {
margin: 0 0 20px;
padding: 24px 0;
border-bottom: 1px solid var(--border);
}
.features-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 20px;
}
.feature-card {
display: flex;
align-items: flex-start;
gap: 12px;
}
.feature-card .feature-icon {
font-size: 24px;
flex-shrink: 0;
}
.feature-card h3 {
font-size: 15px;
color: var(--text-primary);
margin-bottom: 6px;
}
.feature-card p {
font-size: 13px;
color: var(--text-secondary);
line-height: 1.5;
}
/* FAQ */
.faq-section {
margin: 30px 0;
}
.faq-section h3 {
font-size: 1.3rem;
font-weight: 700;
margin-bottom: 20px;
color: var(--text-primary);
}
.faq-list {
display: flex;
flex-direction: column;
gap: 12px;
}
.faq-item {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 10px;
overflow: hidden;
}
.faq-question {
width: 100%;
padding: 18px 22px;
background: transparent;
border: none;
color: var(--text-primary);
font-size: 0.95rem;
font-weight: 600;
text-align: left;
cursor: pointer;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
transition: background 0.2s;
}
.faq-question:hover {
background: var(--bg-hover);
}
.faq-question::after {
content: "+";
font-size: 1.4rem;
font-weight: 300;
color: var(--text-secondary);
transition: transform 0.3s ease;
flex-shrink: 0;
}
.faq-item.active .faq-question::after {
transform: rotate(45deg);
}
.faq-answer {
max-height: 0;
overflow: hidden;
transition: max-height 0.3s ease;
}
.faq-item.active .faq-answer {
max-height: 500px;
}
.faq-answer p {
padding: 0 22px 18px;
color: var(--text-secondary);
font-size: 0.9rem;
line-height: 1.7;
}
</style>
<link rel="stylesheet" href="common/common.css">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="icon" href="/favicon.ico" sizes="48x48">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
</head>
<body>
<div class="container">
<header class="header">
<div class="logo">
<span style="font-size: 1.5rem;">🖼️</span>
<h1 data-i18n="title">Online Image Editor</h1>
</div>
<div class="header-actions">
<label for="fileInput" class="btn btn-secondary" data-i18n="openImage">📂 Open Image</label>
<button id="undoBtn" class="btn btn-secondary" disabled data-i18n="undo">↩ Undo</button>
<button id="redoBtn" class="btn btn-secondary" disabled data-i18n="redo">↪ Redo</button>
<button id="resetBtn" class="btn btn-secondary" disabled data-i18n="reset">🔄 Reset</button>
<button id="downloadBtn" class="btn btn-success" disabled data-i18n="saveImage">💾 Save Image</button>
</div>
</header>
<input type="file" id="fileInput" accept="image/*" style="display: none;">
<main class="main-container">
<!-- 左侧工具栏 -->
<aside class="toolbar">
<button class="tool-btn active" data-tool="adjust">
<span class="icon">🎨</span>
<span data-i18n="toolAdjust">Adjust</span>
</button>
<button class="tool-btn" data-tool="filter">
<span class="icon">✨</span>
<span data-i18n="toolFilter">Filter</span>
</button>
<button class="tool-btn" data-tool="crop">
<span class="icon">✂️</span>
<span data-i18n="toolCrop">Crop</span>
</button>
<button class="tool-btn" data-tool="canvas">
<span class="icon">📐</span>
<span data-i18n="toolCanvas">Canvas</span>
</button>
<button class="tool-btn" data-tool="transform">
<span class="icon">🔄</span>
<span data-i18n="toolTransform">Transform</span>
</button>
<button class="tool-btn" data-tool="draw">
<span class="icon">✏️</span>
<span data-i18n="toolDraw">Draw</span>
</button>
<button class="tool-btn" data-tool="text">
<span class="icon">📝</span>
<span data-i18n="toolText">Text</span>
</button>
<button class="tool-btn" data-tool="chroma">
<span class="icon">🎭</span>
<span data-i18n="toolChroma">Chroma</span>
</button>
</aside>
<!-- 画布区域 -->
<section class="canvas-area">
<div class="canvas-wrapper" id="canvasWrapper">
<!-- 上传区域 -->
<div class="upload-area" id="uploadArea">
<div class="upload-box" id="uploadBox">
<div class="upload-icon">🖼️</div>
<h2 class="upload-title" data-i18n="uploadTitle">Drag image here</h2>
<p class="upload-desc" data-i18n="uploadDesc">Or click to select image file (supports JPG, PNG, WebP, GIF)</p>
</div>
</div>
<!-- 主画布 -->
<canvas id="mainCanvas" class="hidden"></canvas>
<canvas id="drawCanvas" class="hidden"></canvas>
<!-- 文字图层容器 -->
<div id="textLayerContainer"></div>
</div>
<!-- 裁切覆盖层 -->
<div class="crop-overlay" id="cropOverlay">