Skip to content

Commit 04d4be7

Browse files
committed
feat(SimpleText): add transparent background option with localization support in multiple languages
1 parent 6425a8c commit 04d4be7

6 files changed

Lines changed: 43 additions & 0 deletions

File tree

src/components/LogoEditor/SimpleText.vue

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,26 @@ defineExpose({
185185
type="color"
186186
class="color-input"
187187
aria-label="preview-background-color"
188+
:disabled="isTransparentBg"
188189
/>
189190
<span class="color-value">{{ previewBgColor.toUpperCase() }}</span>
190191
</div>
191192
</label>
193+
194+
<label class="field toggle-field">
195+
<span class="field-label">{{ t('component.simpleText.transparent') }}</span>
196+
<div class="toggle-row">
197+
<input
198+
id="transparent-bg"
199+
v-model="isTransparentBg"
200+
type="checkbox"
201+
class="toggle-input"
202+
/>
203+
<label class="toggle-label" for="transparent-bg">
204+
{{ t('component.simpleText.transparentHint') }}
205+
</label>
206+
</div>
207+
</label>
192208
</div>
193209

194210
<div class="font-card">
@@ -368,6 +384,23 @@ defineExpose({
368384
font-size: 13px;
369385
}
370386
387+
.toggle-field .toggle-row {
388+
display: inline-flex;
389+
align-items: center;
390+
gap: 10px;
391+
}
392+
393+
.toggle-input {
394+
width: 18px;
395+
height: 18px;
396+
accent-color: #f59e0b;
397+
}
398+
399+
.toggle-label {
400+
color: #e5e7eb;
401+
font-size: 14px;
402+
}
403+
371404
.font-card {
372405
border: 1px solid #1f2937;
373406
border-radius: 14px;

src/i18n/locales/en.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ export default {
101101
fontSize: 'Font size',
102102
textColor: 'Text color',
103103
previewBg: 'Preview background',
104+
transparent: 'Transparent background',
105+
transparentHint: 'Keep PNG/SVG exports transparent (JPEG remains solid).',
104106
fontTitle: 'Font & variant',
105107
fontHint: 'Loads Google Fonts on demand; variants auto-apply weight or italics.',
106108
},

src/i18n/locales/es.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ export default {
103103
fontSize: 'Tamaño de fuente',
104104
textColor: 'Color de texto',
105105
previewBg: 'Fondo de previsualización',
106+
transparent: 'Fondo transparente',
107+
transparentHint: 'Exporta PNG/SVG con fondo transparente (JPG queda sólido).',
106108
fontTitle: 'Fuente y variante',
107109
fontHint: 'Carga Google Fonts bajo demanda; las variantes aplican peso / cursiva.',
108110
},

src/i18n/locales/fr.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ export default {
104104
fontSize: 'Taille de police',
105105
textColor: 'Couleur du texte',
106106
previewBg: "Fond de l'aperçu",
107+
transparent: 'Fond transparent',
108+
transparentHint: 'Exporter PNG/SVG avec fond transparent (JPEG reste opaque).',
107109
fontTitle: 'Police et variante',
108110
fontHint: 'Charge Google Fonts à la demande ; les variantes appliquent poids / italique.',
109111
},

src/i18n/locales/ja.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ export default {
103103
fontSize: 'フォントサイズ',
104104
textColor: '文字色',
105105
previewBg: 'プレビュー背景色',
106+
transparent: '透明背景',
107+
transparentHint: 'PNG/SVG を透明で書き出し(JPEG は不透明のまま)。',
106108
fontTitle: 'フォントとバリアント',
107109
fontHint: 'Google Fonts をオンデマンドで読み込み、バリアントでウェイト/イタリックを適用します。',
108110
},

src/i18n/locales/zh-CN.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ export default {
101101
fontSize: '字号',
102102
textColor: '文字颜色',
103103
previewBg: '预览背景色',
104+
transparent: '透明背景',
105+
transparentHint: 'PNG/SVG 导出保持透明(JPG 仍为实底)。',
104106
fontTitle: '字体与变体',
105107
fontHint: '按需加载 Google Fonts,字重 / 斜体一键切换。',
106108
},

0 commit comments

Comments
 (0)