MiniMax-AI/mcode-stack / stacks/youfang/skills/magic-move-deck
magic-move-deck
UnverifiedBuild Keynote-style Magic Move slide decks as one offline 1920×1080 HTML file: every slide is an architecture / flow diagram seen through a camera, and the elements two slides share morph and fly instead of cross-fading. Four visual styles (hand-drawn, minimal, dark neon, neo-brutalist): the agent first renders one sample slide in each style, the user picks one, then the whole deck is built in that style. Also exports 4K / 1080p video. Use for 做演示 / 做 slides / 做 PPT / Magic Move / 神奇移动 / 架构图演示 / 技术分享 deck / 动画 slides / animated architecture walkthrough. Not for bullet-point decks or a single static diagram.
examples/rag-assistant/details/99_end.html
View on GitHub<!DOCTYPE html>
<!--
Magic Move deck style: handdrawn (手绘)
Adapted from the handdrawn-diagram template (https://github.com/TrentChou/handdrawn-diagram, MIT).
- rough.js based shapes (hand-drawn jittered lines + solid light fill; hachure available as override)
- Conventional print typography: Chinese 宋体 / 中宋, Latin Times New Roman
- 9-role palette + shape helpers (box / channel / taskCard / bubble / hexagon / timeline / frame) + node() + legend()
- Hard rules: no emoji; Latin = Times New Roman, CN = Songti family, never sans-serif / script / handwritten
- Edit main() at the bottom to draw your own diagram. Keep helpers untouched: every style template exposes
the same helper names and signatures, so one main() renders in any style (scripts/styles.py).
-->
<html>
<head>
<meta charset="utf-8">
<!-- Web fallback: Noto Serif SC (思源宋体) for systems without Songti / SimSun.
Times New Roman ships with Windows and macOS (Linux falls back to serif); no Web load needed. -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
* { box-sizing: border-box; }
/* Font stack discipline: put Latin (Times New Roman) FIRST,
then Chinese (中宋 -> 宋体 -> 思源宋体), then `serif` fallback.
Browser does per-character matching: English chars hit Times,
CJK chars skip Times and hit Songti / Zhongsong. NEVER use cursive
or sans-serif as fallback — those route to system handwriting / Heiti
and break the print-text aesthetic. */
body { margin: 0; background: #fdfdfa;
font-family: 'Times New Roman', Times, 'Songti SC', 'STSong', 'SimSun', '宋体', 'Noto Serif SC', serif; }
.stage { position: relative; background: #fdfdfa; }
canvas { display: block; }
.label { position: absolute; pointer-events: none; line-height: 1.22; }
/* Title / emphasis: Zhongsong (中宋) for Chinese, Times bold for Latin */
.ti { font-family: 'Times New Roman', Times, 'STZhongsong', '华文中宋', 'Songti SC', 'SimSun', '宋体', 'Noto Serif SC', serif; font-weight: 700; }
/* Body / sub-label: Songti for Chinese, Times regular for Latin */
.bd { font-family: 'Times New Roman', Times, 'Songti SC', 'STSong', 'SimSun', '宋体', 'Noto Serif SC', serif; font-weight: 400; }
</style>
<script src="https://cdn.jsdelivr.net/npm/roughjs@4.6.6/bundled/rough.js"
integrity="sha384-1NLkwxMO2sOqcq7rQkFBhIAUJtbt8ziLxhVKVgKfFGMEU8pF+GEq5LVogviveup6"
crossorigin="anonymous"></script>
</head>
<body>
<!-- Set canvas size to whatever your diagram needs -->
<div class="stage" style="width: 1920px; height: 1080px;">
<canvas id="c" width="1920" height="1080"></canvas>
<div id="labels"></div>
</div>
<script>
const canvas = document.getElementById('c');
const ctx = canvas.getContext('2d');
const rc = rough.canvas(canvas);
// Canonical font stacks — keep in sync with CSS .ti / .bd above.
const FONT_TI = `'Times New Roman', Times, 'STZhongsong', '华文中宋', 'Songti SC', 'SimSun', '宋体', 'Noto Serif SC', serif`;
const FONT_BD = `'Times New Roman', Times, 'Songti SC', 'STSong', 'SimSun', '宋体', 'Noto Serif SC', serif`;
// ============================================================
// PALETTE — 9 fixed roles (low-saturation warm version on ivory).
// Same role uses the same color across every diagram in the article.
// stroke = node-internal text color too. WCAG ≥ 4.5:1 vs fill.
// See STYLE.md (next to this template) for the contrast table.
// ============================================================
const C = {
user: { stroke: '#1f5582', fill: '#e3ebf2' }, // 钢蓝 / 雾蓝 6.5:1
im: { stroke: '#106668', fill: '#dde8e7' }, // 墨青 / 雾青 5.4:1
agent: { stroke: '#a04a1f', fill: '#f3e2cf' }, // 砖橙 / 米橙 4.7:1 (主角)
subagent: { stroke: '#7d4f0a', fill: '#f4eacd' }, // 焦糖 / 麦黄 5.8:1
llm: { stroke: '#4a3f8c', fill: '#e6e2ef' }, // 靛紫 / 雾紫 6.9:1
tools: { stroke: '#2f6b3c', fill: '#dfead9' }, // 苔绿 / 雾绿 5.1:1
memory: { stroke: '#6e554a', fill: '#ede2d5' }, // 栗棕 / 牛皮 5.4:1
external: { stroke: '#4f5359', fill: '#e9e7e3' }, // 墨灰 / 暖灰 6.3:1
error: { stroke: '#a52928', fill: '#f0d8d2' }, // 砖红 / 浅赭 5.2:1 (异常专用)
flow: '#3a3530', // 暖墨色 — 所有箭头
bg: '#fdfdfa', // 暖米白 — 画布底色
title: '#2a2520', // 暖墨黑 — 大标题
subtitle: '#5a544f', // 暖中灰 — 副标
caption: '#7a746e', // 暖浅灰 — 图例小字
glow: null, // deck: CSS filter on every shape (none for this style)
// Cover / closing card palette + the deck's frosted glass behind it (keynote.html reads it via build_deck.py)
card: { stroke: '#1f5582', fill: 'rgba(245,248,251,0.6)', accent: '#2f6f9f', title: '#163d5e',
text: '#2a2520', muted: '#5a544f',
glass: 'linear-gradient(160deg, rgba(31,85,130,.22) 0%, rgba(120,160,195,.18) 38%, rgba(227,235,242,.40) 70%, rgba(253,253,250,.55) 100%)',
pane: 'rgba(253,253,250,.42)', shadow: '0 26px 70px rgba(20,40,60,.14), 0 4px 14px rgba(20,40,60,.06)' },
};
// ============================================================
// STYLE OPTIONS — rough.js baseline: bold stroke, high roughness, visible bowing
// Default fillStyle = 'solid' (clean light fill behind text).
// Hachure (斜线填充) leaves diagonal noise behind labels — small text on
// phones gets eaten by the lines. Use hachure ONLY for shapes WITHOUT
// text inside (pure decorative blocks). Override per-shape:
// opts(C.agent, { fillStyle: 'hachure', hachureGap: 9, hachureAngle: -41 })
// ============================================================
const opts = (color, o = {}) => Object.assign({
stroke: color.stroke,
fill: color.fill,
fillStyle: 'solid',
strokeWidth: 2.4,
roughness: 1.6,
bowing: 1.4,
}, o);
// ============================================================
// ARROW — solid by default; pass { strokeLineDash: [10,7] } for dashed
// Pass o = { stroke: C.error.stroke, strokeLineDash: [10,7] } for error path
// ============================================================
function arrow(x1, y1, x2, y2, o = {}) {
const op = Object.assign({ stroke: C.flow, strokeWidth: 2, roughness: 1.4 }, o);
rc.line(x1, y1, x2, y2, op);
const a = Math.atan2(y2 - y1, x2 - x1);
const L = 14;
const headOpts = Object.assign({}, op, { strokeLineDash: undefined });
rc.line(x2, y2, x2 - L * Math.cos(a - Math.PI/6), y2 - L * Math.sin(a - Math.PI/6), headOpts);
rc.line(x2, y2, x2 - L * Math.cos(a + Math.PI/6), y2 - L * Math.sin(a + Math.PI/6), headOpts);
}
// ============================================================
// SHAPE HELPERS
// ============================================================
// Box — generic rectangle entity (Service / Agent / Resource)
function box(x, y, w, h, color, override = {}) {
rc.rectangle(x, y, w, h, opts(color, override));
}
// Channel — flat horizontal strip (IM / Queue / Bus)
function channel(x, y, w, h, color) {
rc.rectangle(x, y, w, h, opts(color, { strokeWidth: 2.2 }));
}
// Task Card — folded-corner note (work unit / job / task)
function taskCard(x, y, w, h, color) {
const fold = 14;
const path = `M${x} ${y} L${x+w-fold} ${y} L${x+w} ${y+fold} L${x+w} ${y+h} L${x} ${y+h} Z`;
rc.path(path, opts(color, { strokeWidth: 1.8, roughness: 1.3 }));
rc.path(`M${x+w-fold} ${y} L${x+w-fold} ${y+fold} L${x+w} ${y+fold}`,
{ stroke: color.stroke, strokeWidth: 1.6, roughness: 1.2 });
}
// Bubble — speech bubble for Status / Notification (left or right tail)
function bubble(x, y, w, h, color, tailSide = 'left') {
rc.rectangle(x, y, w, h, opts(color, { strokeWidth: 2, roughness: 1.3 }));
const tailY = y + h * 0.5;
if (tailSide === 'left') {
rc.path(`M${x} ${tailY-10} L${x-14} ${tailY} L${x} ${tailY+10}`,
{ stroke: color.stroke, fill: color.fill, fillStyle: 'solid', strokeWidth: 2, roughness: 1.2 });
} else {
rc.path(`M${x+w} ${tailY-10} L${x+w+14} ${tailY} L${x+w} ${tailY+10}`,
{ stroke: color.stroke, fill: color.fill, fillStyle: 'solid', strokeWidth: 2, roughness: 1.2 });
}
}
// Hexagon — used for Error / Decision / 异常兜底
function hexagon(cx, cy, w, h, color) {
const dx = w / 2, dy = h / 2, ear = w * 0.18;
const pts = [
[cx - dx + ear, cy - dy],
[cx + dx - ear, cy - dy],
[cx + dx, cy],
[cx + dx - ear, cy + dy],
[cx - dx + ear, cy + dy],
[cx - dx, cy],
];
rc.polygon(pts, opts(color));
}
// Timeline — horizontal dashed line with tick marks
function timeline(x1, y, x2, marks /* [{x,text}] — text rendered separately via plain() */) {
rc.line(x1, y, x2, y, { stroke: C.flow, strokeWidth: 1.6, roughness: 1, strokeLineDash: [6, 8] });
marks.forEach(m => {
rc.line(m.x, y - 6, m.x, y + 6, { stroke: C.flow, strokeWidth: 1.6, roughness: 1 });
});
}
// ============================================================
// TEXT HELPERS — Title (Times + 中宋) + body (Times + 宋体)
// All Chinese text MUST go through HTML labels, not canvas fillText,
// so the serif fallback chain (Songti/SimSun/Noto Serif SC) kicks in.
// `text` / `sub` are injected as HTML (so <b>, <br> work). Escape literal
// '<' and '&' as < / &, and never pass untrusted strings.
// ============================================================
const L = document.getElementById('labels');
// Two-line label: bold Times/Zhongsong title + regular Times/Songti subtitle
function lbl({ text, sub, x, y, w, color, size=24, subSize=16, align='center' }) {
const div = document.createElement('div');
div.className = 'label';
div.style.left = x + 'px'; div.style.top = y + 'px';
div.style.width = w + 'px'; div.style.textAlign = align;
div.style.color = color;
div.innerHTML = `
<div class="ti" style="font-size:${size}px;font-weight:700">${text}</div>
${sub ? `<div class="bd" style="font-size:${subSize}px;color:${color};opacity:.85;margin-top:3px">${sub}</div>` : ''}
`;
L.appendChild(div);
}
// Single-line plain label (arrow labels, bubble content, captions)
function plain({ text, x, y, w, color='#3a3530', size=18, weight=400, bg=null, align='center' }) {
const div = document.createElement('div');
div.className = 'label bd';
div.style.left = x + 'px'; div.style.top = y + 'px';
div.style.width = w + 'px'; div.style.textAlign = align;
div.style.color = color; div.style.fontSize = size + 'px';
div.style.fontWeight = weight;
if (bg) { div.style.background = bg; div.style.padding = '1px 6px'; }
div.innerHTML = text;
L.appendChild(div);
}
// Canvas title (Times bold for Latin, Zhongsong for Chinese — fillText supports CJK fine)
function title(text, x, y, size=44) {
ctx.font = `700 ${size}px ${FONT_TI}`;
ctx.fillStyle = C.title;
ctx.fillText(text, x, y);
}
function subtitle(text, x, y, size=22) {
ctx.font = `400 ${size}px ${FONT_BD}`;
ctx.fillStyle = C.subtitle;
ctx.fillText(text, x, y);
}
// Label background = canvas ivory, slightly translucent. Use for any label that sits on a line.
const LABEL_BG = 'rgba(253,253,250,.94)';
// ============================================================
// COMPOSITE HELPERS
// ============================================================
// Node — box + vertically centered two-line label in the box's stroke color.
// node(x, y, w, h, C.agent, '在线检索', 'Query 理解 · 召回', { box: { strokeWidth: 3 }, size: 30 })
function node(x, y, w, h, color, text, sub, o = {}) {
const size = o.size || 23, subSize = o.subSize || 15;
box(x, y, w, h, color, o.box || {});
const textH = size * 1.22 + (sub ? 3 + subSize * 1.22 : 0);
lbl({ text, sub, x, y: y + (h - textH) / 2, w, color: color.stroke, size, subSize });
}
// Group Frame — dashed boundary around a group of nodes (subsystem / sandbox / plan).
// Drawn as 4 dashed lines, never rc.rectangle (a rough rectangle can paint fill over the nodes inside).
// The title sits on the top edge with LABEL_BG so the dashed line does not cross it.
// frame(340, 280, 1330, 210, C.agent, '在线检索')
function frame(x, y, w, h, color, label, labelW = 160) {
const o = { stroke: color.stroke, strokeWidth: 1.6, roughness: 1.2, strokeLineDash: [10, 6] };
rc.line(x, y, x + w, y, o);
rc.line(x + w, y, x + w, y + h, o);
rc.line(x + w, y + h, x, y + h, o);
rc.line(x, y + h, x, y, o);
if (label) plain({ text: label, x: x + 18, y: y - 13, w: labelW, color: color.stroke,
size: 17, weight: 700, bg: LABEL_BG, align: 'left' });
}
// Legend — color key. Required when a diagram uses more than 5 colors (SKILL.md rule 6); list only colors used.
// Swatches are small solid boxes with the text beside them, never inside.
// legend(80, 1000, [{ c: C.user, n: 'User', z: '用户' }, { c: C.agent, n: '主 Agent', z: '编排核心' }], 3, 300)
function legend(x, y, items, cols = 3, colW = 300) {
plain({ text: '图例 · Legend', x, y: y - 30, w: 200, color: C.title, size: 20, weight: 700, align: 'left' });
items.forEach((it, i) => {
const ix = x + (i % cols) * colW, iy = y + Math.floor(i / cols) * 62;
rc.rectangle(ix, iy, 36, 26, opts(it.c, { strokeWidth: 2, roughness: 1.3 }));
plain({ text: it.n, x: ix + 48, y: iy - 1, w: colW - 60, color: it.c.stroke, size: 19, weight: 700, align: 'left' });
if (it.z) plain({ text: it.z, x: ix + 48, y: iy + 24, w: colW - 60, color: C.caption, size: 15, align: 'left' });
});
}
// ============================================================
// MAIN — replace this with your own diagram
// ============================================================
function main() {
// Closing card ('end'), 1920×1080, from templates/card-main.js.
// Repeats the opening card's title (64 / 38 px), so overview → end replays the cover move backwards:
// the overview title's words fly back into this card. The card stays the largest shape in the diagram.
const K = C.card;
C.title = K.title; // title() reads C.title at call time
const W = canvas.width, cx = W / 2;
const centered = (text, size) => { ctx.font = `700 ${size}px ${FONT_TI}`; return cx - ctx.measureText(text).width / 2; };
box(330, 249, 1260, 580, { stroke: K.stroke, fill: K.fill });
const en = 'RAG Knowledge Assistant', zh = '检索增强问答助手';
title(en, centered(en, 64), 420, 64);
title(zh, centered(zh, 38), 482, 38);
rc.line(cx - 270, 520, cx + 270, 520, { stroke: K.accent, strokeWidth: 2.2, roughness: 1.1, bowing: 1 });
// Recap of the three principles (worded differently from the overview headings, so nothing pairs with them)
plain({ text: `Chunks keep their source · Recall wide, rank narrow · Answer from evidence only` +
`<br><span style="font-size:18px">片段带着来源 · 先广召回再精排 · 只依据证据作答</span>`,
x: cx - 560, y: 544, w: 1120, color: K.text, size: 23 });
lbl({ text: 'Example Team', sub: '示例团队', x: cx - 470, y: 640, w: 420, color: K.muted, size: 30, subSize: 18 });
rc.line(cx, 642, cx, 708, { stroke: K.accent, strokeWidth: 1.6, roughness: 1.2 });
lbl({ text: 'Your Name', sub: '分享人', x: cx + 50, y: 640, w: 420, color: K.muted, size: 30, subSize: 18 });
plain({ text: `Thank you <span style="font-size:20px">谢谢</span>`, x: cx - 300, y: 752, w: 600, color: K.accent, size: 28, weight: 700 });
}
main();
window.__renderDone = true;
</script>
</body>
</html>
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |