@@ -418,6 +418,37 @@ <h2 class="text-xl md:text-2xl font-bold text-pink-500 mb-4 md:mb-6 pl-4 border-
418
418
</ span >
419
419
</ div >
420
420
</ div >
421
+
422
+ <!-- 修改 FAQ 部分的展示方式 -->
423
+ < 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 ">
424
+ {{ t.faq.title }}
425
+ </ h2 >
426
+ < div class ="space-y-4 ">
427
+ < div v-for ="(qa, index) in t.faq.items "
428
+ class ="bg-white rounded-xl md:rounded-2xl shadow-lg overflow-hidden ">
429
+ <!-- 问题标题(可点击区域) -->
430
+ < button @click ="toggleFaq(index) "
431
+ class ="w-full p-4 md:p-6 flex justify-between items-center hover:bg-gray-50 transition-colors ">
432
+ < h3 class ="text-lg font-semibold text-gray-800 text-left "> {{ qa.q }}</ h3 >
433
+ <!-- 箭头图标 -->
434
+ < svg class ="w-5 h-5 text-gray-500 transition-transform duration-300 "
435
+ :class ="{ 'rotate-180': faqOpenState[index] } "
436
+ fill ="none "
437
+ stroke ="currentColor "
438
+ viewBox ="0 0 24 24 ">
439
+ < path stroke-linecap ="round "
440
+ stroke-linejoin ="round "
441
+ stroke-width ="2 "
442
+ d ="M19 9l-7 7-7-7 "/>
443
+ </ svg >
444
+ </ button >
445
+ <!-- 答案内容(折叠面板) -->
446
+ < div v-show ="faqOpenState[index] "
447
+ class ="px-4 md:px-6 pb-4 md:pb-6 text-gray-600 border-t border-gray-100 ">
448
+ < p class ="pt-4 "> {{ qa.a }}</ p >
449
+ </ div >
450
+ </ div >
451
+ </ div >
421
452
</ div >
422
453
423
454
<!-- 页脚 -->
@@ -514,6 +545,36 @@ <h2 class="text-xl md:text-2xl font-bold text-pink-500 mb-4 md:mb-6 pl-4 border-
514
545
'Free to use'
515
546
]
516
547
}
548
+ } ,
549
+ faq : {
550
+ title : 'FAQ' ,
551
+ items : [
552
+ {
553
+ q : 'How do I add favicon to my website?' ,
554
+ 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">' ,
555
+ isOpen : false
556
+ } ,
557
+ {
558
+ q : 'What file formats are available for export?' ,
559
+ 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.' ,
560
+ isOpen : false
561
+ } ,
562
+ {
563
+ q : 'Are the fonts free to use?' ,
564
+ 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.' ,
565
+ isOpen : false
566
+ } ,
567
+ {
568
+ q : 'Can I save my logo designs?' ,
569
+ a : 'Currently, we don\'t provide a save feature. We recommend downloading your logo designs and keeping them locally on your device.' ,
570
+ isOpen : false
571
+ } ,
572
+ {
573
+ q : 'How can SVG format be opened locally after export without font style?' ,
574
+ 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.' ,
575
+ isOpen : false
576
+ }
577
+ ]
517
578
}
518
579
} ,
519
580
zh : {
@@ -545,7 +606,7 @@ <h2 class="text-xl md:text-2xl font-bold text-pink-500 mb-4 md:mb-6 pl-4 border-
545
606
textColor : '文字颜色' ,
546
607
bgColor : '背景颜色' ,
547
608
position : '文字位置' ,
548
- effects : '文字效果 ' ,
609
+ effects : '字效果 ' ,
549
610
center : '居中' ,
550
611
left : '靠左' ,
551
612
right : '靠右' ,
@@ -591,6 +652,36 @@ <h2 class="text-xl md:text-2xl font-bold text-pink-500 mb-4 md:mb-6 pl-4 border-
591
652
'免费使用'
592
653
]
593
654
}
655
+ } ,
656
+ faq : {
657
+ title : '常见问题' ,
658
+ items : [
659
+ {
660
+ q : '如何将favicon添加到我的网站?' ,
661
+ a : '您可以下载favicon.ico文件,并将其上传到您的网站根目录。然后,在HTML文件的<head>部分添加以下代码:<link rel="icon" href="/favicon.ico" type="image/x-icon">' ,
662
+ isOpen : false
663
+ } ,
664
+ {
665
+ q : '支持哪些导出格式?' ,
666
+ a : '我们支持PNG(多种尺寸)、SVG(矢量格式)和ICO(网站图标)导出。PNG适合一般用途,SVG适合可缩放图形,ICO用于网站图标。' ,
667
+ isOpen : false
668
+ } ,
669
+ {
670
+ q : '字体是免费使用的吗?' ,
671
+ a : '我们使用的是Google Fonts,可以免费用于个人和商业用途。但我们建议您查看计划使用的每种字体的具体许可条款。' ,
672
+ isOpen : false
673
+ } ,
674
+ {
675
+ q : '我可以保存我的Logo设计吗?' ,
676
+ a : '目前我们不提供保存功能。我们建议您下载Logo设计并将其保存在本地设备上。' ,
677
+ isOpen : false
678
+ } ,
679
+ {
680
+ q : '导出后SVG格式本地打开怎么没有没有字体样式?' ,
681
+ a : '这是由于您本地没有字体样式,在浏览器中打开SVG文件时,浏览器会根据SVG文件中的字体名称去查找字体文件,如果您的本地没有这些字体文件,就会显示为默认字体。' ,
682
+ isOpen : false
683
+ }
684
+ ]
594
685
}
595
686
}
596
687
}
@@ -614,7 +705,7 @@ <h2 class="text-xl md:text-2xl font-bold text-pink-500 mb-4 md:mb-6 pl-4 border-
614
705
{ label : 'Pacifico - 手写艺术' , value : 'Pacifico' } ,
615
706
{ label : 'Abril Fatface - 复古粗体' , value : 'Abril Fatface' } ,
616
707
{ label : 'Permanent Marker - 马克笔' , value : 'Permanent Marker' } ,
617
- { label : 'Montserrat - 现代几何 ' , value : 'Montserrat' } ,
708
+ { label : 'Montserrat - 现几何 ' , value : 'Montserrat' } ,
618
709
{ label : 'Oswald - 时尚凝练' , value : 'Oswald' } ,
619
710
{ label : 'Dancing Script - 优雅写' , value : 'Dancing Script' } ,
620
711
{ label : 'Quicksand - 圆润现代' , value : 'Quicksand' } ,
@@ -1142,7 +1233,8 @@ <h2 class="text-xl md:text-2xl font-bold text-pink-500 mb-4 md:mb-6 pl-4 border-
1142
1233
textGradientEnd : '#00ff00' ,
1143
1234
useBgGradient : false ,
1144
1235
bgGradientStart : '#ff0000' ,
1145
- bgGradientEnd : '#00ff00'
1236
+ bgGradientEnd : '#00ff00' ,
1237
+ faqOpenState : { } // 添加一个对象来跟踪FAQ的展开状态
1146
1238
}
1147
1239
} ,
1148
1240
computed : {
@@ -1219,7 +1311,7 @@ <h2 class="text-xl md:text-2xl font-bold text-pink-500 mb-4 md:mb-6 pl-4 border-
1219
1311
imageSmoothingQuality : 'high' // 使用高质量图像平滑
1220
1312
} ) ;
1221
1313
1222
- // 创建一个新的高分辨率canvas
1314
+ // 创建一个新的高分率canvas
1223
1315
const transparentCanvas = document . createElement ( 'canvas' ) ;
1224
1316
transparentCanvas . width = canvas . width ;
1225
1317
transparentCanvas . height = canvas . height ;
@@ -1244,19 +1336,46 @@ <h2 class="text-xl md:text-2xl font-bold text-pink-500 mb-4 md:mb-6 pl-4 border-
1244
1336
link . href = transparentCanvas . toDataURL ( 'image/png' , 1.0 ) ;
1245
1337
link . click ( ) ;
1246
1338
} else if ( format === 'svg' ) {
1339
+ // 创建渐变定义和滤镜效果
1340
+ const gradientDefs = `
1341
+ ${ this . useBgGradient ? `
1342
+ <linearGradient id="bgGradient" x1="0%" y1="0%" x2="100%" y2="0%">
1343
+ <stop offset="0%" style="stop-color:${ this . bgGradientStart } "/>
1344
+ <stop offset="100%" style="stop-color:${ this . bgGradientEnd } "/>
1345
+ </linearGradient>
1346
+ ` : '' }
1347
+ ${ this . useTextGradient ? `
1348
+ <linearGradient id="textGradient" x1="0%" y1="0%" x2="100%" y2="0%">
1349
+ <stop offset="0%" style="stop-color:${ this . textGradientStart } "/>
1350
+ <stop offset="100%" style="stop-color:${ this . textGradientEnd } "/>
1351
+ </linearGradient>
1352
+ ` : '' }
1353
+ ` ;
1354
+
1247
1355
const svgData = `
1248
1356
<svg width="${ this . size } " height="${ this . size } " xmlns="http://www.w3.org/2000/svg">
1249
- <rect width="100%" height="100%" fill="${ this . bgColor } " rx="${ this . borderRadius } " ry="${ this . borderRadius } "/>
1357
+ <defs>
1358
+ ${ gradientDefs }
1359
+
1360
+ <style type="text/css">@import url(https://fonts.googleapis.com/css?family=${ encodeURIComponent ( this . fontFamily ) } );</style>
1361
+ </defs>
1362
+
1363
+ <rect width="100%" height="100%"
1364
+ fill="${ this . useBgGradient ? 'url(#bgGradient)' : this . bgColor } "
1365
+ rx="${ this . borderRadius } "
1366
+ ry="${ this . borderRadius } "/>
1250
1367
<text
1251
1368
x="${ this . textPosition === 'center' ? '50%' : ( this . textPosition === 'left' ? '20px' : ( this . size - 20 ) + 'px' ) } "
1252
- y="50 %"
1369
+ y="${ this . verticalOffset } %"
1253
1370
font-family="${ this . fontFamily } "
1254
1371
font-size="${ this . fontSize } px"
1255
- fill="${ this . textColor } "
1372
+ font-weight="${ this . fontWeight } "
1373
+ fill="${ this . useTextGradient ? 'url(#textGradient)' : this . textColor } "
1256
1374
text-anchor="${ this . textPosition === 'center' ? 'middle' : ( this . textPosition === 'left' ? 'start' : 'end' ) } "
1257
1375
dominant-baseline="middle"
1258
1376
>${ this . logoText } </text>
1259
- </svg>`
1377
+ </svg>` ;
1378
+
1260
1379
const blob = new Blob ( [ svgData ] , { type : 'image/svg+xml' } )
1261
1380
const url = URL . createObjectURL ( blob )
1262
1381
const link = document . createElement ( 'a' )
@@ -1401,7 +1520,7 @@ <h2 class="text-xl md:text-2xl font-bold text-pink-500 mb-4 md:mb-6 pl-4 border-
1401
1520
1402
1521
tempCtx . fillText ( this . logoText , x , y )
1403
1522
1404
- // 创建32x32的最终canvas
1523
+ // 创32x32的最终canvas
1405
1524
const finalCanvas = document . createElement ( 'canvas' )
1406
1525
finalCanvas . width = 32
1407
1526
finalCanvas . height = 32
@@ -1499,6 +1618,9 @@ <h2 class="text-xl md:text-2xl font-bold text-pink-500 mb-4 md:mb-6 pl-4 border-
1499
1618
if ( logoDesignSection ) {
1500
1619
logoDesignSection . scrollIntoView ( { behavior : 'smooth' } )
1501
1620
}
1621
+ } ,
1622
+ toggleFaq ( index ) {
1623
+ this . faqOpenState [ index ] = ! this . faqOpenState [ index ]
1502
1624
}
1503
1625
} ,
1504
1626
created ( ) {
0 commit comments