Skip to content

An AI skill that turns books into animated, narrated, interactive web experiences

feat: link bookshelf to public GitHub repository

yzr93b928958e12
diff --git a/CLAUDE.md b/CLAUDE.md
index b0ac718..becfe4f 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -68,10 +68,11 @@ AnimeBook/
├── site/ # 可部署的静态站点(只部署此目录)
│ ├── index.html # 书架、书封与章节目录(同一页,hash 切换;章节数据在 UNITS;localStorage 记进度)
│ ├── assets/bookshelf.png # 用户提供的 3.png 原图副本,三层照片书架,仅用于网站
-│ ├── lib/ # 共用引擎 engine.js / engine.css;书架点击区域样式、继续阅读与 GitHub 配置在 bookshelf.*;目录页单元小图 unit-art.js
+│ ├── lib/ # 共用引擎 engine.js / engine.css;书架点击区域样式与继续阅读在 bookshelf.*,GitHub 链接在 index.html;目录页单元小图 unit-art.js
│ ├── chNN/ # ch01–ch68 每章一个目录:index.html(本章步骤与题目)、audio/en/(MP3 与 timings.js)
│ └── math-notebook/ # 第二本:封面与目录、独立 lib/ 引擎、unit-art.js、ch01–ch03 与现有 MP3
-├── .git/ # 本地 Git 仓库,尚未配置远程
+├── LICENSE # 用户创建 GitHub 仓库时选择的 MIT 许可证
+├── .git/ # origin: https://github.com/DozenTwelve/Papermorph.git
└── .DS_Store # macOS 自动生成的目录信息
```
@@ -104,7 +105,7 @@ SVG 将 PNG 以 data URL 嵌入,单个文件自包含;仍然是位图,放
5. 数学判题检查数学含义。第一章的自然数按从 1 开始的约定,whole numbers 包含 0;同一个数可以属于多个类别。
6. 数学公式与图形应保持准确。角色、颜色和动效不能遮挡标签或造成集合关系、数轴位置等歧义。
7. 站点运行时不依赖 Python、在线 TTS、后端或数据库。制作工具与发布资源分开,原书及开发环境不随站点部署。
-8. Git 仅在本地使用。没有用户明确指示,不添加远程仓库、不 push、不发布站点;保留用户已有的修改。
+8. 用户已授权将本项目同步到 `origin`(`https://github.com/DozenTwelve/Papermorph.git`)并发布到现有 Cloudflare Pages 项目 `animebook`。保留用户已有的修改,不强推或覆盖远程历史;其他远程或发布目标需用户明确指示。
9. audiobook 项目尚未查看。用户授权参考时再检查实际实现,不推测它的路径、接口或素材规格。
## 现有工具
diff --git a/README.md b/README.md
index e417aaa..fcf8335 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,9 @@
# Papermorph
+An AI skill that turns books into animated, narrated, interactive web experiences.
+
+Source & Skill: [DozenTwelve/Papermorph](https://github.com/DozenTwelve/Papermorph) · [MIT License](LICENSE).
+
把一本书(PDF)做成带动画、语音和互动练习的网页书。网站在 `site/`,首页书架目前收录:
- *Elementary Algebra*:68 章,保留原有 `site/chNN/` 路径。
diff --git a/plan.md b/plan.md
index 65b9a95..a0aba3c 100644
--- a/plan.md
+++ b/plan.md
@@ -28,11 +28,11 @@
用户要求参考 Dynamicland 的照片书架,改成三层:第一层 STEM(目前为 Math);第二层给小孩看的绘本;第三层更有趣的书。用户提供根目录 `3.png`(1086×1448),网站使用原图副本 `site/assets/bookshelf.png`。用户明确纠正适配含义:书架横向铺满浏览器,保留原图比例向下浏览,点击区域和标签同步缩放;顶部品牌融入书柜的上沿,底部信息融入抽屉木纹,不留独立黑色页眉页脚。详细声明由底部 About & disclaimer 打开。桌面优先,不做单独的手机设计。顶层前两本分别接现有的 Elementary Algebra 与 Elementary Mathematics,标签写实际课程名称和可用章节数;物理书及后两层为 Coming soon,仅作展示。用户要求移除了额外添加的 PICTURE BOOKS / CURIOUS BOOKS 小标签。图中下两层的书不代表已有课程。
-每层 Skill 纸张入口的方案已被用户取消;底部 GitHub 将来统一承载源码和 Skills。仓库尚未上线,当前仅显示 Coming soon,不设置假链接;以后在 `site/lib/bookshelf.js` 的 `githubURL` 填入仓库地址。底部保留独立教育项目、非原书作者或出版社关联、内容纠错与浏览器保存进度的简短说明。这次首页视觉属于网站实现,不进入制作 Skill;Skill 当前仍含有书架说明,但用户要求先检查,尚未修改。
+每层 Skill 纸张入口的方案已被用户取消;底部 GitHub 统一承载源码和 Skill。用户已创建公开仓库 `https://github.com/DozenTwelve/Papermorph` 并选择 MIT 许可证;底部入口与 About 声明中的链接直接写在 `site/index.html`,无 JavaScript 时也能访问仓库。底部保留独立教育项目、非原书作者或出版社关联、内容纠错与浏览器保存进度的简短说明。这次首页视觉属于网站实现,不进入制作 Skill;Skill 当前仍含有书架说明,但用户要求先检查,尚未修改。
目录页每个单元的标题区是一条“黑板带”(用户 2026-10-03 指出目录页太单调):右侧是该单元数学内容的粉笔线条小图,用单元颜色绘制,背后一层同色柔光;单元第一次滚动进入视野时逐笔画出,之后保留一个与内容相关的小循环动作(如交换律中 a、b 互换,数轴上跳点,饼图填充,天平摆动,坐标线上走点,转盘转动,函数机器进出,面积格依次亮起,平方差缺角闪现,√2 对角线重画,根点脉动,抛物线伸缩)。全部由代码绘制,不使用外部图片;图画在 `site/lib/unit-art.js`,样式与动作在 `site/index.html`;系统设置减少动态时只显示静态完成图。
-书架的照片与入口在 `site/index.html`,点击区域样式在 `site/lib/bookshelf.css`,继续阅读与未来 GitHub 链接配置在 `site/lib/bookshelf.js`。入口不带 hash 时展示书架,`#book` 展示第一本书封面,`#contents` / `#chNN` 展示其目录;原有章节链接和引擎路径保持兼容。第二本位于 `site/math-notebook/`,书架标出当前可用的 3 章;63 章、6 个单元的全书规划仅在制作资料中记录,不显示未制作的章节入口。
+书架的照片与入口在 `site/index.html`,点击区域样式在 `site/lib/bookshelf.css`,继续阅读在 `site/lib/bookshelf.js`,GitHub 链接在 `site/index.html`。入口不带 hash 时展示书架,`#book` 展示第一本书封面,`#contents` / `#chNN` 展示其目录;原有章节链接和引擎路径保持兼容。第二本位于 `site/math-notebook/`,书架标出当前可用的 3 章;63 章、6 个单元的全书规划仅在制作资料中记录,不显示未制作的章节入口。
## 2. 已确定的要求
@@ -58,7 +58,7 @@
| 角色使用 | 不用狗狗形象(显得轻浮)。改为 agent 用 SVG 绘制的数学符号角色:无穷符号 ∞,两个圈是眼睛;不能用 π(已有知名 YouTuber 使用)。只在小测卡片和结束页出现,会眨眼、答对跳、答错歪头 |
| 首版技术 | 纯 JS + SVG 单页,无框架、无构建;Edge TTS 制作阶段生成 MP3 和词级时间点 |
| 部署 | Cloudflare Pages 纯静态托管,域名 `math.diamonddoge.org`;运行无后端、无数据库,不依赖 Home 服务器 |
-| Git | 已初始化本地仓库,不配置远程或 push,除非用户之后明确要求 |
+| Git | origin 为 `https://github.com/DozenTwelve/Papermorph.git`,用户已授权同步本项目;保留远程 MIT 许可证,不强推 |
| Agent 文档 | `plan.md` 记录详细计划;`CLAUDE.md` 提供目录地图、素材说明和执行约定 |
## 3. 当前项目资产
@@ -469,7 +469,7 @@
用户希望在完成当前教材并检查、优化动画后,将项目的制作能力封装为 Skill。当前页面、讲解和动画主要由 Claude Code 实现,用户没有预先提供页面设计;后续封装应保留 agent 承担教学编排与实现的能力。
-最终 Skill 开源分享的方向已确认,不以盈利为目标。封装重点是让其他使用者也能制作有教学价值的动画课程;具体许可证和发布方式尚未确定。
+最终 Skill 开源分享的方向已确认,不以盈利为目标。封装重点是让其他使用者也能制作有教学价值的动画课程;用户已创建公开 GitHub 仓库 `DozenTwelve/Papermorph` 并选择 MIT 许可证,成品网站继续由 Cloudflare Pages 托管。
技能第一版位于 `.claude/skills/papermorph/`(英文),已按用户确认的 review 方向整理:入门→拆书→章节规划→初始化→试点章→逐章制作→交付。每章读参考内容、写分镜与讲稿、生成语音、实现画面,做一次简短检查(加载、留白、重叠、裁切、文字密度、颜色一致性),局部修正明确问题后登记并交付;整体风格、节奏和教学效果由用户审阅。播放器、题型或判题逻辑变化时运行相关测试,普通新章沿用交付检查。共享 helper 按需要实现,另章复用时共享。代码/SVG 是默认素材方式,可按用户要求调整。
@@ -487,7 +487,7 @@
- 先验证首章和代表性动画,再扩展复用组件和全书内容。
- 不根据参考书截图直接拼出网站,不把原版书页当成课程界面。
- 不添加未经讨论的后端、数据库、账号系统或线上 TTS 依赖。
-- 不配置远程仓库或 push,除非用户之后明确授权。
+- 用户已授权同步本项目到 `DozenTwelve/Papermorph` 并发布到现有 Cloudflare Pages 项目;保留远程历史,不强推,其他目标需用户授权。
- `CLAUDE.md` 已补充为 agent 工作指南,包含目录地图、素材说明、执行约定及验证要求;详细教学与产品计划统一维护在本文。
更新本文时同步调整受影响的段落,避免新决定与旧要求并存。
diff --git a/site/index.html b/site/index.html
index c157a11..0494292 100644
--- a/site/index.html
+++ b/site/index.html
@@ -212,9 +212,9 @@ main#contents { padding-bottom: 80px; }
<h2 class="visually-hidden" id="curious-title">Curious books · Coming soon</h2>
</section>
</div>
- <div class="github-drawer" aria-label="GitHub repository and Skills: coming soon">
- <span class="github-status">Repository &amp; Skills · Coming soon</span>
- </div>
+ <a class="github-drawer" href="https://github.com/DozenTwelve/Papermorph" target="_blank" rel="noopener noreferrer" aria-label="Papermorph on GitHub: source and Skills">
+ <span class="github-status">Source &amp; Skills ↗</span>
+ </a>
<noscript><p class="shelf-noscript">Book links work without JavaScript. The animated lessons require JavaScript.</p></noscript>
</figure>
<footer class="shelf-footer">
@@ -228,7 +228,7 @@ main#contents { padding-bottom: 80px; }
<h2 id="shelf-about-title">About Papermorph</h2>
<p>An independent, noncommercial educational project. Not affiliated with the authors or publishers of the reference books. Book titles and original materials belong to their respective owners.</p>
<p>Lessons may contain errors; corrections are welcome. Reading progress stays in your browser. Books on the future shelves are previews, not available lessons.</p>
- <p>The public GitHub repository will collect the source and Skills. It is coming soon.</p>
+ <p>Explore the source and book-making Skill on <a href="https://github.com/DozenTwelve/Papermorph" target="_blank" rel="noopener noreferrer">GitHub</a>.</p>
</dialog>
</main>
<section id="cover">
diff --git a/site/lib/bookshelf.css b/site/lib/bookshelf.css
index e3bb4c0..6013d88 100644
--- a/site/lib/bookshelf.css
+++ b/site/lib/bookshelf.css
@@ -25,7 +25,8 @@ body.shelved::before { display: none; }
.book-caption small { color: #e2dbca; font-size: 1.03cqw; letter-spacing: .03em; }
.resume-label { position: absolute; padding: .46cqw .74cqw; background: #fcf4df; color: #3c4336; box-shadow: 1px 2px 5px #0003; font: 1.03cqw var(--ui); transform: rotate(-3deg); }
.physics-pending { position: absolute; left: 71.4%; top: 25.6%; padding: .46cqw .92cqw; border: 1px solid #edcf73; background: #f1d174; color: #302b1f; font: 1.1cqw var(--ui); transform: rotate(-2deg); box-shadow: 1px 2px 4px #0003; }
-.github-drawer { position: absolute; left: 28%; top: 87.5%; width: 47%; height: 11%; display: flex; align-items: flex-end; justify-content: center; padding-bottom: .46cqw; }
+.github-drawer { position: absolute; left: 28%; top: 87.5%; width: 47%; height: 11%; display: flex; align-items: flex-end; justify-content: center; padding-bottom: .46cqw; text-decoration: none; }
+.github-drawer:hover .github-status { background: #f8e6c8; }
.github-status { padding: .46cqw 1.1cqw; border: 1px solid #664a294a; background: #f0d5a9c9; color: #43331f; font: 1.1cqw var(--ui); border-radius: 2px; }
.shelf-noscript { position: absolute; bottom: 0; left: 24px; margin: 0; font: 11px var(--ui); color: #352c21; }
.shelf-footer { position: absolute; inset: auto 0 0; display: flex; justify-content: center; align-items: center; gap: 3%; height: 3%; padding: 0 3%; color: #594129; font: 500 clamp(10px, .85vw, 14px)/1.4 var(--ui); text-shadow: 0 1px #ffe6bd66; }
diff --git a/site/lib/bookshelf.js b/site/lib/bookshelf.js
index f532fa3..2b67011 100644
--- a/site/lib/bookshelf.js
+++ b/site/lib/bookshelf.js
@@ -1,9 +1,6 @@
-/* Website-only book navigation. The picture and hotspot positions live in index.html/bookshelf.css.
- * Set githubURL when the public repository is ready; keep it null until then.
- */
+/* Website-only book navigation. The picture, links and hotspot positions live in index.html/bookshelf.css. */
'use strict';
(() => {
- const githubURL = null;
const about = document.getElementById('shelf-about');
document.getElementById('shelf-about-button').addEventListener('click', () => about.showModal());
const books = [
@@ -25,16 +22,4 @@
resume.style.top = '5.7%';
document.getElementById('shelf-books').append(resume);
}
- if (githubURL) {
- const drawer = document.querySelector('.github-drawer');
- const link = document.createElement('a');
- link.className = drawer.className;
- link.href = githubURL;
- link.setAttribute('aria-label', 'Papermorph on GitHub: source and Skills');
- const label = document.createElement('span');
- label.className = 'github-status';
- label.textContent = 'Source & Skills ↗';
- link.append(label);
- drawer.replaceWith(link);
- }
})();