feat(image-tools): 文字模板扩至47套,新增小红书/抖音/B站/公众号/视频号/封面图7大分类

- text-tpls.ts:TextTpl 加 cat 分类字段,新增6平台×5套=30套品牌风模板
  (小红书#FF2442/抖音#25F4EE#FE2C55/B站#00AEEC#FB7299/公众号深蓝红金/
  视频号#07C160/封面图高冲击),原17套归「通用」;导出 TPL_CATS + filterTpls()
- 上传前模板墙 + 编辑器侧栏模板区各加分类标签条(全部/通用/小红书/抖音/
  B站/公众号/视频号/封面图),一次只看一个平台;chip title 带 [分类] 前缀
- zh/en/描述文案同步 47套·7类
- 实测:墙47套8标签;分类计数17/5/5/5/5/5/5;点小红书模板→选图→
  自动插入2行白字粉描边;侧栏切抖音→5套;截图验收无溢出错位
This commit is contained in:
personal82555 committed 2026-10-22 10:33:55 +08:00
1 parent 4410d6f055
commit 704fabb9cb
6 files changed
+181 -29

No files matched your search

+11
View File
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file. See [standa
## Version 2026.10.16-it-tools-pro
### ✨ 文字模板扩到 47 套 · 新增 7 大平台分类
- **新增 6 平台各 5 套共 30 套**(原 17 套经典款归入「通用」):
- **小红书**:品牌红 #FF2442 种草/探店/避坑/好物/vlog(「今日份宝藏」「魔都探店」)
- **抖音**:黑底霓虹青 #25F4EE / 玫红 #FE2C55 悬念/教程/卡点/BGM(「千万别划走」「3秒学会」)
- **B站**:B站蓝 #00AEEC / 粉 #FB7299 三连/硬核/番剧/高能(「一键三连!」「前方高能」)
- **公众号**:深蓝红金 长文/干货/头条/金句/观点(「深度长文」「这个行业要变天」)
- **视频号**:微信绿 #07C160 直播/热转/私域/带货(「直播预告」「3步做出爆款封面」)
- **封面图**:高冲击封面主标/数字/大标题/科技感/极简(「封面主标题」「10个神器」)
- **分类标签条**(全部/通用/小红书/抖音/B站/公众号/视频号/封面图):上传前模板墙 + 编辑器侧栏模板区同步切换,一次只看一个平台
- 实测:墙 47 套 8 标签默认全部;分类计数 17/5/5/5/5/5/5 全对;点小红书模板→选图→自动插入2行白字粉描边;侧栏切抖音→5 套;截图验收无溢出错位
### ✨ 文字默认 100 号 + 选框拖角直接缩放字号
- **默认字号 36 → 100**(换 storage key 清掉旧缓存,新建文字/套模板均为 100 号起)
- **选框四角新增白色方块缩放手柄**:拖任意角直接调字号(以文字中心为锚点,只变大小不漂移),拖动实时重绘,松手进历史(「缩放文字 Npx」),属性面板字号同步;范围 6~600px
+1 -1
View File
@@ -310,7 +310,7 @@ tools:
image-tools:
title: Image tools
description: "In-browser image toolbox: compress, convert, resize, crop, rotate, filters, mosaic/redaction, Photoshop-style editor (layers, brush, text, selection, OCR text replacement, 17 full-copy artistic text templates with canvas rotation, content-aware erase with live preview), EXIF viewer, QR generate/scan, watermark and stitching. Images never leave your device."
description: "In-browser image toolbox: compress, convert, resize, crop, rotate, filters, mosaic/redaction, Photoshop-style editor (layers, brush, text, selection, OCR text replacement, 47 full-copy artistic text templates (7 categories: general/XHS/Douyin/Bilibili/WeChat/Channels/Cover) with canvas rotation, content-aware erase with live preview), EXIF viewer, QR generate/scan, watermark and stitching. Images never leave your device."
pdf-tools:
title: PDF tools
+1 -1
View File
@@ -307,7 +307,7 @@ tools:
image-tools:
title: 图片工具
description: 浏览器本地处理的图片工具箱:图片压缩、格式转换、调整尺寸、裁剪、旋转、滤镜、打码、PS 风格图片编辑(图层/画笔/文字/选区/OCR 改字/17套成套文案花字模板+画布旋转/智能消除笔实时预览无痕去文字水印)、EXIF 查看、二维码生成/识别、加水印、多图拼接,图片全程不上传。
description: 浏览器本地处理的图片工具箱:图片压缩、格式转换、调整尺寸、裁剪、旋转、滤镜、打码、PS 风格图片编辑(图层/画笔/文字/选区/OCR 改字/47套成套文案花字模板(通用/小红书/抖音/B站/公众号/视频号/封面图7类)+画布旋转拖角缩放/智能消除笔实时预览无痕去文字水印)、EXIF 查看、二维码生成/识别、加水印、多图拼接,图片全程不上传。
pdf-tools:
title: PDF工具
+47 -4
View File
@@ -3,7 +3,7 @@
// 图层类型:image(底图) / paint(画笔涂改层) / text(文字层) / fill(色块擦除层)
import { useStorage } from '@vueuse/core';
import { licenseHeaders } from '@/tools/license/license';
import { TEXT_TPLS, tplStyle, type TextTpl } from './text-tpls';
import { TEXT_TPLS, TPL_CATS, tplStyle, filterTpls, type TextTpl } from './text-tpls';
const props = defineProps<{ file: File; autoTpl?: TextTpl | null }>();
const emit = defineEmits<{ (e: 'error', msg: string): void; (e: 'applied'): void }>();
@@ -64,6 +64,8 @@ const brushColor = useStorage('image-tools:psx-color', '#d03050');
const tolerance = useStorage('image-tools:psx-tol', 28);
const newText = useStorage('image-tools:psx-text', '新文字');
const fontSize = useStorage('image-tools:psx-font-v2', 100); // 默认 100 号(v2 key 避免旧 36 缓存)
const tplCat = ref('全部'); // 模板分类标签
const sideTpls = computed(() => filterTpls(tplCat.value));
const fontColor = useStorage('image-tools:psx-fontcolor', '#ffffff');
const fontBold = useStorage('image-tools:psx-bold', true);
@@ -1991,14 +1993,23 @@ onBeforeUnmount(() => {
<div v-if="docW" class="psx-sec psx-tpl-sec">
<div class="psx-sec-t">
✨ 文字模板
<span class="psx-tip">点击即插入套用</span>
<span class="psx-tip">{{ TEXT_TPLS.length }} 套 · 点击即插入</span>
</div>
<div class="psx-tpl-cats">
<button
v-for="c in ['全部', ...TPL_CATS]"
:key="c"
class="psx-tpl-cat"
:class="{ on: tplCat === c }"
@click="tplCat = c"
>{{ c }}</button>
</div>
<div class="psx-tpl-grid">
<button
v-for="t in TEXT_TPLS"
v-for="t in sideTpls"
:key="t.id"
class="psx-tpl"
:title="`${t.name}:${t.parts.join(' / ')} — ${activeLayer?.type === 'text' ? '应用样式到当前文字' : '插入整组文案'}`"
:title="`[${t.cat}] ${t.name}:${t.parts.join(' / ')} — ${activeLayer?.type === 'text' ? '应用样式到当前文字' : '插入整组文案'}`"
@click="applyTpl(t)"
>
<span class="psx-tpl-txt" :style="tplStyle(t)">{{ t.parts[0] }}</span>
@@ -2262,6 +2273,38 @@ onBeforeUnmount(() => {
gap: 6px;
}
&-tpl-cats {
display: flex;
flex-wrap: wrap;
gap: 4px;
margin-bottom: 7px;
}
&-tpl-cat {
border: 1px solid rgba(128, 128, 128, 0.32);
background: transparent;
color: inherit;
border-radius: 999px;
font-size: 10.5px;
line-height: 1;
padding: 4px 8px;
cursor: pointer;
opacity: 0.75;
transition: all 0.12s;
&:hover {
opacity: 1;
border-color: #2563eb;
}
&.on {
background: #2563eb;
border-color: #2563eb;
color: #fff;
opacity: 1;
}
}
&-tpl-txt {
font-size: 11.5px;
line-height: 1.12;
+50 -5
View File
@@ -9,7 +9,7 @@ import GenHistory from '@/tools/gen-history/GenHistory.vue';
import { useGenHistory } from '@/tools/gen-history/gen-history';
import { getMachineId, licenseHeaders } from '@/tools/license/license';
import PsEditor from './PsEditor.vue';
import { TEXT_TPLS, tplStyle, type TextTpl } from './text-tpls';
import { TEXT_TPLS, TPL_CATS, tplStyle, filterTpls, type TextTpl } from './text-tpls';
prepareZXingModule({ overrideWasmUrl: wasmUrl });
const genHist = useGenHistory('image-tools');
@@ -24,7 +24,7 @@ const TABS: TabDef[] = [
{ key: 'rotate', label: '旋转', desc: '旋转或翻转图片' },
{ key: 'filter', label: '滤镜', desc: '为图片应用滤镜效果(灰度/复古/模糊等)' },
{ key: 'mosaic', label: '打码', desc: '在图片上拖拽框选区域,马赛克或涂黑打码' },
{ key: 'edit', label: '图片编辑', desc: 'PS 风格图层编辑器:画笔/智能消除笔/文字/选区/油漆桶/吸管/裁剪,文字支持画布拖拽旋转+17套成套标题文案模板点击即插(主副标题整组),消除实时预览,OCR 一键替换/消除图中文字' },
{ key: 'edit', label: '图片编辑', desc: 'PS 风格图层编辑器:画笔/智能消除笔/文字/选区/油漆桶/吸管/裁剪,文字支持画布拖拽旋转+47套成套标题文案模板(通用/小红书/抖音/B站/公众号/视频号/封面图7类切换)点击即插(主副标题整组),消除实时预览,OCR 一键替换/消除图中文字' },
{ key: 'exif', label: 'EXIF 查看', desc: '查看拍摄设备、时间、参数等 EXIF 信息' },
{ key: 'qrgen', label: '二维码生成', desc: '把文字/链接生成为二维码图片', noFile: true },
{ key: 'qrread', label: '二维码识别', desc: '识别图片中的二维码/条码内容' },
@@ -281,6 +281,9 @@ function mosaicPos(e: MouseEvent) {
const psEditor = ref<{ exportDoc: () => Promise<{ blob: Blob; detail: string; w: number; h: number }> } | null>(null);
// 上传前模板墙:先点模板记住,选图后由 PsEditor 自动套入
const pendingTpl = ref<TextTpl | null>(null);
// 模板分类:默认"全部",一次只看一个平台
const tplCat = ref('全部');
const wallTpls = computed(() => filterTpls(tplCat.value));
function chooseTpl(t: TextTpl) {
pendingTpl.value = t;
@@ -977,15 +980,24 @@ onUnmounted(() => {
<template v-else-if="tab.key === 'edit'">
<div class="it-tpl-wall">
<div class="it-tpl-wall-t">
✨ 文字模板({{ TEXT_TPLS.length }} 套成套文案)
✨ 文字模板({{ TEXT_TPLS.length }} 套 · 7 类)
<span class="it-tpl-wall-sub">点模板选图 → 整组标题自动套入画布</span>
</div>
<div class="it-tpl-cats">
<button
v-for="c in ['全部', ...TPL_CATS]"
:key="c"
class="it-tpl-cat"
:class="{ on: tplCat === c }"
@click.stop="tplCat = c"
>{{ c }}</button>
</div>
<div class="it-tpl-wall-grid">
<button
v-for="t in TEXT_TPLS"
v-for="t in wallTpls"
:key="t.id"
class="it-tpl-chip"
:title="`${t.name}:${t.parts.join(' / ')} — 点击后选图自动套用`"
:title="`[${t.cat}] ${t.name}:${t.parts.join(' / ')} — 点击后选图自动套用`"
@click.stop="chooseTpl(t)"
>
<span class="it-tpl-chip-txt" :style="tplStyle(t)">{{ t.parts[0] }}</span>
@@ -1399,6 +1411,39 @@ onUnmounted(() => {
}
}
.it-tpl-cats {
width: 100%;
display: flex;
flex-wrap: wrap;
gap: 5px;
margin-bottom: 8px;
}
.it-tpl-cat {
border: 1px solid rgba(128, 128, 128, 0.32);
background: transparent;
color: inherit;
border-radius: 999px;
font-size: 11.5px;
line-height: 1;
padding: 5px 10px;
cursor: pointer;
opacity: 0.75;
transition: all 0.12s;
&:hover {
opacity: 1;
border-color: #2563eb;
}
&.on {
background: #2563eb;
border-color: #2563eb;
color: #fff;
opacity: 1;
}
}
.it-tpl-wall-grid {
width: 100%;
display: grid;
+71 -18
View File
@@ -1,31 +1,84 @@
// 文字花字模板(成套文案):画布内与上传前模板墙共用
// ---------- 文字花字模板(共享:PsEditor 画布内 + image-tools 上传前模板墙) ----------(成套文案:点击一次插入整组标题+副标题,源自封面模板库文案) ----------
// cat 分类:通用(经典17套)+ 小红书 / 抖音 / B站 / 公众号 / 视频号 / 封面图
export interface TextTpl {
id: string; name: string; color: string;
cat: string; // 平台分类
parts: string[]; // 主标题 → 副标题 → 小字,逐行成组插入
grad?: [string, string]; bold?: boolean;
stroke?: string; strokeW?: number; shadow?: string; badge?: string;
}
/** 分类标签('全部' 由 UI 拼在最前) */
export const TPL_CATS = ['通用', '小红书', '抖音', 'B站', '公众号', '视频号', '封面图'];
export const TEXT_TPLS: TextTpl[] = [
{ id: 'wp', name: '白字黑描边·搞怪', color: '#ffffff', stroke: '#1a1a1a', strokeW: 0.10, bold: true, parts: ['最强拉轰!', '《躲汉子》'] },
{ id: 'yp', name: '黄字紫描边·热榜', color: '#ffe14d', stroke: '#7b2cbf', strokeW: 0.10, bold: true, parts: ['B站史上', '点击最高的10首MV'] },
{ id: 'wpu', name: '白字紫描边·科普', color: '#ffffff', stroke: '#8e44ad', strokeW: 0.09, bold: true, parts: ['熬夜', '如何科学修仙'] },
{ id: 'yc', name: '黄字青描边·美食', color: '#ffeb3b', stroke: '#00e5ff', strokeW: 0.11, bold: true, parts: ['辣到没朋友!川菜', '辣子鸡 · 水煮肉片'] },
{ id: 'rb', name: '红底白字·冠军', color: '#ffffff', badge: '#e53935', bold: true, parts: ['收视冠军?'] },
{ id: 'bb', name: '蓝底白字·力作', color: '#ffffff', badge: '#1e88e5', bold: true, parts: ['翻身力作?'] },
{ id: 'kb', name: '黑底黄字·高光', color: '#ffd600', badge: '#212121', bold: true, parts: ['秀翻全场!', 'ALL KILL!'] },
{ id: 'gd', name: '鎏金渐变·打卡', color: '#ffcc00', grad: ['#fff3b0', '#ff9500'], stroke: '#7a4a00', strokeW: 0.07, bold: true, parts: ['香浓拿铁', '网红打卡'] },
{ id: 'fg', name: '烈焰渐变·社会', color: '#ff4d4f', grad: ['#ff5252', '#ff8f00'], stroke: '#7a1f00', strokeW: 0.08, bold: true, parts: ['男子医院体验', '竟查出有孕在身'] },
{ id: 'ws', name: '白字投影·Vlog', color: '#ffffff', shadow: 'rgba(0,0,0,0.75)', bold: true, parts: ['Vlog', '我的旅行日记'] },
{ id: 'cb', name: '青字黑描边·热梗', color: '#18ffff', stroke: '#00364d', strokeW: 0.10, bold: true, parts: ['年轻人', '耗子尾汁'] },
{ id: 'pb', name: '粉底白字·生活', color: '#ffffff', badge: '#ec407a', bold: true, parts: ['我的', '上海日租生活'] },
{ id: 'ol', name: '空心描边·搞笑', color: 'rgba(255,255,255,0.06)', stroke: '#2962ff', strokeW: 0.10, bold: true, parts: ['你根本', '不会上厕所'] },
{ id: 'gb', name: '荧光绿描边·攻略', color: '#76ff03', stroke: '#1b3d00', strokeW: 0.09, bold: true, parts: ['角色养成攻略', '躺平吧 赶紧的'] },
{ id: 'wp2', name: '白字蓝边·职场', color: '#ffffff', stroke: '#0d47a1', strokeW: 0.10, bold: true, parts: ['合法打工人', 'SLAVE の一天 DAILY'] },
{ id: 'gd2', name: '金渐变·B站', color: '#ffe082', grad: ['#fffde7', '#ffb300'], stroke: '#5d4037', strokeW: 0.07, bold: true, parts: ['B站', '崛起的十二年'] },
{ id: 'rb2', name: '红底白字·毕业', color: '#ffffff', badge: '#c62828', bold: true, parts: ['毕业后找工作', '如此简单!'] },
// ---------- 通用(经典 17 套) ----------
{ id: 'wp', cat: '通用', name: '白字黑描边·搞怪', color: '#ffffff', stroke: '#1a1a1a', strokeW: 0.10, bold: true, parts: ['最强拉轰!', '《躲汉子》'] },
{ id: 'yp', cat: '通用', name: '黄字紫描边·热榜', color: '#ffe14d', stroke: '#7b2cbf', strokeW: 0.10, bold: true, parts: ['B站史上', '点击最高的10首MV'] },
{ id: 'wpu', cat: '通用', name: '白字紫描边·科普', color: '#ffffff', stroke: '#8e44ad', strokeW: 0.09, bold: true, parts: ['熬夜', '如何科学修仙'] },
{ id: 'yc', cat: '通用', name: '黄字青描边·美食', color: '#ffeb3b', stroke: '#00e5ff', strokeW: 0.11, bold: true, parts: ['辣到没朋友!川菜', '辣子鸡 · 水煮肉片'] },
{ id: 'rb', cat: '通用', name: '红底白字·冠军', color: '#ffffff', badge: '#e53935', bold: true, parts: ['收视冠军?'] },
{ id: 'bb', cat: '通用', name: '蓝底白字·力作', color: '#ffffff', badge: '#1e88e5', bold: true, parts: ['翻身力作?'] },
{ id: 'kb', cat: '通用', name: '黑底黄字·高光', color: '#ffd600', badge: '#212121', bold: true, parts: ['秀翻全场!', 'ALL KILL!'] },
{ id: 'gd', cat: '通用', name: '鎏金渐变·打卡', color: '#ffcc00', grad: ['#fff3b0', '#ff9500'], stroke: '#7a4a00', strokeW: 0.07, bold: true, parts: ['香浓拿铁', '网红打卡'] },
{ id: 'fg', cat: '通用', name: '烈焰渐变·社会', color: '#ff4d4f', grad: ['#ff5252', '#ff8f00'], stroke: '#7a1f00', strokeW: 0.08, bold: true, parts: ['男子医院体验', '竟查出有孕在身'] },
{ id: 'ws', cat: '通用', name: '白字投影·Vlog', color: '#ffffff', shadow: 'rgba(0,0,0,0.75)', bold: true, parts: ['Vlog', '我的旅行日记'] },
{ id: 'cb', cat: '通用', name: '青字黑描边·热梗', color: '#18ffff', stroke: '#00364d', strokeW: 0.10, bold: true, parts: ['年轻人', '耗子尾汁'] },
{ id: 'pb', cat: '通用', name: '粉底白字·生活', color: '#ffffff', badge: '#ec407a', bold: true, parts: ['我的', '上海日租生活'] },
{ id: 'ol', cat: '通用', name: '空心描边·搞笑', color: 'rgba(255,255,255,0.06)', stroke: '#2962ff', strokeW: 0.10, bold: true, parts: ['你根本', '不会上厕所'] },
{ id: 'gb', cat: '通用', name: '荧光绿描边·攻略', color: '#76ff03', stroke: '#1b3d00', strokeW: 0.09, bold: true, parts: ['角色养成攻略', '躺平吧 赶紧的'] },
{ id: 'wp2', cat: '通用', name: '白字蓝边·职场', color: '#ffffff', stroke: '#0d47a1', strokeW: 0.10, bold: true, parts: ['合法打工人', 'SLAVE の一天 DAILY'] },
{ id: 'gd2', cat: '通用', name: '金渐变·B站', color: '#ffe082', grad: ['#fffde7', '#ffb300'], stroke: '#5d4037', strokeW: 0.07, bold: true, parts: ['B站', '崛起的十二年'] },
{ id: 'rb2', cat: '通用', name: '红底白字·毕业', color: '#ffffff', badge: '#c62828', bold: true, parts: ['毕业后找工作', '如此简单!'] },
// ---------- 小红书(品牌红 #FF2442,种草/探店/避雷风) ----------
{ id: 'xhs1', cat: '小红书', name: '小红红底·种草', color: '#ffffff', badge: '#FF2442', bold: true, parts: ['今日份宝藏', '这款APP真的绝了'] },
{ id: 'xhs2', cat: '小红书', name: '白字粉描边·探店', color: '#ffffff', stroke: '#FF6B8B', strokeW: 0.10, bold: true, parts: ['魔都探店', '藏在弄堂里的咖啡馆'] },
{ id: 'xhs3', cat: '小红书', name: '粉底白字·好物', color: '#ffffff', badge: '#FF85A2', bold: true, parts: ['平价好物', '均价30的快乐'] },
{ id: 'xhs4', cat: '小红书', name: '黄字红描边·避坑', color: '#FFE14D', stroke: '#FF2442', strokeW: 0.11, bold: true, parts: ['避雷!', '这5款千万别买'] },
{ id: 'xhs5', cat: '小红书', name: '玫红底白字·vlog', color: '#ffffff', badge: '#FF3B5C', bold: true, parts: ['周末vlog', '把日子过成诗'] },
// ---------- 抖音(黑底+霓虹青 #25F4EE / 玫红 #FE2C55,爆款悬念风) ----------
{ id: 'dy1', cat: '抖音', name: '抖音黑底青字·爆款', color: '#25F4EE', badge: '#161823', bold: true, parts: ['一招教你', '播放量翻10倍'] },
{ id: 'dy2', cat: '抖音', name: '白字玫红描边·悬念', color: '#ffffff', stroke: '#FE2C55', strokeW: 0.11, bold: true, parts: ['千万别划走', '结局没想到…'] },
{ id: 'dy3', cat: '抖音', name: '霓虹青黑描边·教程', color: '#25F4EE', stroke: '#000000', strokeW: 0.11, bold: true, parts: ['3秒学会', '手机拍大片'] },
{ id: 'dy4', cat: '抖音', name: '玫红底白字·挑战', color: '#ffffff', badge: '#FE2C55', bold: true, parts: ['挑战全网', '最火BGM卡点'] },
{ id: 'dy5', cat: '抖音', name: '青玫渐变·音乐', color: '#ffffff', grad: ['#25F4EE', '#FE2C55'], stroke: '#101014', strokeW: 0.08, bold: true, parts: ['循环100遍', '这歌也太上头'] },
// ---------- B站(B站蓝 #00AEEC / 粉 #FB7299,三连/硬核风) ----------
{ id: 'bili1', cat: 'B站', name: 'B站蓝底白字·三连', color: '#ffffff', badge: '#00AEEC', bold: true, parts: ['一键三连!', '这期真的爆肝'] },
{ id: 'bili2', cat: 'B站', name: '白字B站蓝描边·硬核', color: '#ffffff', stroke: '#00AEEC', strokeW: 0.10, bold: true, parts: ['硬核拆解', '全网最全攻略'] },
{ id: 'bili3', cat: 'B站', name: 'B站粉底白字·番剧', color: '#ffffff', badge: '#FB7299', bold: true, parts: ['新番速报', '本季必追TOP5'] },
{ id: 'bili4', cat: 'B站', name: '黄字B站蓝描边·高能', color: '#FFEB3B', stroke: '#00AEEC', strokeW: 0.11, bold: true, parts: ['前方高能', '第3次神转折'] },
{ id: 'bili5', cat: 'B站', name: '白字投影·UP主', color: '#ffffff', shadow: 'rgba(0,60,90,0.85)', bold: true, parts: ['UP主精选', '百大UP合集'] },
// ---------- 公众号(深蓝/红金,深度长文风) ----------
{ id: 'gzh1', cat: '公众号', name: '深蓝底白字·深度', color: '#ffffff', badge: '#1E3A5F', bold: true, parts: ['深度长文', '普通人逆袭的3条路'] },
{ id: 'gzh2', cat: '公众号', name: '白字深蓝描边·干货', color: '#ffffff', stroke: '#2B6CB0', strokeW: 0.10, bold: true, parts: ['干货|', '一篇讲透提示词'] },
{ id: 'gzh3', cat: '公众号', name: '红底白字·头条', color: '#ffffff', badge: '#C53030', bold: true, parts: ['头条', '这个行业要变天'] },
{ id: 'gzh4', cat: '公众号', name: '黑字黄底·金句', color: '#1a1a1a', badge: '#F6E05E', bold: true, parts: ['句句戳心', '别再无效努力'] },
{ id: 'gzh5', cat: '公众号', name: '白字深投影·观点', color: '#ffffff', shadow: 'rgba(20,40,80,0.9)', bold: true, parts: ['观点', '高手都在做减法'] },
// ---------- 视频号(微信绿 #07C160,直播/私域风) ----------
{ id: 'sph1', cat: '视频号', name: '微信绿底白字·直播', color: '#ffffff', badge: '#07C160', bold: true, parts: ['直播预告', '今晚8点不见不散'] },
{ id: 'sph2', cat: '视频号', name: '白字绿描边·热转', color: '#ffffff', stroke: '#07C160', strokeW: 0.10, bold: true, parts: ['热转|', '这条视频火了'] },
{ id: 'sph3', cat: '视频号', name: '绿渐变·私域', color: '#ffffff', grad: ['#8CE99A', '#07C160'], stroke: '#04421f', strokeW: 0.08, bold: true, parts: ['私域干货', '3步做出爆款封面'] },
{ id: 'sph4', cat: '视频号', name: '白底绿字·教程', color: '#07C160', badge: '#ffffff', bold: true, parts: ['手把手教', '视频号涨粉秘籍'] },
{ id: 'sph5', cat: '视频号', name: '深底青字·带货', color: '#69F0AE', badge: '#0B1F17', bold: true, parts: ['爆单节奏', '这样挂车转化翻倍'] },
// ---------- 封面图(大标题冲击力,点击率优先) ----------
{ id: 'cov1', cat: '封面图', name: '金渐变·封面主标', color: '#FFE58F', grad: ['#FFF7CC', '#FFB300'], stroke: '#7A4A00', strokeW: 0.08, bold: true, parts: ['封面主标题', '点击率翻倍的秘密'] },
{ id: 'cov2', cat: '封面图', name: '撞色红块·数字', color: '#ffffff', badge: '#FF4D4F', bold: true, parts: ['10个神器', '第7个我真的吹爆'] },
{ id: 'cov3', cat: '封面图', name: '白字粗黑边·大标题', color: '#ffffff', stroke: '#000000', strokeW: 0.13, bold: true, parts: ['超全合集', '2026必装软件'] },
{ id: 'cov4', cat: '封面图', name: '蓝紫渐变·科技感', color: '#ffffff', grad: ['#4F46E5', '#9333EA'], stroke: '#1a1040', strokeW: 0.08, bold: true, parts: ['AI革命', '这5款工具先冲'] },
{ id: 'cov5', cat: '封面图', name: '黑底白字·极简', color: '#ffffff', badge: '#111111', bold: true, parts: ['极简封面', '留白高级感'] },
];
/** 按分类筛选(cat='' 表示全部) */
export function filterTpls(cat: string): TextTpl[] {
return !cat || cat === '全部' ? TEXT_TPLS : TEXT_TPLS.filter(t => t.cat === cat);
}
// 模板 chip 的 CSS 预览样式
export function tplStyle(t: TextTpl): Record<string, string> {
const s: Record<string, string> = { fontWeight: '700' };