-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1675 lines (1598 loc) · 84.7 KB
/
index.html
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="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Logo生成器</title>
<link rel="icon" type="image/x-icon" href="favicon.ico">
<!-- 引入 Vue 3 -->
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<!-- 引入 Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- 引入 html2canvas 用于导出图片 -->
<script src="https://html2canvas.hertzen.com/dist/html2canvas.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&family=Playfair+Display:wght@400;700&family=Pacifico&family=Abril+Fatface&family=Permanent+Marker&family=Montserrat:wght@400;700&family=Oswald:wght@400;700&family=Dancing+Script&family=Quicksand:wght@400;700&family=Raleway:wght@400;700&family=Lobster&family=Comfortaa:wght@400;700&family=Righteous&family=Sacramento&family=Monoton&display=swap" rel="stylesheet">
<style>
:root {
--candy-pink: #FF69B4;
--candy-purple: #DA70D6;
}
.theme-preview span {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.color-picker-wrapper input[type="color"] {
-webkit-appearance: none;
appearance: none;
padding: 0;
border: none;
border-radius: 0.5rem;
height: 40px;
width: 40px;
cursor: pointer;
}
.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
padding: 0;
}
.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
border: none;
border-radius: 0.5rem;
}
body.modal-open {
overflow: hidden;
}
.max-h-60vh::-webkit-scrollbar {
width: 4px;
}
.max-h-60vh::-webkit-scrollbar-track {
background: transparent;
}
.max-h-60vh::-webkit-scrollbar-thumb {
background-color: #e5e7eb;
border-radius: 2px;
}
.max-h-60vh::-webkit-scrollbar-thumb:hover {
background-color: #d1d5db;
}
/* 美化滑块样式 */
input[type="range"] {
-webkit-appearance: none;
height: 6px;
background: #e5e7eb;
border-radius: 3px;
background-image: linear-gradient(#ec4899, #ec4899);
background-repeat: no-repeat;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: #ec4899;
cursor: pointer;
box-shadow: 0 0 2px 0 #555;
transition: background .3s ease-in-out;
}
input[type="range"]::-webkit-slider-runnable-track {
-webkit-appearance: none;
box-shadow: none;
border: none;
background: transparent;
}
input[type="range"]::-webkit-slider-thumb:hover {
box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ec4899;
}
</style>
</head>
<body class="min-h-screen bg-gradient-to-br from-pink-50 to-purple-50">
<div id="app">
<!-- 语言切换按钮 -->
<header class="bg-gradient-to-r from-pink-500 to-purple-500 rounded-b-2xl md:rounded-b-3xl p-8 md:p-12 text-center mb-8 md:mb-12 relative">
<!-- 语言切换按钮 -->
<div class="flex justify-center mb-6">
<div class="inline-flex bg-white/20 backdrop-blur-sm rounded-full p-1 relative">
<!-- 添加滑动背景 -->
<div class="absolute h-[calc(100%-8px)] top-1 transition-all duration-300 rounded-full bg-white"
:style="{
left: currentLang === 'en' ? '4px' : '50%',
width: 'calc(50% - 8px)'
}">
</div>
<!-- 语言按钮 -->
<button class="px-4 py-1.5 rounded-full text-sm transition-all relative z-10 w-24 text-center"
:class="currentLang === 'en' ? 'text-pink-600' : 'text-white hover:bg-white/10'"
@click="changeLang('en')">
English
</button>
<button class="px-4 py-1.5 rounded-full text-sm transition-all relative z-10 w-24 text-center"
:class="currentLang === 'zh' ? 'text-pink-600' : 'text-white hover:bg-white/10'"
@click="changeLang('zh')">
中文
</button>
</div>
</div>
<!-- 原有的标题内容 -->
<h1 class="text-3xl md:text-5xl font-bold text-white mb-2 md:mb-3">{{ t.title }}</h1>
<p class="text-base md:text-xl text-white/90">{{ t.subtitle }}</p>
</header>
<!-- 主内容区域 -->
<div class="max-w-7xl mx-auto px-4">
<!-- 特性卡片 -->
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-6 mb-8 md:mb-12 px-4 md:px-0">
<div v-for="feature in t.features"
class="bg-white rounded-xl md:rounded-2xl p-4 md:p-6 shadow-lg hover:-translate-y-1 transition-all duration-300">
<div class="text-2xl md:text-3xl mb-3 md:mb-4">{{ feature.icon }}</div>
<h3 class="text-base md:text-lg font-semibold mb-2">{{ feature.title }}</h3>
<p class="text-sm md:text-base text-gray-600">{{ feature.desc }}</p>
</div>
</div>
<!-- Logo设计区域 -->
<h2 id="logoDesign" class="text-xl md:text-2xl font-bold text-pink-500 mb-4 md:mb-6 pl-4 border-l-4 border-pink-500">
{{ t.logoDesign }}
</h2>
<div class="flex flex-col lg:flex-row gap-4 lg:gap-8 mb-8 md:mb-12">
<!-- 控制面板 -->
<div class="w-full lg:w-1/4">
<div class="bg-white rounded-xl md:rounded-2xl shadow-lg p-4 md:p-6 h-full">
<div class="space-y-6"> <!-- 添加整体间距 -->
<!-- Logo文本 -->
<div class="space-y-2">
<label class="block text-sm font-medium text-gray-700">{{ t.controls.text }}</label>
<input type="text" v-model="logoText"
class="w-full px-3 py-2 rounded-lg border border-gray-200 focus:border-pink-500 focus:ring-2 focus:ring-pink-200 outline-none transition-all">
</div>
<!-- 尺寸和圆角放在一行 -->
<div class="grid grid-cols-2 gap-4">
<div class="space-y-2">
<label class="block text-sm font-medium text-gray-700">{{ t.controls.size }}</label>
<input type="number"
disabled
v-model.number="size"
class="w-full px-3 py-2 rounded-lg border border-gray-200 focus:border-pink-500 focus:ring-2 focus:ring-pink-200 outline-none transition-all">
</div>
<div class="space-y-2">
<label class="block text-sm font-medium text-gray-700">{{ t.controls.radius }}</label>
<input type="number" v-model="borderRadius"
class="w-full px-3 py-2 rounded-lg border border-gray-200 focus:border-pink-500 focus:ring-2 focus:ring-pink-200 outline-none transition-all">
</div>
</div>
<!-- 字体选择 -->
<div class="space-y-2">
<label class="block text-sm font-medium text-gray-700">{{ t.controls.font }}</label>
<select v-model="fontFamily"
class="w-full px-3 py-2 rounded-lg border border-gray-200 focus:border-pink-500 focus:ring-2 focus:ring-pink-200 outline-none transition-all">
<option v-for="font in fonts" :value="font.value"
:style="{ fontFamily: font.value }"
class="py-2">
{{ font.label }}
</option>
</select>
</div>
<!-- 字体大小和加粗选项放在一行 -->
<div class="grid grid-cols-2 gap-4">
<div class="space-y-2">
<label class="block text-sm font-medium text-gray-700">{{ t.controls.fontSize }}</label>
<input type="number"
v-model.number="fontSize"
min="12"
max="300"
step="1"
class="w-full px-3 py-2 rounded-lg border border-gray-200 focus:border-pink-500 focus:ring-2 focus:ring-pink-200 outline-none transition-all">
</div>
<div class="space-y-2">
<label class="block text-sm font-medium text-gray-700">{{ t.controls.fontWeight }}</label>
<select v-model="fontWeight"
class="w-full px-3 py-2 rounded-lg border border-gray-200 focus:border-pink-500 focus:ring-2 focus:ring-pink-200 outline-none transition-all">
<option value="normal">Normal</option>
<option value="bold">Bold</option>
</select>
</div>
</div>
<!-- 颜色择器 -->
<div class="space-y-4"> <!-- 增加颜色选择器之间的间距 -->
<div class="space-y-2">
<label class="block text-sm font-medium text-gray-700">{{ t.controls.textColor }}</label>
<div class="flex flex-col gap-2">
<div class="flex items-center gap-2">
<input type="checkbox" v-model="useTextGradient"
class="w-4 h-4 text-pink-500 rounded border-gray-300 focus:ring-pink-500">
<span class="text-sm text-gray-600">{{ t.controls.useGradient }}</span>
</div>
<div v-if="!useTextGradient" class="flex gap-2">
<input type="color" v-model="textColor" class="w-10 h-10 rounded-lg cursor-pointer">
<input type="text" v-model="textColor"
class="flex-1 px-3 py-2 rounded-lg border border-gray-200 focus:border-pink-500 focus:ring-2 focus:ring-pink-200 outline-none transition-all">
</div>
<div v-else class="space-y-2">
<div class="flex gap-2">
<input type="color" v-model="textGradientStart" class="w-10 h-10 rounded-lg cursor-pointer">
<input type="text" v-model="textGradientStart"
class="flex-1 px-3 py-2 rounded-lg border border-gray-200 focus:border-pink-500 focus:ring-2 focus:ring-pink-200 outline-none transition-all"
placeholder="Start Color">
</div>
<div class="flex gap-2">
<input type="color" v-model="textGradientEnd" class="w-10 h-10 rounded-lg cursor-pointer">
<input type="text" v-model="textGradientEnd"
class="flex-1 px-3 py-2 rounded-lg border border-gray-200 focus:border-pink-500 focus:ring-2 focus:ring-pink-200 outline-none transition-all"
placeholder="End Color">
</div>
</div>
</div>
</div>
<div class="space-y-2">
<label class="block text-sm font-medium text-gray-700">{{ t.controls.bgColor }}</label>
<div class="flex flex-col gap-2">
<div class="flex items-center gap-2">
<input type="checkbox" v-model="useBgGradient"
class="w-4 h-4 text-pink-500 rounded border-gray-300 focus:ring-pink-500">
<span class="text-sm text-gray-600">{{ t.controls.useGradient }}</span>
</div>
<div v-if="!useBgGradient" class="flex gap-2">
<input type="color" v-model="bgColor" class="w-10 h-10 rounded-lg cursor-pointer">
<input type="text" v-model="bgColor"
class="flex-1 px-3 py-2 rounded-lg border border-gray-200 focus:border-pink-500 focus:ring-2 focus:ring-pink-200 outline-none transition-all">
</div>
<div v-else class="space-y-2">
<div class="flex gap-2">
<input type="color" v-model="bgGradientStart" class="w-10 h-10 rounded-lg cursor-pointer">
<input type="text" v-model="bgGradientStart"
class="flex-1 px-3 py-2 rounded-lg border border-gray-200 focus:border-pink-500 focus:ring-2 focus:ring-pink-200 outline-none transition-all"
placeholder="Start Color">
</div>
<div class="flex gap-2">
<input type="color" v-model="bgGradientEnd" class="w-10 h-10 rounded-lg cursor-pointer">
<input type="text" v-model="bgGradientEnd"
class="flex-1 px-3 py-2 rounded-lg border border-gray-200 focus:border-pink-500 focus:ring-2 focus:ring-pink-200 outline-none transition-all"
placeholder="End Color">
</div>
</div>
</div>
</div>
</div>
<!-- 修改垂直位置控制部分 -->
<div class="space-y-2">
<label class="block text-sm font-medium text-gray-700">{{ t.controls.verticalPosition }}</label>
<div class="flex items-center gap-4">
<input type="range"
v-model="verticalOffset"
min="0"
max="100"
step="1"
class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-pink-500">
<span class="text-sm text-gray-500 w-12">{{ verticalOffset }}%</span>
</div>
</div>
</div>
</div>
</div>
<!-- 预览区域 -->
<div class="w-full lg:w-3/4">
<div class="bg-white rounded-xl md:rounded-2xl shadow-lg p-4 md:p-8 h-full flex flex-col">
<!-- 预览区域标题 -->
<div class="flex flex-col sm:flex-row justify-between items-start sm:items-center mb-4 md:mb-6 gap-2">
<h3 class="text-base md:text-lg font-semibold text-gray-800">{{ t.preview }}</h3>
<div class="flex items-center gap-2 md:gap-4 w-full sm:w-auto">
<button @click="applyRandomTheme"
class="px-3 md:px-4 py-1.5 md:py-2 text-sm rounded-lg bg-pink-50 text-pink-600 hover:bg-pink-100 transition-colors flex items-center gap-2 flex-1 sm:flex-none justify-center">
<span>🎲</span> {{ t.actions.randomTheme }}
</button>
<div class="text-sm text-gray-500 hidden sm:block">{{ size }} x {{ size }} px</div>
</div>
</div>
<!-- Logo预览区域 - 使用 flex-grow 确保占据剩余空间 -->
<div class="bg-gray-50 rounded-lg md:rounded-xl p-4 md:p-8 flex items-center justify-center flex-grow">
<div id="logoPreview"
:style="{
width: size + 'px',
height: size + 'px',
backgroundColor: !useBgGradient ? bgColor : undefined,
background: useBgGradient ? `linear-gradient(to right, ${bgGradientStart}, ${bgGradientEnd})` : bgColor,
borderRadius: borderRadius + 'px',
display: 'flex',
alignItems: 'center',
justifyContent: getJustifyContent,
position: 'relative'
}"
class="shadow-lg transition-all duration-300">
<span :style="{
color: !useTextGradient ? textColor : undefined,
background: useTextGradient ? `-webkit-linear-gradient(left, ${textGradientStart}, ${textGradientEnd})` : undefined,
WebkitBackgroundClip: useTextGradient ? 'text' : undefined,
WebkitTextFillColor: useTextGradient ? 'transparent' : undefined,
fontSize: fontSize + 'px',
fontFamily: fontFamily,
fontWeight: fontWeight,
position: 'absolute',
left: textPosition === 'left' ? '20px' :
textPosition === 'right' ? 'auto' : '50%',
right: textPosition === 'right' ? '20px' : 'auto',
top: verticalOffset + '%',
transform: `translate(${textPosition === 'center' ? '-50%' : '0'}, -50%)`,
whiteSpace: 'nowrap'
}">{{ logoText }}</span>
</div>
</div>
<!-- 导出按钮 -->
<div class="flex flex-col sm:flex-row gap-2 sm:gap-4 mt-4 md:mt-6">
<!-- PNG导出按钮改为拉式 -->
<div class="relative" x-data="{ showSizes: false }">
<button @click="showSizes = !showSizes"
class="flex-1 bg-gradient-to-r from-pink-500 to-pink-600 text-white py-2 md:py-3 px-4 md:px-6 rounded-lg shadow hover:shadow-lg transition-all hover:-translate-y-0.5 text-sm md:text-base flex items-center justify-center gap-2 w-full">
{{ t.actions.exportPNG }}
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
</button>
<!-- 尺寸选择下拉菜单 -->
<div v-if="showSizes"
class="absolute bottom-full mb-2 right-0 bg-white rounded-lg shadow-lg p-2 min-w-[150px] z-10">
<div class="text-sm text-gray-500 px-3 py-2 border-b">{{ t.actions.selectSize }}</div>
<div class="space-y-1 mt-2">
<button v-for="size in [16, 32, 48, 64, 128, 256, 512]"
@click="exportPngWithSize(size); showSizes = false"
class="w-full text-left px-3 py-2 hover:bg-pink-50 text-gray-700 text-sm rounded transition-colors">
{{ size }}x{{ size }} px
</button>
</div>
</div>
</div>
<!-- SVG导出按钮保持不变 -->
<button @click="exportLogo('svg')"
class="flex-1 bg-gradient-to-r from-pink-400 to-pink-500 text-white py-2 md:py-3 px-4 md:px-6 rounded-lg shadow hover:shadow-lg transition-all hover:-translate-y-0.5 text-sm md:text-base">
{{ t.actions.exportSVG }}
</button>
<!-- ICO导出按钮改为简单按钮 -->
<button @click="exportIco"
class="flex-1 bg-gradient-to-r from-pink-300 to-pink-400 text-white py-2 md:py-3 px-4 md:px-6 rounded-lg shadow hover:shadow-lg transition-all hover:-translate-y-0.5 text-sm md:text-base">
{{ t.actions.exportICO }}
</button>
</div>
</div>
</div>
</div>
<!-- 修改推荐主题部分 -->
<h2 class="text-xl md:text-2xl font-bold text-pink-500 mb-4 md:mb-6 pl-4 border-l-4 border-pink-500">
{{ t.recommended }}
</h2>
<div class="grid grid-cols-5 gap-4 md:gap-6">
<div v-for="theme in localizedThemes"
class="flex flex-col items-center gap-3 cursor-pointer group"
@click="applyThemeAndScroll(theme)">
<!-- 主题预览 - 修改尺寸为 64x64 -->
<div class="w-16 h-16 rounded-xl overflow-hidden shadow-md hover:shadow-lg hover:-translate-y-1 transition-all duration-300"
:style="{
background: theme.bgGradient
? `linear-gradient(to right, ${theme.bgGradientStart}, ${theme.bgGradientEnd})`
: theme.bgColor,
borderRadius: (theme.borderRadius * 64/300) + 'px'
}">
<div class="w-full h-full flex items-center justify-center"
:style="{
fontFamily: theme.font
}">
<span class="transform transition-transform group-hover:scale-110"
:style="{
color: !theme.textGradient ? theme.textColor : undefined,
background: theme.textGradient ? `-webkit-linear-gradient(left, ${theme.textGradientStart}, ${theme.textGradientEnd})` : undefined,
WebkitBackgroundClip: theme.textGradient ? 'text' : undefined,
WebkitTextFillColor: theme.textGradient ? 'transparent' : undefined,
fontSize: (theme.fontSize * 64/300) + 'px',
fontWeight: theme.fontWeight
}">{{ theme.text }}</span>
</div>
</div>
<!-- 主题名称 - 增加内边距 -->
<span class="text-xs text-gray-600 text-center group-hover:text-pink-500 transition-colors py-1">
{{ theme.name }}
</span>
</div>
</div>
<!-- 修改 FAQ 部分的展示方式 -->
<h2 class="text-xl md:text-2xl font-bold text-pink-500 mb-4 md:mb-6 pl-4 border-l-4 border-pink-500 mt-12">
{{ t.faq.title }}
</h2>
<div class="space-y-4">
<div v-for="(qa, index) in t.faq.items"
class="bg-white rounded-xl md:rounded-2xl shadow-lg overflow-hidden">
<!-- 问题标题(可点击区域) -->
<button @click="toggleFaq(index)"
class="w-full p-4 md:p-6 flex justify-between items-center hover:bg-gray-50 transition-colors">
<h3 class="text-lg font-semibold text-gray-800 text-left">{{ qa.q }}</h3>
<!-- 箭头图标 -->
<svg class="w-5 h-5 text-gray-500 transition-transform duration-300"
:class="{ 'rotate-180': faqOpenState[index] }"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24">
<path stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M19 9l-7 7-7-7"/>
</svg>
</button>
<!-- 答案内容(折叠面板) -->
<div v-show="faqOpenState[index]"
class="px-4 md:px-6 pb-4 md:pb-6 text-gray-600 border-t border-gray-100">
<p class="pt-4">{{ qa.a }}</p>
</div>
</div>
</div>
</div>
<!-- 页脚 -->
<footer class="text-center py-6 md:py-8 mt-8 md:mt-12 bg-white">
<p class="text-sm md:text-base text-pink-600">{{ t.footer.copyright.replace('{year}', new Date().getFullYear()) }}</p>
<!-- <p class="mt-1 md:mt-2 text-sm md:text-base text-pink-400">{{ t.footer.tagline }}</p> -->
<!-- 添加免责声明 -->
<div class="mt-4 max-w-2xl mx-auto px-4 text-xs text-gray-500">
<p class="mb-2">{{ t.footer.disclaimer.title }}</p>
<p>{{ t.footer.disclaimer.content }}</p>
</div>
</footer>
</div>
<script>
const { createApp, watch } = Vue
const i18n = {
en: {
title: 'Logo Generator',
subtitle: 'Create Professional Brand Identity',
features: {
easy: {
title: 'Easy to Use',
desc: 'Intuitive interface for quick logo creation'
},
templates: {
title: 'Multiple Templates',
desc: 'Professional templates for different industries'
},
export: {
title: 'Multiple Formats',
desc: 'Export in PNG and SVG formats'
}
},
recommended: 'Recommended Themes',
logoDesign: 'Logo Design',
preview: 'Live Preview',
controls: {
text: 'Logo Text',
size: 'Size',
radius: 'Border Radius',
font: 'Font',
fontSize: 'Font Size',
textColor: 'Text Color',
bgColor: 'Background Color',
position: 'Text Position',
effects: 'Text Effects',
center: 'Center',
left: 'Left',
right: 'Right',
fontWeight: 'Font Weight',
verticalPosition: 'Vertical Position',
top: 'Top',
center: 'Center',
bottom: 'Bottom',
useGradient: 'Use Gradient'
},
actions: {
standardSize: 'Standard Size (300px)',
circular: 'Circular Logo',
exportPNG: 'Export PNG',
exportSVG: 'Export SVG',
randomTheme: 'Random Theme',
exportICO: 'Export ICO',
selectIcoSize: 'Select Icon Sizes',
download: 'Download',
cancel: 'Cancel',
selectSize: 'Select Size'
},
footer: {
copyright: '© {year} Logo Generator',
tagline: 'Made with 💖',
disclaimer: {
title: 'Disclaimer',
content: 'Users are responsible for ensuring they have the appropriate rights and licenses for any fonts used in their projects. We does not provide any font licenses and is not liable for any copyright infringement resulting from improper font usage. Users are encouraged to review and comply with the licensing terms of each font they use, especially for commercial applications.'
}
},
seo: {
title: 'Logo Generator - Create Professional Brand Logos Online',
description: 'Free online logo generator. Create professional logos for your brand with customizable fonts, colors, and styles. Export in PNG and SVG formats.',
keywords: 'logo generator, logo maker, brand logo, logo design, free logo, online logo, logo creator, professional logo, business logo, custom logo',
structuredData: {
name: 'Logo Generator',
description: 'Create professional brand logos online',
features: [
'Multiple fonts and styles',
'Customizable colors',
'PNG and SVG export',
'Professional templates',
'Free to use'
]
}
},
faq: {
title: 'FAQ',
items: [
{
q: 'How do I add favicon to my website?',
a: 'You can download the favicon.ico file and upload it to your website root directory. Then, add the following code to the <head> section of the HTML file: <link rel="icon" href="/favicon.ico" type="image/x-icon">',
isOpen: false
},
{
q: 'What file formats are available for export?',
a: 'We support PNG (various sizes), SVG (vector format), and ICO (favicon) exports. PNG is best for general use, SVG for scalable graphics, and ICO for website favicons.',
isOpen: false
},
{
q: 'Are the fonts free to use?',
a: 'We use Google Fonts which are free for personal and commercial use. However, we recommend checking the specific license terms for each font you plan to use.',
isOpen: false
},
{
q: 'Can I save my logo designs?',
a: 'Currently, we don\'t provide a save feature. We recommend downloading your logo designs and keeping them locally on your device.',
isOpen: false
},
{
q: 'How can SVG format be opened locally after export without font style?',
a: 'This is because you do not have a local font style, when you open an SVG file in your browser, the browser will look for the font file according to the font name in the SVG file, if your local font file does not have these font files, it will be displayed as the default font.',
isOpen: false
}
]
}
},
zh: {
title: 'Logo生成器',
subtitle: '打造专属品牌标识',
features: {
easy: {
title: '简单易用',
desc: '直观的界面设计,轻松调整字体、颜色、大小等属性,快速创建专业Logo'
},
templates: {
title: '多种模板',
desc: '精心设计的行业模板,为不同类型的品牌提供专业的设计方案'
},
export: {
title: '多格式导出',
desc: '支持PNG和SVG格式导出满足不同场景的使用需求'
}
},
recommended: '推荐主题',
logoDesign: 'Logo设计',
preview: '实时预览',
controls: {
text: 'Logo文本',
size: '寸',
radius: '圆角',
font: '字体',
fontSize: '字体大小',
textColor: '文字颜色',
bgColor: '背景颜色',
position: '文字位置',
effects: '字效果',
center: '居中',
left: '靠左',
right: '靠右',
fontWeight: '字体粗细',
verticalPosition: '垂直位置',
top: '顶部',
center: '居中',
bottom: '底部',
useGradient: '使用渐变'
},
actions: {
standardSize: '标准尺寸 (300px)',
circular: '圆形Logo',
exportPNG: '导出PNG',
exportSVG: '导出SVG',
randomTheme: '随机配',
exportICO: '导出ICO',
selectIcoSize: '选择图标尺寸',
download: '下载',
cancel: '取消',
selectSize: '选择尺寸'
},
footer: {
copyright: '© {year} Logo生成器',
tagline: '用制作',
disclaimer: {
title: '免责声明',
content: '用户有责任确保他们对项目中使用的任何字体拥有适当的权利和许可。我们不提供任何字体许可,也不对任何因不当使用字体而导致的版权侵权负责。鼓励用户审查并遵守他们使用的每种字体的许可条款,特别是对于商业应用程序。'
}
},
seo: {
title: 'Logo生成器 - 在线制作专业品牌标志',
description: '免费在线Logo生成器。为您的品牌创建专业的Logo,支持自定义字体、颜色和样式。支持PNG和SVG格式导出。',
keywords: 'logo生成器,logo制作,品牌logo,logo设计,免费logo,在线logo,logo创建,专业logo,企业logo,定制logo',
structuredData: {
name: 'Logo生成器',
description: '在线制作专业品牌标志',
features: [
'多种字体和样式',
'自定义颜色',
'PNG和SVG导出',
'专业模板',
'免费使用'
]
}
},
faq: {
title: '常见问题',
items: [
{
q: '如何将favicon添加到我的网站?',
a: '您可以下载favicon.ico文件,并将其上传到您的网站根目录。然后,在HTML文件的<head>部分添加以下代码:<link rel="icon" href="/favicon.ico" type="image/x-icon">',
isOpen: false
},
{
q: '支持哪些导出格式?',
a: '我们支持PNG(多种尺寸)、SVG(矢量格式)和ICO(网站图标)导出。PNG适合一般用途,SVG适合可缩放图形,ICO用于网站图标。',
isOpen: false
},
{
q: '字体是免费使用的吗?',
a: '我们使用的是Google Fonts,可以免费用于个人和商业用途。但我们建议您查看计划使用的每种字体的具体许可条款。',
isOpen: false
},
{
q: '我可以保存我的Logo设计吗?',
a: '目前我们不提供保存功能。我们建议您下载Logo设计并将其保存在本地设备上。',
isOpen: false
},
{
q: '导出后SVG格式本地打开怎么没有没有字体样式?',
a: '这是由于您本地没有字体样式,在浏览器中打开SVG文件时,浏览器会根据SVG文件中的字体名称去查找字体文件,如果您的本地没有这些字体文件,就会显示为默认字体。',
isOpen: false
}
]
}
}
}
createApp({
data() {
return {
currentLang: 'en', // 默认英文
logoText: 'LOGO', // 修改默认文本为 LOGO
size: 300,
fontSize: 48,
textColor: '#000000',
bgColor: '#ffffff',
textPosition: 'center',
fontFamily: 'Roboto',
textShadowBlur: 0,
textShadowColor: '#000000',
fonts: [
{ label: 'Roboto - 现代简约', value: 'Roboto' },
{ label: 'Playfair Display - 雅经典', value: 'Playfair Display' },
{ label: 'Pacifico - 手写艺术', value: 'Pacifico' },
{ label: 'Abril Fatface - 复古粗体', value: 'Abril Fatface' },
{ label: 'Permanent Marker - 马克笔', value: 'Permanent Marker' },
{ label: 'Montserrat - 现几何', value: 'Montserrat' },
{ label: 'Oswald - 时尚凝练', value: 'Oswald' },
{ label: 'Dancing Script - 优雅写', value: 'Dancing Script' },
{ label: 'Quicksand - 圆润现代', value: 'Quicksand' },
{ label: 'Raleway - 优雅细长', value: 'Raleway' },
{ label: 'Lobster - 复古手写', value: 'Lobster' },
{ label: 'Comfortaa - 圆润可爱', value: 'Comfortaa' },
{ label: 'Righteous - 未来科技', value: 'Righteous' },
{ label: 'Sacramento - 优雅签名', value: 'Sacramento' },
{ label: 'Monoton - 霓虹效果', value: 'Monoton' }
],
themes: [
{
name: 'Minimalist',
textColor: '#333333',
bgColor: '#ffffff',
font: 'Montserrat',
text: 'M',
borderRadius: 0,
fontSize: 180,
fontWeight: 'bold'
},
{
name: 'Tech',
textColor: '#00ff00',
bgColor: '#1a1a1a',
font: 'Roboto',
text: '></>',
borderRadius: 8,
fontSize: 120,
fontWeight: 'normal'
},
{
name: 'Creative',
textColor: '#ffffff',
bgColor: '#ff4d4d',
font: 'Pacifico',
text: 'C',
borderRadius: 100,
fontSize: 180,
fontWeight: 'normal'
},
{
name: 'Modern',
textColor: '#ffffff',
bgColor: '#2c3e50',
font: 'Raleway',
text: 'Mo',
borderRadius: 12,
fontSize: 150,
fontWeight: 'bold'
},
{
name: 'Nature',
textColor: '#2ecc71',
bgColor: '#f9f9f9',
font: 'Quicksand',
text: '🌿',
borderRadius: 20,
fontSize: 160,
fontWeight: 'normal'
},
{
name: 'Elegant',
textColor: '#d4af37',
bgColor: '#000000',
font: 'Playfair Display',
text: 'E',
borderRadius: 0,
fontSize: 180,
fontWeight: 'normal'
},
{
name: 'Playful',
textColor: '#ffffff',
bgColor: '#9b59b6',
font: 'Comic Sans MS',
text: '☺',
borderRadius: 15,
fontSize: 160,
fontWeight: 'bold'
},
{
name: 'Geometric',
textColor: '#2980b9',
bgColor: '#ecf0f1',
font: 'Montserrat',
text: '◆',
borderRadius: 10,
fontSize: 180,
fontWeight: 'normal'
},
{
name: 'Vintage',
textColor: '#8b4513',
bgColor: '#f5deb3',
font: 'Abril Fatface',
text: 'V',
borderRadius: 0,
fontSize: 170,
fontWeight: 'normal'
},
{
name: 'Digital',
textColor: '#39ff14',
bgColor: '#000000',
font: 'Orbitron',
text: '01',
borderRadius: 5,
fontSize: 140,
fontWeight: 'bold'
},
{
name: 'Neon',
textColor: '#ff00ff',
bgColor: '#000000',
font: 'Monoton',
text: 'N',
borderRadius: 25,
fontSize: 160,
fontWeight: 'normal'
},
{
name: 'Organic',
textColor: '#3c763d',
bgColor: '#dff0d8',
font: 'Dancing Script',
text: '∞',
borderRadius: 50,
fontSize: 180,
fontWeight: 'normal'
},
{
name: 'Bold',
textColor: '#ffffff',
bgColor: '#e74c3c',
font: 'Oswald',
text: 'B',
borderRadius: 0,
fontSize: 200,
fontWeight: 'bold'
},
{
name: 'Minimal',
textColor: '#000000',
bgColor: '#ffffff',
font: 'Roboto',
text: '−',
borderRadius: 4,
fontSize: 160,
fontWeight: 'normal'
},
{
name: 'Cosmic',
textColor: '#ffffff',
bgColor: '#2c3e50',
font: 'Space Mono',
text: '★',
borderRadius: 100,
fontSize: 180,
fontWeight: 'normal'
},
{
name: 'Zen',
textColor: '#34495e',
bgColor: '#f5f6fa',
font: 'Quicksand',
text: '○',
borderRadius: 100,
fontSize: 200,
fontWeight: 'normal'
},
{
name: 'Future',
textColor: '#00ff00',
bgColor: '#1a1a1a',
font: 'Righteous',
text: '>>',
borderRadius: 8,
fontSize: 140,
fontWeight: 'bold'
},
{
name: 'Retro',
textColor: '#f1c40f',
bgColor: '#8e44ad',
font: 'Permanent Marker',
text: 'R',
borderRadius: 0,
fontSize: 180,
fontWeight: 'normal'
},
{
name: 'Clean',
textColor: '#3498db',
bgColor: '#ecf0f1',
font: 'Montserrat',
text: '✓',
borderRadius: 12,
fontSize: 160,
fontWeight: 'normal'
},
{
name: 'Art',
textColor: '#e056fd',
bgColor: '#ffffff',
font: 'Pacifico',
text: '♥',
borderRadius: 20,
fontSize: 180,
fontWeight: 'normal'
},
{
name: 'Sharp',
textColor: '#ffffff',
bgColor: '#2d3436',
font: 'Oswald',
text: '△',
borderRadius: 0,
fontSize: 200,
fontWeight: 'bold'
},
{
name: 'Sweet',
textColor: '#fd79a8',
bgColor: '#fff0f5',
font: 'Quicksand',
text: '♡',
borderRadius: 15,
fontSize: 180,
fontWeight: 'normal'
},
{
name: 'Dark',
textColor: '#a8e6cf',
bgColor: '#3d3d3d',
font: 'Raleway',
text: 'D',
borderRadius: 10,
fontSize: 180,
fontWeight: 'bold'
},
{
name: 'Light',
textColor: '#3d3d3d',
bgColor: '#ffd3b6',
font: 'Montserrat',
text: 'L',
borderRadius: 10,
fontSize: 180,
fontWeight: 'normal'
},
{
name: 'Code',
textColor: '#00ff00',
bgColor: '#000000',
font: 'Source Code Pro',
text: '{ }',
borderRadius: 5,
fontSize: 140,
fontWeight: 'normal'
},
{
name: 'Soft',
textColor: '#6c5ce7',
bgColor: '#a8e6cf',
font: 'Comfortaa',
text: '~',
borderRadius: 25,
fontSize: 200,
fontWeight: 'normal'
},
{
name: 'Solid',
textColor: '#ffffff',
bgColor: '#0984e3',
font: 'Roboto',
text: '■',
borderRadius: 0,
fontSize: 200,
fontWeight: 'bold'
},
{
name: 'Fun',
textColor: '#ff7675',
bgColor: '#74b9ff',
font: 'Pacifico',
text: '☺',
borderRadius: 100,
fontSize: 160,
fontWeight: 'normal'
},
{