Skip to content

341 种代码动画风格提示词、196 张参考静帧与离线挑选器,封装为 Claude Code / Codex Skill,支持一键导入与 HTML 视频渲染。

fix: preserve upstream provenance and sync contributed still metadata

happyeef26f4731fb
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..20ef7e9
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,35 @@
+# 投稿与补图规范
+
+欢迎为现有风格补充参考图、修复索引或提供可运行的代码动画。提交前先确认编号,避免重复补图;不必改写原有风格提示词。
+
+## 参考图
+
+- 建议 1920×1080、16:9,文件名与对应提示词一致,例如 `K1_扁平矢量.jpg`。默认预览优先使用纯画面,把名称、特征说明和色板放在附加说明中,保证缩略图仍能辨认画风。
+- 一张图聚焦一种画风;对比多个风格时尽量使用同一场景。现有 K1–K3 是保留的首批社区说明卡,不作为必须沿用的版式。
+- 代码生成的图片请尽量附 SVG、HTML 或生成脚本,说明渲染方法、尺寸、字体和依赖。只有 JPG 时请如实标注,不能宣称已经提供可编辑源码。
+- 注明作者、来源与适用许可或分享约定;原创投稿请明确是否同意仓库的免费使用、修改与分享约定。第三方作品保留各自授权与署名。不要把未经确认的素材声明成原创或统一标成 MIT。
+
+## 来源与索引
+
+1. 原始 `docs/source-manifest.json` 是固定基线,请勿为了让校验通过而覆盖其中的哈希。
+2. 在 `skills/code-animation-prompts/references/library-changes.json` 登记新增文件或有意修改:当前 SHA-256、原因、贡献记录;修改原文件还需保留与基线一致的 `original_sha256`。
+3. 把作者和来源加入技能的 `references/attribution.md`,使安装后的副本也保留署名。原包说明和许可保留原文。
+4. 更新挑选器和 `_统计.json`,然后运行 `python scripts/build_catalog.py`。同步 README、SKILL 与受影响的展示图,不只修改生成脚本。
+
+## 提交前检查
+
+```bash
+python scripts/validate_repo.py
+python skills/code-animation-prompts/scripts/styles.py search 水墨 --limit 3
+python skills/code-animation-prompts/scripts/styles.py show K1
+```
+
+检查新增图片在挑选器里能加载、放大、筛选;在 PR 中附预览并列出验证结果。
+
+README 图片由 `scripts/build_visuals.py` 生成,数量自动读取目录索引。安装 Playwright 后可运行:
+
+```bash
+python scripts/build_visuals.py --browser-channel chrome --skip-video
+```
+
+此命令使用本机 Chrome,更新 PNG 并保留未改动的 GIF。不指定浏览器通道时使用 Playwright 的 Chromium;需要重建 GIF 时去掉 `--skip-video` 并确保 FFmpeg 可用。
diff --git a/LICENSE.md b/LICENSE.md
index 654c235..ad7d984 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -1,6 +1,6 @@
# 来源、许可与免费分享约定
-本仓库整理并封装了用户提供的「代码动画_341种风格提示词_免费」素材包。素材位于 [`skills/code-animation-prompts/assets/library/`](skills/code-animation-prompts/assets/library),保留原始文件内容及名称。
+本仓库整理并封装了用户提供的「代码动画_341种风格提示词_免费」素材包。素材位于 [`skills/code-animation-prompts/assets/library/`](skills/code-animation-prompts/assets/library),保留原始提示词、示例、说明与许可;为接入社区素材而修改的挑选器、统计及新增文件,在技能内的 [变更清单](skills/code-animation-prompts/references/library-changes.json) 单独登记。原包的 SHA-256 基线保留在 [source-manifest.json](docs/source-manifest.json)。
## 原素材的分享约定
@@ -28,5 +28,6 @@
- **原始素材整理者**:哔哩哔哩 [**俯仰观照**](https://space.bilibili.com/3690990015613855/?spm_id_from=333.788.upinfo.detail.click),感谢其资源分享;保留原包中的说明与署名。
- **技能封装与仓库维护**:[XiaoyeCodes](https://github.com/XiaoyeCodes)。
+- **社区参考图**:K1 扁平矢量、K2 Q 版、K3 卡哇伊由 **Strange Leo (@strangeyu911-tech)** 在 [PR #1](https://github.com/XiaoyeCodes/code-animation-prompts/pull/1) 提供。三张为新增说明卡,不归入原包作者作品;本次保留原投稿 JPEG,未包含作者所述的 SVG 源文件。
- **README 预览**:基于原包静帧、挑选器及示例视频制作,相关素材权利和来源保持不变。
- **模型标注**:原始示例文件名中的模型名称沿用原包,仅为来源记录,不代表本仓库另行验证或官方背书。
diff --git a/README.md b/README.md
index d40a080..26aa91d 100644
--- a/README.md
+++ b/README.md
@@ -38,7 +38,7 @@
| 组成 | 你可以用它做什么 |
|---|---|
-| **完整原始素材库** | 阅读 341 份 Markdown 提示词,查看静帧、参考实现与原始示例 |
+| **素材库与社区补充** | 阅读 341 份 Markdown 提示词,查看静帧、参考实现与原始示例 |
| **离线风格挑选器** | 搜索、按类别筛选、放大图片、勾选风格、导出已选清单 |
| **可安装 Agent Skill** | 让 Claude Code/Codex 按需读取风格,规划镜头并制作代码动画 |
| **轻量检索脚本** | 按编号、关键词、系列查找;不必把整个素材库塞进上下文 |
@@ -170,7 +170,7 @@ skills/code-animation-prompts/assets/library/风格挑选.html
| X · code-video | 31 | 代码视频风格 |
| R · 照参考学来的 | 7 | 用代码呈现的赛博朋克等视觉参考 |
| O · 奥斯卡 98 部 | 98 | 按原素材整理的电影画风参考 |
-| **合计** | **341** | **193 张静帧 + 148 份文字参考** |
+| **合计** | **341** | **196 张静帧 + 145 份文字参考** |
→ [打开完整风格索引,每个条目均可点击](docs/STYLES.md)
@@ -200,7 +200,7 @@ code-animation-prompts/
│ ├── INSTALL.md # 安装位置、项目安装、更新方式
│ ├── STYLES.md # 341 个可点击条目
│ ├── images/ # 封面、风格墙、真实项目截图、动图
-│ └── source-manifest.json # 原始 555 个文件的 SHA-256 清单
+│ └── source-manifest.json # 原始 555 个文件的固定 SHA-256 基线
├── scripts/ # 安装、索引生成、预览图生成、校验
└── skills/code-animation-prompts/
├── SKILL.md # 技能入口
@@ -209,7 +209,7 @@ code-animation-prompts/
├── scripts/ # 检索与视频导出
└── assets/
├── starter/index.html # 新增的确定性动画接口示例
- └── library/ # 完整原始「代码动画」文件夹
+ └── library/ # 原始素材与登记过的社区补充
├── 风格挑选.html
├── 风格提示词/
├── 示例/
@@ -223,7 +223,9 @@ code-animation-prompts/
感谢原素材整理者——哔哩哔哩 [**俯仰观照**](https://space.bilibili.com/3690990015613855/?spm_id_from=333.788.upinfo.detail.click) 的资源分享。
-同时感谢 **LemoLab(Lemo-Opuscar)**、**Vincentwei1021(mg-styles-15)**、**Bae-ChangHyun(code-video)**。XiaoyeCodes 在原素材基础上增加技能封装、工具脚本和项目文档;原始素材与许可完整保留。
+感谢 [**Strange Leo (@strangeyu911-tech)**](https://github.com/strangeyu911-tech) 通过 [PR #1](https://github.com/XiaoyeCodes/code-animation-prompts/pull/1) 补充 K1–K3 三张参考说明卡。当前 196 张参考图由原包的 193 张与社区补充的 3 张组成;[来源与改动记录](skills/code-animation-prompts/references/attribution.md) 随技能一起安装。
+
+同时感谢 **LemoLab(Lemo-Opuscar)**、**Vincentwei1021(mg-styles-15)**、**Bae-ChangHyun(code-video)**。XiaoyeCodes 在原素材基础上增加技能封装、工具脚本和项目文档;原始提示词、示例和许可保留;挑选器、统计的改动与新增素材另有记录。
**免费使用,免费分享;请勿把这个合集包装成付费课程、付费 skills 或其他收费内容出售。** 第三方内容继续适用其各自许可,详见 [来源与许可](LICENSE.md)。本仓库没有把所有素材重新声明为 MIT。
@@ -233,6 +235,6 @@ code-animation-prompts/
**选一种风格,写下你的故事,让代码动起来。**
-如果这个项目对你有帮助,欢迎 Star,也欢迎分享你的代码动画作品。
+如果这个项目对你有帮助,欢迎 Star,也欢迎分享你的代码动画作品。补图前请阅读 [投稿规范](CONTRIBUTING.md)。
</div>
diff --git a/docs/STYLES.md b/docs/STYLES.md
index 3894e2f..198f0f6 100644
--- a/docs/STYLES.md
+++ b/docs/STYLES.md
@@ -1,6 +1,6 @@
# 341 种风格索引
-从原始离线挑选器生成。点击名称阅读提示词;196 个条目附静帧,其余为文字参考。
+从离线挑选器生成。点击名称阅读提示词;196 个条目附静帧,其余为文字参考。
[返回 README](../README.md)
diff --git a/docs/images/hero.png b/docs/images/hero.png
index c76baad..01e18e8 100644
Binary files a/docs/images/hero.png and b/docs/images/hero.png differ
diff --git a/docs/images/picker-search.png b/docs/images/picker-search.png
index 2b60b65..ee7e124 100644
Binary files a/docs/images/picker-search.png and b/docs/images/picker-search.png differ
diff --git a/docs/images/style-gallery.png b/docs/images/style-gallery.png
index dd7fb46..406417c 100644
Binary files a/docs/images/style-gallery.png and b/docs/images/style-gallery.png differ
diff --git a/docs/images/style-picker.png b/docs/images/style-picker.png
index b6cb222..0df3377 100644
Binary files a/docs/images/style-picker.png and b/docs/images/style-picker.png differ
diff --git a/docs/source-manifest.json b/docs/source-manifest.json
index feb8c27..3863874 100644
--- a/docs/source-manifest.json
+++ b/docs/source-manifest.json
@@ -1,8 +1,9 @@
{
+ "source": "代码动画_341种风格提示词_免费 / 代码动画",
+ "file_count": 555,
"algorithm": "sha256",
- "file_count": 558,
"files": {
- "_统计.json": "2136719bfbb16b2c3f1ad122b1ebf9fca215497da468786e1a604a7e9191085e",
+ "_统计.json": "8902bdf277a34c7722b01e5bb066dd7439ca08617e1f230804d6d02a08cea973",
"示例/B6_光速穿梭·爆炸·重聚_同一份提示词/DeepSeek-V4.1-Flash_High.html": "0b39d9b4a187ccd0d77966e9ba348606bd2086f4131ebd2bbfce1c12293e989a",
"示例/B6_光速穿梭·爆炸·重聚_同一份提示词/DeepSeek-V4.1-Flash_High.mp4": "bba1c0b1bdedc743cea27ed4b40f1e21c996540e0c2e2db68911c5664a9d6df1",
"示例/B6_光速穿梭·爆炸·重聚_同一份提示词/Opus5.5_High.html": "e5b0e47a5fcee6c224b24ec19464a66ed9ae2f121211da3bc87430981d4e67cb",
@@ -16,12 +17,13 @@
"示例/X7_英雄漫画_只给一句话/ink-and-thunder.mp4": "b2d481ce691c8b801df9cac86586b023bc995583bd610516f1e7dc7cbbbe5f14",
"示例/X7_英雄漫画_只给一句话/截图_DeepSeek做漫画的对话.png": "f9c48f60d8886845b445fd47debd6c153051e427a39c48047b1d322dbc521b09",
"示例/X7_英雄漫画_只给一句话/提示词.md": "f7f14a49374d6d1bfc16c6dd643826d47895359f196ce1c53f8e2b92a44f5662",
- "第三方许可/Lemo-Opuscar_LICENSE.txt": "18db4b0ec569066299dd4a249fd8b3932dc60586c53e7e9ada49679a5f1b970b",
"第三方许可/code-video_LICENSE.txt": "38050e030189620748dd7422344af0af619c581b4321d9f8eaff18658b799bf2",
+ "第三方许可/Lemo-Opuscar_LICENSE.txt": "18db4b0ec569066299dd4a249fd8b3932dc60586c53e7e9ada49679a5f1b970b",
"第三方许可/mg-styles-15_LICENSE.txt": "3422943eb405f1a8d2c7378d894100de5d522049bd407d41305b138253571974",
"许可与来源.md": "d0f12e3110020ebc42455960021070c3e46d2f0e93434e4eb2b84cf9e18906c9",
- "说明.md": "e3040e2f81c5bedbcf5889bed7697a6979640efda386f4f3762391c4c01c39d0",
- "风格挑选.html": "551c6569366596b7dad3c392f35273f8d30963bf38569c9ebf5b8548654dd324",
+ "说明.md": "8478d9e0bfdc9fa12d26ad454cb2be33f3498744a815bc3c5511f8dc50959971",
+ "风格挑选.html": "2175fec5e551814947fad965866747ec0527dd62bb4730bf2fc4fec7360e8490",
+ "风格提示词/A-G_代码样片/_公共函数.js": "7d06fa480b1c0e3ed3cb2e0df5cf4fd9d5707227530d455e98fda56d6733d198",
"风格提示词/A-G_代码样片/A1_字雨.jpg": "4502e6f1f2e7a06e61302f0b2f5a8a2ec70078029c0c3e003690043ae8941290",
"风格提示词/A-G_代码样片/A1_字雨.md": "123981cfe82263faf3e6688cb77907a105d9117e9efe9e37df088ccf1c45d204",
"风格提示词/A-G_代码样片/A2_光标打字.jpg": "161c583712783a0f57f8153d36be471337a7a4a9e38d171890681cb29b08a381",
@@ -74,7 +76,6 @@
"风格提示词/A-G_代码样片/G1_老胶片.md": "21b5f0dd092282d4c28e88cdbfc35a1aad8c78150ec554b0a155c9da074b602e",
"风格提示词/A-G_代码样片/G2_信号故障.jpg": "37617f38b71d8c163ee86d09d5632d5e9d1da9c539afec7b3ce160e0c696c2e9",
"风格提示词/A-G_代码样片/G2_信号故障.md": "b30468ceaf41799c88d15fea2b45a848dfb1da5560f359db5717b63e3ca459bf",
- "风格提示词/A-G_代码样片/_公共函数.js": "7d06fa480b1c0e3ed3cb2e0df5cf4fd9d5707227530d455e98fda56d6733d198",
"风格提示词/H_现成版式/H10_Creative Mode.md": "b940fc55f995be713ca10672c04d8ac74248ba9e47f716dfce0efadac4d6c68f",
"风格提示词/H_现成版式/H11_Daisy Days.md": "1eb37a3330e3632ca92bdca3e4160fdedd1126c3a4f5e57c049004ea40d21fac",
"风格提示词/H_现成版式/H12_Editorial Forest.md": "69e0a8ca40a52e2fdf866f1f6cef05d96ddacc6ca61bd343c13cadf63a34ee69",
@@ -98,7 +99,6 @@
"风格提示词/K_卡通画风/K17_几何.md": "11eefa798c11288e59f94008e68c82543bae7ef2904d96bd9f6e0028271256e3",
"风格提示词/K_卡通画风/K18_水彩.md": "d137987a34cc918a4a8fcaf92f91bd2f1764a728ca0cc7555d920b32d57a56c7",
"风格提示词/K_卡通画风/K19_厚涂.md": "9fc0bdbccae55aae6b05d51e62870ab749edcecd707cc69161166f505cc641db",
- "风格提示词/K_卡通画风/K1_扁平矢量.jpg": "7ebf11524fdbc041d5e066eeac6256e6bce5764b1a6fccadc047564a4d826a62",
"风格提示词/K_卡通画风/K1_扁平矢量.md": "2008666adc1b07b5bbfa2a9bb10b547336a30bab83c27b2b2bd37637b98b02b2",
"风格提示词/K_卡通画风/K20_剪纸.md": "209e814ede6b8086bb6149c329ca82635ca8e5e9b9d4997befe4d6c79f99380c",
"风格提示词/K_卡通画风/K21_手工纸艺.md": "f73148119922eaaea87e657ae6c58d2819478232a8fef410e933f89bbe0bbe3e",
@@ -110,7 +110,6 @@
"风格提示词/K_卡通画风/K27_低多边形.md": "20ae86d4037c8d0da97184c2dc6e7f43f464c2ed8b114ceb1a4b1449a8f9b7f3",
"风格提示词/K_卡通画风/K28_像素.md": "da346f43b0af0b5cf138301b5b157386c78726aafeb0a8dae35b793cf304d476",
"风格提示词/K_卡通画风/K29_蓝图.md": "3c5ee24f5ee12d70a50769af6d7f20f51f97a6984c64aa6ce4acdf5249e79361",
- "风格提示词/K_卡通画风/K2_Q 版.jpg": "3ea414e0a4888e2f6dd0598e4ca7b857816261157aabd3092ba0fa45d1c2bc4f",
"风格提示词/K_卡通画风/K2_Q 版.md": "cce91700945f679f58d9086d032f2a22e90fc055bcae64868dccfc03818b1077",
"风格提示词/K_卡通画风/K30_说明书线稿.md": "b11627fe9c965bc8d7389e8ccbe48181c05dbec8bbd0b17ac9725a433e410dce",
"风格提示词/K_卡通画风/K31_平铺整理.md": "420e0cba69c14e5e77a086ba3242aa0957986ebfb717e2aff2d41d5ae8fa5ba7",
@@ -121,7 +120,6 @@
"风格提示词/K_卡通画风/K36_丝网印刷.md": "ba21393874cd9c42b3952c65a5f13512eb423bb26ce643f47c4bf7803b74c9df",
"风格提示词/K_卡通画风/K37_哥特.md": "9ca50c96450ff6c0622b967cb7d96bf77b46ae85a49d8f8a6940a31d6c52a7de",
"风格提示词/K_卡通画风/K38_情景喜剧.md": "80fe39c35a4a926e7a3a12ad70cff6d54d4a5ca1a6487cfb3e63a3579e384a90",
- "风格提示词/K_卡通画风/K3_卡哇伊.jpg": "1b38796d9dd6b6da4ac762bb4cab378622d6e4a8bb3e34406a5a5b4498f7e499",
"风格提示词/K_卡通画风/K3_卡哇伊.md": "a1c83c0b408ff224ddef6af703b7c00651a0a3756824593d8cba83161013bc1d",
"风格提示词/K_卡通画风/K4_极简线条小人.md": "e5c6ad571f54186dd79cebf6553516ffb1c425d90850340abec9b960426e81e3",
"风格提示词/K_卡通画风/K5_孟菲斯扁平人.md": "95d8d589c1493067c94ec3aab5ab65def00520a140f77dc0af2ac640c0429614",
@@ -560,6 +558,5 @@
"风格提示词/Z_中国风/Z7_皮影.md": "4337ed3d97133c9e5d133c3f1c16aeecb0c0472c71c4dbc70547a4ed5e36dd0d",
"风格提示词/Z_中国风/Z8_敦煌.md": "db482af36f29bbe820ac52066949a1e7804ab242a897f29b1d736da14a161eb9",
"风格提示词/Z_中国风/Z9_青花.md": "b12952febf66a08c0dc426097b8d312cd5e4411bc2375ee5933e1055cc919cd9"
- },
- "source": "代码动画_341种风格提示词_免费 / 代码动画"
+ }
}
diff --git a/scripts/build_catalog.py b/scripts/build_catalog.py
index 0c62074..6fc9d40 100644
--- a/scripts/build_catalog.py
+++ b/scripts/build_catalog.py
@@ -31,8 +31,8 @@ def main():
assert counts == stats["bySeries"]
catalog = dict(total=len(entries), with_still=stats["withStill"],
series=[dict(id=m["id"], name=m["label"], count=counts[m["id"]]) for m in raw["meta"]], entries=entries)
- (SKILL / "references/catalog.json").write_text(json.dumps(catalog, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
- lines = ["# 341 种风格索引", "", "从原始离线挑选器生成。点击名称阅读提示词;196 个条目附静帧,其余为文字参考。", "", "[返回 README](../README.md)", ""]
+ (SKILL / "references/catalog.json").write_text(json.dumps(catalog, ensure_ascii=False, indent=2) + "\n", encoding="utf-8", newline="\n")
+ lines = [f"# {catalog['total']} 种风格索引", "", f"从离线挑选器生成。点击名称阅读提示词;{catalog['with_still']} 个条目附静帧,其余为文字参考。", "", "[返回 README](../README.md)", ""]
for series in catalog["series"]:
lines += [f'## {series["name"]} · {series["count"]}', "", "| 编号 | 风格 | 参考 |", "|---|---|---|"]
for e in entries:
@@ -43,7 +43,7 @@ def main():
lines.append(f'| {e["id"]} | [{name}]({quote(link + e["file"])}) | {shot} |')
lines.append("")
(ROOT / "docs").mkdir(exist_ok=True)
- (ROOT / "docs/STYLES.md").write_text("\n".join(lines), encoding="utf-8")
+ (ROOT / "docs/STYLES.md").write_text("\n".join(lines), encoding="utf-8", newline="\n")
print(f"Validated {len(entries)} styles and {stats['withStill']} stills.")
diff --git a/scripts/build_visuals.py b/scripts/build_visuals.py
index a7a087f..be03ba1 100644
--- a/scripts/build_visuals.py
+++ b/scripts/build_visuals.py
@@ -1,4 +1,5 @@
"""Render README artwork from the real bundled stills and picker with Playwright."""
+import argparse
import html
import json
import subprocess
@@ -12,9 +13,18 @@ BUILD = ROOT / ".build"
def main():
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--browser-channel", help="Use an installed browser, e.g. chrome or msedge")
+ parser.add_argument("--skip-video", action="store_true", help="Refresh PNGs without regenerating the unchanged GIF")
+ args = parser.parse_args()
OUT.mkdir(parents=True, exist_ok=True)
BUILD.mkdir(exist_ok=True)
- entries = json.loads((SKILL / "references/catalog.json").read_text(encoding="utf-8"))["entries"]
+ catalog = json.loads((SKILL / "references/catalog.json").read_text(encoding="utf-8"))
+ entries = catalog["entries"]
+ total = len(entries)
+ with_still = sum(bool(e["image"]) for e in entries)
+ text_only = total - with_still
+ series_count = len(catalog["series"])
by_id = {e["id"]: e for e in entries}
def card(id):
@@ -29,14 +39,14 @@ def main():
h1{{font-size:76px;line-height:1.02;letter-spacing:-3px;margin:27px 0 22px}}h1 em{{font-style:normal;color:#b7f47b}}h2{{font-size:27px;font-weight:500;margin-bottom:18px}}p{{font-size:18px;color:#9ba7ba;line-height:1.8}}
.chips{{display:flex;gap:12px;margin-top:30px}}.chips span{{border:1px solid #374739;padding:10px 15px;border-radius:30px;font-size:14px;color:#d8e8ce}}
.tiles{{display:grid;grid-template-columns:1fr 1fr;gap:15px;transform:rotate(-2deg)}}article div{{padding:12px 14px}}.foot{{margin-top:25px}}
- </style><main><section><div class="topline">THE CODE ANIMATION STYLE LIBRARY</div><h1>Code.<br>Motion.<br><em>341 possibilities.</em></h1><h2>让代码成为你的动画工作室。</h2><p>风格提示词 × 真实参考静帧 × 可安装 Agent Skill</p><div class="chips"><span>Claude Code</span><span>Codex</span><span>Free to share</span></div></section><section class="tiles">{''.join(card(x) for x in ['R1','Z5','B3','R5'])}</section></main><div class="foot"><span>XIAOYECODES / CODE-ANIMATION-PROMPTS</span><span>341 STYLES · 196 STILLS · 10 SERIES</span></div>'''
- gallery = f'''<!doctype html><meta charset="utf-8"><style>{css}body{{width:1600px;padding:52px 56px}}h1{{font-size:40px;margin:14px 0}}p{{color:#94a0b4;font-size:18px;margin-bottom:30px}}.grid{{display:grid;grid-template-columns:repeat(4,1fr);gap:20px}}.foot{{margin-top:28px}}</style><div class="topline">A SMALL WINDOW INTO 341 STYLES</div><h1>一种内容,许多种表达。</h1><p>以下为素材包自带的真实参考静帧;每张图都能通过编号找到对应提示词。</p><div class="grid">{''.join(card(x) for x in ['B1','B3','C1','Z5','H1','L1','L10','R1','R3','R5','R6','O91'])}</div><div class="foot"><span>REFERENCE STILLS FROM THE INCLUDED LIBRARY</span><span>196 WITH STILLS / 145 TEXT REFERENCES</span></div>'''
+ </style><main><section><div class="topline">THE CODE ANIMATION STYLE LIBRARY</div><h1>Code.<br>Motion.<br><em>{total} possibilities.</em></h1><h2>让代码成为你的动画工作室。</h2><p>风格提示词 × 真实参考静帧 × 可安装 Agent Skill</p><div class="chips"><span>Claude Code</span><span>Codex</span><span>Free to share</span></div></section><section class="tiles">{''.join(card(x) for x in ['R1','Z5','B3','R5'])}</section></main><div class="foot"><span>XIAOYECODES / CODE-ANIMATION-PROMPTS</span><span>{total} STYLES · {with_still} STILLS · {series_count} SERIES</span></div>'''
+ gallery = f'''<!doctype html><meta charset="utf-8"><style>{css}body{{width:1600px;padding:52px 56px}}h1{{font-size:40px;margin:14px 0}}p{{color:#94a0b4;font-size:18px;margin-bottom:30px}}.grid{{display:grid;grid-template-columns:repeat(4,1fr);gap:20px}}.foot{{margin-top:28px}}</style><div class="topline">A SMALL WINDOW INTO {total} STYLES</div><h1>一种内容,许多种表达。</h1><p>以下为素材包自带的真实参考静帧;每张图都能通过编号找到对应提示词。</p><div class="grid">{''.join(card(x) for x in ['B1','B3','C1','Z5','H1','L1','L10','R1','R3','R5','R6','O91'])}</div><div class="foot"><span>REFERENCE STILLS FROM THE INCLUDED LIBRARY</span><span>{with_still} WITH STILLS / {text_only} TEXT REFERENCES</span></div>'''
with sync_playwright() as pw:
- browser = pw.chromium.launch(headless=True)
+ browser = pw.chromium.launch(headless=True, channel=args.browser_channel)
page = browser.new_page(viewport={"width":1600,"height":1000}, device_scale_factor=1)
for name, content in [("hero", hero), ("style-gallery", gallery)]:
path = BUILD / f"{name}.html"
- path.write_text(content, encoding="utf-8")
+ path.write_text(content, encoding="utf-8", newline="\n")
page.goto(path.as_uri())
page.evaluate("document.fonts.ready")
page.locator("img").evaluate_all("imgs => Promise.all(imgs.map(i => i.decode()))")
@@ -49,6 +59,9 @@ def main():
page.wait_for_timeout(500)
page.screenshot(path=str(OUT / "picker-search.png"))
browser.close()
+ if args.skip_video:
+ print(f"README PNGs rendered: {total} styles, {with_still} stills, {text_only} text references.")
+ return
subprocess.run([
"ffmpeg", "-y", "-hide_banner", "-loglevel", "error", "-ss", "3", "-t", "4",
"-i", str(SKILL / "assets/library/示例/B6_光速穿梭·爆炸·重聚_同一份提示词/Opus5.5_High.mp4"),
diff --git a/scripts/validate_repo.py b/scripts/validate_repo.py
index ca4c649..23c253d 100644
--- a/scripts/validate_repo.py
+++ b/scripts/validate_repo.py
@@ -1,4 +1,4 @@
-"""Validate original asset hashes, catalog references and authored documentation links."""
+"""Validate the upstream baseline, documented library changes, counts and local links."""
import hashlib
import json
import re
@@ -10,17 +10,47 @@ SKILL = ROOT / "skills/code-animation-prompts"
LIBRARY = SKILL / "assets/library"
+def validate_library(library, manifest, changes):
+ original = manifest["files"]
+ modified, added = changes["modified"], changes["added"]
+ assert manifest["file_count"] == len(original), "Original manifest count differs"
+ assert set(modified) <= set(original), "Modified file is not in the original baseline"
+ assert not set(added) & set(original), "Added file overlaps the original baseline"
+ files = {p.relative_to(library).as_posix(): p for p in library.rglob("*") if p.is_file()}
+ assert set(files) == set(original) | set(added), "Library file set differs from baseline plus additions"
+ for name, record in {**modified, **added}.items():
+ assert record["contribution"] in changes["contributions"], f"Missing contribution source: {name}"
+ assert record["reason"].strip(), f"Missing change reason: {name}"
+ for name, digest in original.items():
+ if name in modified:
+ record = modified[name]
+ assert record["original_sha256"] == digest, f"Original hash mismatch: {name}"
+ digest = record["sha256"]
+ assert hashlib.sha256(files[name].read_bytes()).hexdigest() == digest, f"Unexpected library change: {name}"
+ for name, record in added.items():
+ assert hashlib.sha256(files[name].read_bytes()).hexdigest() == record["sha256"], f"Added asset changed: {name}"
+ return len(original) - len(modified), len(modified), len(added)
+
+
def main():
manifest = json.loads((ROOT / "docs/source-manifest.json").read_text(encoding="utf-8"))
- files = {p.relative_to(LIBRARY).as_posix(): p for p in LIBRARY.rglob("*") if p.is_file()}
- assert set(files) == set(manifest["files"]), "Original library file set differs"
- for name, digest in manifest["files"].items():
- assert hashlib.sha256(files[name].read_bytes()).hexdigest() == digest, f"Original file changed: {name}"
+ changes = json.loads((SKILL / "references/library-changes.json").read_text(encoding="utf-8"))
+ unchanged, modified, added = validate_library(LIBRARY, manifest, changes)
data = json.loads((SKILL / "references/catalog.json").read_text(encoding="utf-8"))
assert data["total"] == len(data["entries"]) == 341
assert len({e["id"] for e in data["entries"]}) == 341
- assert sum(bool(e["image"]) for e in data["entries"]) == data["with_still"] == 196
+ stills = sum(bool(e["image"]) for e in data["entries"])
+ assert stills == data["with_still"]
+ stats = json.loads((LIBRARY / "_统计.json").read_text(encoding="utf-8"))
+ assert (stats["total"], stats["withStill"]) == (data["total"], stills)
+ picker = json.loads(re.search(r'<script id="data" type="application/json">(.*?)</script>',
+ (LIBRARY / "风格挑选.html").read_text(encoding="utf-8"), re.S).group(1))
+ picker_entries = {e["id"]: e for e in picker["entries"]}
+ assert len(picker_entries) == len(picker["entries"]) == data["total"]
for entry in data["entries"]:
+ source = picker_entries[entry["id"]]
+ assert entry["file"] == "assets/library/" + source["file"]
+ assert entry["image"] == ("assets/library/" + source["img"] if source.get("img") else "")
for key in ["file", "image"]:
if entry[key]:
assert (SKILL / entry[key]).is_file(), entry[key]
@@ -37,9 +67,19 @@ def main():
assert (doc.parent / path).exists(), f"Broken link: {doc.relative_to(ROOT)} -> {target}"
checked += 1
readme = (ROOT / "README.md").read_text(encoding="utf-8")
+ text_only = data["total"] - stills
+ assert f'{data["total"]} 种风格提示词 · {stills} 张参考静帧' in readme, "README headline counts are stale"
+ assert f'reference_stills-{stills}-' in readme, "README badge count is stale"
+ assert f'**{stills} 种有图,{text_only} 种为文字参考**' in readme, "README summary counts are stale"
+ assert f'**{stills} 张静帧 + {text_only} 份文字参考**' in readme, "README table counts are stale"
+ skill = (SKILL / "SKILL.md").read_text(encoding="utf-8")
+ assert f'{stills} 张参考静帧' in skill and f'{text_only} 个条目没有静帧' in skill, "Skill counts are stale"
+ assert f'{stills} 个条目附静帧' in (ROOT / "docs/STYLES.md").read_text(encoding="utf-8"), "Style index count is stale"
prompt = re.search(r'```text\n(请将 https://github.com/XiaoyeCodes/code-animation-prompts.*?)(?:\n```)', readme, re.S).group(1)
assert prompt in (ROOT / "prompts/one-click-import.md").read_text(encoding="utf-8")
- print(f"PASS: {len(files)} original files unchanged; 341 styles; 196 stills; {checked} local links; import prompt consistent.")
+ print(f"PASS: {unchanged} original files unchanged; {modified} documented modifications; "
+ f"{added} contributed assets; {data['total']} styles; {stills} stills; "
+ f"{checked} local links; counts and import prompt consistent.")
if __name__ == "__main__":
diff --git "a/skills/code-animation-prompts/assets/library/\350\257\264\346\230\216.md" "b/skills/code-animation-prompts/assets/library/\350\257\264\346\230\216.md"
index 09580c0..b1a1218 100644
--- "a/skills/code-animation-prompts/assets/library/\350\257\264\346\230\216.md"
+++ "b/skills/code-animation-prompts/assets/library/\350\257\264\346\230\216.md"
@@ -1,6 +1,6 @@
# 代码动画风格提示词
-一共 **341 种**风格,每种一个提示词,Opus 5.5 能用,DeepSeek 也能用。其中 196 种带静帧。
+一共 **341 种**风格,每种一个提示词,Opus 5.5 能用,DeepSeek 也能用。其中 193 种带静帧。
有一些是从网上收集来的,很多是我自己整理、自己做出来、自己总结的。
diff --git a/skills/code-animation-prompts/references/attribution.md b/skills/code-animation-prompts/references/attribution.md
index 0ea5fad..62e273c 100644
--- a/skills/code-animation-prompts/references/attribution.md
+++ b/skills/code-animation-prompts/references/attribution.md
@@ -1,6 +1,6 @@
# 素材与许可
-本技能封装的是随项目提供的「代码动画_341种风格提示词_免费」素材包。原作者的说明、所有风格文件、示例与许可保留在 `../assets/library/`。XiaoyeCodes 负责本仓库的技能封装、检索/安装/渲染脚本和展示文档,不将素材包中的全部作品声明为自己的原创。
+本技能封装的是随项目提供的「代码动画_341种风格提示词_免费」素材包。原作者的说明、提示词、示例与许可保留在 `../assets/library/`。XiaoyeCodes 负责本仓库的技能封装、检索/安装/渲染脚本和展示文档,不将素材包中的全部作品声明为自己的原创。
- [原始说明](../assets/library/说明.md):免费使用、免费转发;禁止将这些内容包装成课程、付费 skills 或其他收费内容出售。
- [原始来源说明](../assets/library/许可与来源.md):原整理者对自制/改写部分的说明。
@@ -10,4 +10,11 @@
感谢原素材整理者——哔哩哔哩 [**俯仰观照**](https://space.bilibili.com/3690990015613855/?spm_id_from=333.788.upinfo.detail.click) 的资源分享。
+## 社区补充与原包基线
+
+- **Strange Leo (@strangeyu911-tech)**:通过 [PR #1](https://github.com/XiaoyeCodes/code-animation-prompts/pull/1) 提供 K1 扁平矢量、K2 Q 版、K3 卡哇伊三张 1920×1080 JPEG 参考说明卡。这些是社区新增作品,不是原包自带的图片。
+- 作者说明图片通过 SVG 绘制并渲染,但 PR 只提交 JPEG,未附 SVG 源文件;本仓库不把 JPEG 宣称为可编辑的矢量源码。
+- 原始素材包含 193 张静帧;加上社区补图后,当前目录有 196 张。原包 `说明.md` 中的 193 保留为历史原文,当前数量以 `catalog.json` 与挑选器为准。
+- 仓库的 `docs/source-manifest.json` 保留原始 555 个文件的哈希基线,不用当前文件重新覆盖它。[library-changes.json](library-changes.json) 记录两处有意修改(挑选器、统计)及三张新增图片的哈希、来源和原因,并随技能安装。校验分别核对原始未改动文件、登记的修改与新增素材。
+
不同来源的内容保留各自许可。免费分享约定不改写第三方 MIT 文本;整个合集不能简单标成全部 MIT。电影、艺术风格与示例名称是参考描述,不代表官方合作或背书。
diff --git a/skills/code-animation-prompts/references/library-changes.json b/skills/code-animation-prompts/references/library-changes.json
new file mode 100644
index 0000000..5b434a6
--- /dev/null
+++ b/skills/code-animation-prompts/references/library-changes.json
@@ -0,0 +1,43 @@
+{
+ "schema_version": 1,
+ "baseline_commit": "69ccbeaf0b821591a40936572c2f559d8f4cfb68",
+ "contributions": {
+ "pr-1": {
+ "author": "Strange Leo (@strangeyu911-tech)",
+ "url": "https://github.com/XiaoyeCodes/code-animation-prompts/pull/1",
+ "commit": "b8e54537a39154126d5be43c3dd43c2b02d4fc61",
+ "description": "K1/K2/K3 社区补充参考说明卡;作者说明由 SVG 渲染,提交只包含 JPEG,未提供 SVG 源文件。"
+ }
+ },
+ "modified": {
+ "_统计.json": {
+ "original_sha256": "8902bdf277a34c7722b01e5bb066dd7439ca08617e1f230804d6d02a08cea973",
+ "sha256": "2136719bfbb16b2c3f1ad122b1ebf9fca215497da468786e1a604a7e9191085e",
+ "contribution": "pr-1",
+ "reason": "将当前静帧数从 193 更新为 196。"
+ },
+ "风格挑选.html": {
+ "original_sha256": "2175fec5e551814947fad965866747ec0527dd62bb4730bf2fc4fec7360e8490",
+ "sha256": "551c6569366596b7dad3c392f35273f8d30963bf38569c9ebf5b8548654dd324",
+ "contribution": "pr-1",
+ "reason": "为 K1、K2、K3 补充参考图路径;其余挑选器内容不变。"
+ }
+ },
+ "added": {
+ "风格提示词/K_卡通画风/K1_扁平矢量.jpg": {
+ "sha256": "7ebf11524fdbc041d5e066eeac6256e6bce5764b1a6fccadc047564a4d826a62",
+ "contribution": "pr-1",
+ "reason": "社区新增风格参考说明卡,非原素材包自带静帧。"
+ },
+ "风格提示词/K_卡通画风/K2_Q 版.jpg": {
+ "sha256": "3ea414e0a4888e2f6dd0598e4ca7b857816261157aabd3092ba0fa45d1c2bc4f",
+ "contribution": "pr-1",
+ "reason": "社区新增风格参考说明卡,非原素材包自带静帧。"
+ },
+ "风格提示词/K_卡通画风/K3_卡哇伊.jpg": {
+ "sha256": "1b38796d9dd6b6da4ac762bb4cab378622d6e4a8bb3e34406a5a5b4498f7e499",
+ "contribution": "pr-1",
+ "reason": "社区新增风格参考说明卡,非原素材包自带静帧。"
+ }
+ }
+}