孔版双色风格的口播信息动画 Skill:逐字稿 → 1080×1920 竖屏 mp4 · Risograph-style info animations for talking-head videos
修复同一帧文字重复:新增文案规则 + QA 重复检查
YIAN6557fb8b228ea423
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0cf4d3b..5393f95 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,6 +2,15 @@格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循[语义化版本](https://semver.org/lang/zh-CN/)。+## [Unreleased]++### 修复++- 同一帧文字重复:版头主题词常常和标题、正文是同一个词(如版头「年终奖」、标题「年终奖」、选项又是「年终奖」),字幕短的时候尤其明显。+ - `references/copy.md` 新增「同一帧不重复」规则:版头写更上一层的分类,标题写总称、不能是选项之一。+ - `qa.mjs` 新增重复检查,命中即 error,在样帧阶段拦下。+ - 默认模板里的两处重复一并修正:`focus` 版头「色本」→「风格」,`shot` 版头「分镜」→「原件」。+## [1.0.0] - 2026-10-11首个公开版本。First public release.diff --git a/assets/riso.js b/assets/riso.jsindex 1625e75..8193f3c 100644--- a/assets/riso.js+++ b/assets/riso.js@@ -400,6 +400,23 @@if (share > .03) out.push(['error', name(A) + ' × ' + name(B), `文字互相压住 ${(share * 100) | 0}%(有意叠印请给其中一个加 data-overprint)`, [Math.max(a.left, b.left) | 0, Math.max(a.top, b.top) | 0, ix | 0, iy | 0]]);}}+ // 重复:同一个词在一帧里出现两次,观众一眼就看出是“套模板”。版头主题词不能出现在正文里,正文两块之间也不能互相包含+ // (只比汉字和字母,去掉数字、标点;2 字以上才算)+ const words = s => s.replace(/[^\p{L}]/gu, '');+ const m1 = document.getElementById('m1');+ const topic = m1 && visible(m1) ? words(m1.textContent.split('·').pop()) : '';+ const body = texts.filter(el => !el.closest('.mast')).map(el => ({ el, w: words(el.textContent) })).filter(b => b.w.length >= 2);+ const at = el => { const r = rectOf(el); return [r.left | 0, r.top | 0, r.width | 0, r.height | 0]; };+ if (topic.length >= 2) for (const b of body)+ if (b.w.includes(topic) || topic.includes(b.w))+ out.push(['error', '#m1 × ' + name(b.el), `版头主题词“${topic}”和正文重复:版头写更上一层的分类,或留空`, at(b.el)]);+ for (let i = 0; i < body.length; i++) for (let j = i + 1; j < body.length; j++) {+ const A = body[i], B = body[j];+ if (A.el.contains(B.el) || B.el.contains(A.el)) continue;+ if (A.el.className === B.el.className) continue; // 同类并列元素(前后对比的两个单位“分钟”、几张纸条)本来就该对称+ const [s, l] = A.w.length <= B.w.length ? [A, B] : [B, A];+ if (l.w.includes(s.w)) out.push(['error', name(A.el) + ' × ' + name(B.el), `“${s.w}”在同一帧出现两次:标题写总称,不要和选项 / 正文同词`, at(s.el)]);+ }return { id: C.id, texts: texts.length, issues: out };}function hex(s) {diff --git a/references/copy.md b/references/copy.mdindex 88c316b..9b660e4 100644--- a/references/copy.md+++ b/references/copy.md@@ -44,7 +44,11 @@ B-roll 的工作是:**观众耳朵在听一句话,眼睛同时“看见”- 步骤名 / 选项:≤ 5–7 字4. **断行按意群**:`画面要跟着\n你说的话走`,不要把一个词劈在两行。5. **重点用 `[ ]` 标出**:一帧最多一处,渲染成 B 墨荧光压条(或 B 墨字,≥ 100px 时)。-6. **台词没给的内容留空**:“收敛成 6 大类”但没说哪 6 类 → 6 个只带序号的空块(`names: []`);台词说了“4 类:数字、流程、对比、金句”才填名字。不替用户编类别名、编案例、编数据。+6. **同一帧不重复**:一个词在一帧里只出现一次。+ - 版头(`mast` 左边的主题词)写比正文**更上一层的分类**(“收入”“结论”“流程”),不要抄标题或正文;想不出就只留段号(`'04'`)。+ - 标题写这几项的**总称**,不能是其中一项:`focus` 标题「年终奖」、选项也有「年终奖」是错的。+ - 字幕短、词少的时候最容易犯:可用的词不够,就让某个位置空着,不要拿同一个词填两处。`qa.mjs` 会报 error。+7. **台词没给的内容留空**:“收敛成 6 大类”但没说哪 6 类 → 6 个只带序号的空块(`names: []`);台词说了“4 类:数字、流程、对比、金句”才填名字。不替用户编类别名、编案例、编数据。## 时长diff --git a/references/production.md b/references/production.mdindex 9f6dc8c..7d82352 100644--- a/references/production.md+++ b/references/production.md@@ -63,6 +63,7 @@ node tests/smoke.mjs number quote # 只测指定模板| 小于 100px 的字对比度 < 4.5 | error || 文字互相压住(未标 `data-overprint`) | error || `fit()` 缩到最小仍放不下 | error |+| 同一帧文字重复:版头主题词出现在正文里,或标题和选项 / 正文同词(只比 2 字以上的汉字和字母;同类并列元素如两个“分钟”不算) | error || 压到右侧按钮栏(x > 930、y 880–1500),逐行量 | warn || 大字对比度偏低 | warn || 成片:时长不符、尺寸不是 1080×1920 | warn / error |diff --git a/references/style.md b/references/style.mdindex 874032e..efebe3e 100644--- a/references/style.md+++ b/references/style.md@@ -36,7 +36,7 @@```y 0–168 平台顶栏(搜索框 / 状态栏):不放任何东西-y 176–234 版头 .mast:左「段号 · 主题词」+ 右「序号」+ 下划线 —— 全系列签名+y 176–234 版头 .mast:左「段号 · 主题词」+ 右「序号」+ 下划线 —— 全系列签名(主题词不和正文重复)y 260–1330 信息区:所有文字只能在这里x > 930, y 880–1500 右侧按钮栏(点赞 / 评论 / 分享):避免放字(QA 警告)y 1330–1920 字幕床:只放网点地层 / 太阳等装饰,绝不放字diff --git a/references/templates.md b/references/templates.mdindex 5913361..a9b0f38 100644--- a/references/templates.md+++ b/references/templates.md@@ -9,7 +9,7 @@| 字段 | 说明 ||---|---|| `palette` | `pal-blue` / `pal-teal` / `pal-red` / `pal-ink` |-| `mast` | `[左, 右]`:左 =「段号 · 主题词」,右 =「序号 / 总数」 |+| `mast` | `[左, 右]`:左 =「段号 · 主题词」,右 =「序号 / 总数」。主题词写更上一层的分类,**不能和本帧正文同词**(QA 会报 error) || `duration` | 秒。用 `scripts/timing.mjs` 算 |`[ ]` 标记 = 一处 B 墨重点(压条或 B 墨字)。diff --git a/templates/focus.html b/templates/focus.htmlindex 04397af..1753c00 100644--- a/templates/focus.html+++ b/templates/focus.html@@ -30,7 +30,7 @@<script>const DATA = {palette: 'pal-blue',- mast: ['07 · 色本', '07 / 10'],+ mast: ['07 · 风格', '07 / 10'],title: '四组色本',items: ['墨蓝配荧光粉', '深青配橙', '藏青配朱红', '墨黑配明黄'], // 2–5 项,每项 ≤ 7 字pick: 0, // 重点项下标diff --git a/templates/shot.html b/templates/shot.htmlindex 957d9a5..cce9b9a 100644--- a/templates/shot.html+++ b/templates/shot.html@@ -30,7 +30,7 @@<script>const DATA = {palette: 'pal-blue',- mast: ['09 · 分镜', '09 / 10'],+ mast: ['09 · 原件', '09 / 10'],img: '', // 项目内路径,如 '../assets/shots/storyboard.png';空 = 占位slot: '分镜表截图', // 占位时写清楚这里要放什么截图note: null, // 批注框(仅真截图):{ x:.52, y:.30, w:.30, h:.22 },相对版位的比例