Skip to content

andyhuo520/vibe-knowledge / skills/ai-teardown

ai-teardown

Unverified

「AI 拆机课」系列课工作室:输入一个主题(AI 产品、开源项目/书、人物历史、软件教程),产出由浅入深、每句话有出处的中文讲解视频系列 + 每节互动版 + 课程总页。流水线:收集资料 → 确认对象与课时 → 大纲 → 逐节旁白(MiMo 克隆音色 + 逐字对齐)→ scenes.json 画面编排(Notion 极简手绘引擎 / 马卡龙模板引擎,IconPark 图标与插画、Noto 动态 emoji、AntV X6 流程图、像素讲解小人、截图圈注、终端录屏)或 film.js 代码成片(cine 引擎:Three.js、粒子、着色器、真片段叠加、曲库配乐)→ Hyperframes / 无头 GPU 逐帧 1080p 渲染 → Artifact 发布 → 课程总页 + 导学视频。触发:做系列课 / 做课程视频 / 把某本书或某个开源项目做成课 / 科普讲解视频 / 教学视频 / 课程地图 / 导学视频 / 互动课件 / 「拆机课」「上手课」「实战课」「编排课」/ 王炸讲解片 / 用真实会话和成片教人做视频。不用于:单支宣传片(用 promo-video)、单张信息图、纯文章写作。

FileKindSize
SKILL.mdskill md8.9 KB
engine/assets/fonts/Geist-VF.ttfbinary165.1 KB
engine/assets/fonts/GeistMono-VF.ttfbinary167.9 KB
engine/assets/fonts/LXGWWenKai-Medium.ttfbinary24.2 MB
engine/assets/fonts/LXGWWenKai-Regular.ttfbinary24.4 MB
engine/assets/fonts/NotoSansSC-VF.ttfbinary16.9 MB
engine/assets/iconsets/README.mdmarkdown834 B
engine/assets/iconsets/icon-park-outline.jsonconfig984.1 KB
engine/assets/iconsets/icon-park-solid.jsonconfig946.0 KB
engine/assets/iconsets/icon-park-twotone.jsonconfig991.3 KB
engine/assets/iconsets/icon-park.jsonconfig1.5 MB
engine/assets/iconsets/iconoir.jsonconfig648.2 KB
engine/assets/iconsets/lucide.jsonconfig563.5 KB
engine/assets/iconsets/tabler.jsonconfig2.0 MB
engine/assets/illustrations/iconpark/_sheet.htmlother9.8 KB
engine/assets/illustrations/iconpark/a1-1.svgother7.7 KB
engine/assets/illustrations/iconpark/a1-2.svgother5.7 KB
engine/assets/illustrations/iconpark/a1-3.svgother12.8 KB
engine/assets/illustrations/iconpark/a1-4.svgother7.8 KB
engine/assets/illustrations/iconpark/a10-120.svgother18.7 KB
engine/assets/illustrations/iconpark/a10-121.svgother19.6 KB
engine/assets/illustrations/iconpark/a10-122.svgother28.3 KB
engine/assets/illustrations/iconpark/a10-123.svgother33.1 KB
engine/assets/illustrations/iconpark/a11-136.svgother7.9 KB
engine/assets/illustrations/iconpark/a11-137.svgother5.2 KB
engine/assets/illustrations/iconpark/a11-138.svgother6.5 KB
engine/assets/illustrations/iconpark/a11-139.svgother7.8 KB
engine/assets/illustrations/iconpark/a12-152.svgother12.7 KB
engine/assets/illustrations/iconpark/a12-153.svgother13.7 KB
engine/assets/illustrations/iconpark/a12-154.svgother21.2 KB
engine/assets/illustrations/iconpark/a12-155.svgother9.3 KB
engine/assets/illustrations/iconpark/a13-167.svgother5.0 KB
engine/assets/illustrations/iconpark/a13-168.svgother5.0 KB
engine/assets/illustrations/iconpark/a13-169.svgother3.5 KB
engine/assets/illustrations/iconpark/a13-170.svgother4.6 KB
engine/assets/illustrations/iconpark/a14-184.svgother17.4 KB
engine/assets/illustrations/iconpark/a14-185.svgother27.5 KB
engine/assets/illustrations/iconpark/a14-186.svgother35.2 KB
engine/assets/illustrations/iconpark/a14-187.svgother34.1 KB
engine/assets/illustrations/iconpark/a15-200.svgother19.8 KB
engine/assets/illustrations/iconpark/a15-201.svgother20.3 KB
engine/assets/illustrations/iconpark/a15-202.svgother19.2 KB
engine/assets/illustrations/iconpark/a15-203.svgother24.3 KB
engine/assets/illustrations/iconpark/a16-215.svgother10.1 KB
engine/assets/illustrations/iconpark/a16-216.svgother16.5 KB
engine/assets/illustrations/iconpark/a16-217.svgother10.2 KB
engine/assets/illustrations/iconpark/a16-218.svgother15.2 KB
engine/assets/illustrations/iconpark/a17-230.svgother7.0 KB
engine/assets/illustrations/iconpark/a17-231.svgother6.8 KB
engine/assets/illustrations/iconpark/a17-232.svgother8.6 KB
engine/assets/illustrations/iconpark/a17-233.svgother5.5 KB
engine/assets/illustrations/iconpark/a18-245.svgother15.2 KB
engine/assets/illustrations/iconpark/a18-246.svgother14.1 KB
engine/assets/illustrations/iconpark/a18-247.svgother8.9 KB
engine/assets/illustrations/iconpark/a18-248.svgother8.7 KB
engine/assets/illustrations/iconpark/a19-265.svgother9.4 KB
engine/assets/illustrations/iconpark/a19-266.svgother11.5 KB
engine/assets/illustrations/iconpark/a19-267.svgother6.6 KB
engine/assets/illustrations/iconpark/a19-268.svgother5.5 KB
engine/assets/illustrations/iconpark/a2-11.svgother8.8 KB
engine/assets/illustrations/iconpark/a2-12.svgother10.7 KB
engine/assets/illustrations/iconpark/a2-13.svgother116.5 KB
engine/assets/illustrations/iconpark/a2-14.svgother35.3 KB
engine/assets/illustrations/iconpark/a20-280.svgother10.4 KB
engine/assets/illustrations/iconpark/a20-281.svgother17.7 KB
engine/assets/illustrations/iconpark/a20-282.svgother12.5 KB
engine/assets/illustrations/iconpark/a20-283.svgother13.1 KB
engine/assets/illustrations/iconpark/a21-295.svgother10.4 KB
engine/assets/illustrations/iconpark/a21-296.svgother21.2 KB
engine/assets/illustrations/iconpark/a21-297.svgother8.3 KB
engine/assets/illustrations/iconpark/a21-298.svgother17.5 KB
engine/assets/illustrations/iconpark/a22-327.svgother10.6 KB
engine/assets/illustrations/iconpark/a22-328.svgother12.4 KB
engine/assets/illustrations/iconpark/a22-329.svgother5.4 KB
engine/assets/illustrations/iconpark/a22-330.svgother10.5 KB
engine/assets/illustrations/iconpark/a3-19.svgother8.0 KB
engine/assets/illustrations/iconpark/a3-20.svgother8.4 KB
engine/assets/illustrations/iconpark/a3-21.svgother10.1 KB
engine/assets/illustrations/iconpark/a3-22.svgother10.4 KB
engine/assets/illustrations/iconpark/a4-31.svgother2.7 KB
engine/assets/illustrations/iconpark/a4-32.svgother1.7 KB
engine/assets/illustrations/iconpark/a4-33.svgother1.7 KB
engine/assets/illustrations/iconpark/a4-34.svgother1.5 KB
engine/assets/illustrations/iconpark/a5-46.svgother21.5 KB
engine/assets/illustrations/iconpark/a5-47.svgother15.0 KB
engine/assets/illustrations/iconpark/a5-48.svgother11.8 KB
engine/assets/illustrations/iconpark/a5-49.svgother19.8 KB
engine/assets/illustrations/iconpark/a6-52.svgother15.5 KB
engine/assets/illustrations/iconpark/a6-53.svgother2.9 KB
engine/assets/illustrations/iconpark/a6-54.svgother3.6 KB
engine/assets/illustrations/iconpark/a6-55.svgother4.1 KB
engine/assets/illustrations/iconpark/a7-67.svgother6.0 KB
engine/assets/illustrations/iconpark/a7-68.svgother14.1 KB
engine/assets/illustrations/iconpark/a7-71.svgother10.8 KB
engine/assets/illustrations/iconpark/a7-72.svgother21.6 KB
engine/assets/illustrations/iconpark/a8-87.svgother3.3 KB
engine/assets/illustrations/iconpark/a8-88.svgother2.6 KB
engine/assets/illustrations/iconpark/a8-89.svgother2.6 KB
engine/assets/illustrations/iconpark/a8-90.svgother2.5 KB
engine/assets/illustrations/iconpark/a9-101.svgother4.7 KB
engine/assets/illustrations/iconpark/a9-102.svgother5.3 KB
engine/assets/illustrations/iconpark/a9-103.svgother5.2 KB
engine/assets/illustrations/iconpark/a9-104.svgother8.9 KB
engine/assets/illustrations/iconpark/catalog.jsonconfig19.7 KB
engine/cine/audio/sfx/README.mdmarkdown404 B
engine/cine/audio/sfx/key-1.wavbinary14.7 KB
engine/cine/audio/sfx/key-2.wavbinary14.7 KB
engine/cine/audio/sfx/key-3.wavbinary14.7 KB
engine/cine/audio/sfx/key-4.wavbinary14.7 KB
engine/cine/audio/sfx/key-5.wavbinary14.7 KB
engine/cine/audio/sfx/key-6.wavbinary14.7 KB
engine/cine/audio/sfx/key-7.wavbinary14.7 KB
engine/cine/audio/sfx/key-8.wavbinary14.7 KB
engine/cine/audio/sfx/key-space.wavbinary14.7 KB
engine/cine/audio/timeline.jsonconfig38.4 KB
engine/cine/audio/tools/bed.pyscript37.0 KB
engine/cine/audio/tools/score.pyscript93.0 KB
engine/cine/engine/core.jsscript4.4 KB
engine/cine/engine/glsl.jsscript2.6 KB
engine/cine/engine/narr.jsscript2.7 KB
engine/cine/engine/post.jsscript7.4 KB
engine/cine/engine/scenes/bars.jsscript4.8 KB
engine/cine/engine/scenes/clock.jsscript8.2 KB
engine/cine/engine/scenes/liquid.jsscript4.1 KB
engine/cine/engine/scenes/particles.jsscript9.5 KB
engine/cine/engine/scenes/showroom.jsscript5.0 KB
engine/cine/engine/scenes/tunnel.jsscript4.3 KB
engine/cine/engine/ui.jsscript9.2 KB
engine/cine/engine/util.jsscript2.8 KB
engine/cine/index.htmlother1.4 KB
engine/cine/tools/browser.pyscript802 B
engine/cine/tools/clips.pyscript3.1 KB
engine/cine/tools/deliver.shexecutablescript1.3 KB
engine/cine/tools/finish.pyscript9.3 KB
engine/cine/tools/loopbed.pyscript2.3 KB
engine/cine/tools/queue.shexecutablescript1.7 KB
engine/cine/tools/record.pyscript2.8 KB
engine/cine/tools/retail.pyscript1.8 KB
engine/cine/tools/stills.pyscript2.4 KB
engine/primitives/cards.jsscript13.5 KB
engine/primitives/floaties.jsscript2.5 KB
engine/primitives/loop.jsscript8.2 KB
engine/primitives/mascot.jsscript6.8 KB
engine/primitives/mindmap.jsscript6.7 KB
engine/primitives/morph.jsscript9.2 KB
engine/primitives/motion.jsscript22.5 KB
engine/primitives/portrait.jsscript4.9 KB
engine/primitives/practice.jsscript8.6 KB
engine/primitives/sandbox.jsscript7.4 KB
engine/primitives/scribble.jsscript6.7 KB
engine/primitives/sketch.jsscript23.1 KB
engine/primitives/story.jsscript21.9 KB
engine/primitives/systemmap.jsscript11.4 KB
engine/primitives/terminal.jsscript8.5 KB
engine/primitives/timeline.jsscript7.1 KB
engine/primitives/typer.jsscript9.9 KB
engine/runtime/dom.jsscript4.1 KB
engine/runtime/ease.jsscript2.1 KB
engine/runtime/hosts/player.jsscript11.4 KB
engine/runtime/iconify.jsscript3.1 KB
engine/runtime/lesson.jsscript25.6 KB
engine/runtime/overlays.jsscript13.6 KB
engine/runtime/sketch.jsscript60.8 KB
engine/runtime/spring.jsscript2.8 KB
engine/runtime/stage.jsscript6.6 KB
engine/runtime/theme.jsscript6.5 KB
engine/runtime/typing.jsscript4.4 KB
engine/schemas/brief.schema.jsonconfig2.8 KB
engine/schemas/concepts.schema.jsonconfig3.8 KB
engine/schemas/facts.schema.jsonconfig2.4 KB
engine/schemas/lesson.schema.jsonconfig7.0 KB
engine/schemas/sources.schema.jsonconfig1.8 KB
engine/scripts/check.pyscript13.7 KB
engine/scripts/check_scenes.pyscript3.7 KB
engine/scripts/course_page.pyscript24.5 KB
engine/scripts/emoji.pyscript2.5 KB
engine/scripts/export_cues.pyscript975 B
engine/scripts/facts_js.pyscript1.6 KB
engine/scripts/fetch_images.pyscript4.6 KB
engine/scripts/fx_render.pyscript7.8 KB
engine/scripts/hf_host.pyscript4.8 KB
engine/scripts/icons.pyscript1.7 KB
engine/scripts/illus.pyscript852 B
engine/scripts/ledger.pyscript1.1 KB
engine/scripts/make_lesson.pyscript11.5 KB
engine/scripts/mark_live.pyscript1.0 KB
engine/scripts/mix.pyscript4.4 KB
engine/scripts/new_series.pyscript5.1 KB
engine/scripts/noto_emoji.pyscript3.2 KB
engine/scripts/outline.pyscript4.4 KB
engine/scripts/publish_lesson.pyscript6.3 KB
engine/scripts/rec_scan.pyscript1.2 KB
engine/scripts/render_queue.shexecutablescript770 B
engine/scripts/review_page.pyscript6.9 KB
engine/scripts/serve_range.pyscript1.4 KB
engine/scripts/sketch_publish_files.pyscript2.1 KB
engine/scripts/speed.pyscript1.8 KB
engine/scripts/stills.pyscript2.2 KB
engine/scripts/term_cut.pyscript1.1 KB
engine/scripts/term_frames.pyscript7.8 KB

engine/runtime/overlays.js

View on GitHub
/** Screen-space overlays: captions, corner labels, cursor. All pure functions of time. */
import { h, setStyle, setText } from "./dom.js";
import { track, step, PRESS, CURSOR } from "./spring.js";
import { clamp01 } from "./ease.js";

const CSS = `
.at-cap{position:absolute;left:0;right:0;display:flex;justify-content:center;pointer-events:none}
.at-cap span{display:inline-block;padding:10px 30px 12px;border-radius:14px;background:var(--cap-bg);color:var(--cap-ink);
  font:500 44px/1.3 var(--sans);letter-spacing:.02em;white-space:nowrap}
.at-tag{position:absolute;font:500 22px/1 var(--sans);letter-spacing:.08em;color:var(--ink2);padding:9px 14px;border-radius:10px;
  border:1.5px solid var(--line);background:var(--surface)}
.at-tag[data-kind=inferred]{border-style:dashed}
.at-tag[data-kind=spike]{color:var(--hl);border-color:var(--hl)}
.at-cursor{position:absolute;left:0;top:0;width:0;height:0}
.at-cursor svg{position:absolute;left:-3px;top:-2px;overflow:visible}
.at-ripple{position:absolute;border-radius:50%;border:3px solid var(--ink);opacity:0}
`;

const PUNCT = /[,。!?;:、,.!?;:]/;
const HARD = /[。!?;!?;]/;

/**
 * Group TTS words into subtitle lines of at most maxChars, breaking at punctuation.
 * words: [{text, start, end, i0, i1}] with character offsets into `text`.
 */
export function captionCues(beats, maxChars = 18, en = false) {
  const HARDX = en ? /[。!?;!?;.]/ : HARD;
  const cues = [];
  for (const b of beats) {
    const text = b.text;
    let cur = null;
    const flush = () => {
      if (!cur) return;
      const line = text.slice(cur.i0, cur.i1).replace(/[,。!?;:、,.!?;:]+$/u, "").replace(/[,、]/g, " ").trim();
      if (line) cues.push({ start: cur.start, end: cur.end, text: line });
      cur = null;
    };
    for (const w of b.words) {
      const len = cur ? w.i1 - cur.i0 : w.i1 - w.i0;
      // 句尾只剩三四个字时宁可略超上限,也不让「你」这样的字单独成行
      const rest = text.slice(w.i1).search(/[,。!?;:、,.!?;:]|$/u);
      const clauseLen = cur ? w.i1 + rest - cur.i0 : 0;
      // 别把英文单词拆到两行(WorkBudd / y)
      const midWord = /[A-Za-z0-9]/.test(text[w.i0 - 1] ?? "") && /[A-Za-z0-9]/.test(text[w.i0] ?? "");
      if (cur && !midWord && len > maxChars && clauseLen > maxChars + 4) flush();
      if (!cur) cur = { i0: w.i0, i1: w.i1, start: w.start, end: w.end };
      else Object.assign(cur, { i1: w.i1, end: w.end });
      const after = text.slice(w.i1, w.i1 + 1);
      if (HARDX.test(after) || (PUNCT.test(after) && cur.i1 - cur.i0 >= maxChars * 0.45)) {
        cur.i1 = w.i1 + 1;
        flush();
      }
    }
    flush();
  }
  // hold each line until the next starts (short gaps only), so subtitles do not flicker between words
  for (let i = 0; i < cues.length; i++) {
    const next = cues[i + 1];
    cues[i].end = next && next.start - cues[i].end < 0.6 ? next.start - 0.02 : cues[i].end + 0.25;
  }
  return cues;
}

export function captions(stage, cues, { bottom } = {}) {
  stage.css("at-overlays", CSS);
  const el = h("div", { class: "at-cap" });
  const span = h("span");
  el.append(span);
  const top = bottom ?? stage.frame.capTop + 16;
  el.style.top = `${top}px`;
  return {
    el,
    render(t) {
      const c = cues.find((q) => t >= q.start - 0.04 && t < q.end);
      if (!c) return setStyle(el, "opacity", "0");
      setText(span, c.text);
      const a = clamp01((t - c.start + 0.04) / 0.08) * clamp01((c.end - t) / 0.06);
      setStyle(el, "opacity", a.toFixed(3));
    },
  };
}

/** Corner tags such as 「界面示意」「推断」 with time windows. pos: tl | tr | bl | br */
export function tag(stage, { text, start, end, pos = "tl", kind = "uimock" }) {
  stage.css("at-overlays", CSS);
  const el = h("div", { class: "at-tag", "data-kind": kind, text });
  const F = stage.frame;
  const m = { x: F.safeX, y: F.safeTop };
  if (pos.includes("l")) el.style.left = `${m.x}px`;
  else el.style.right = `${m.x}px`;
  if (pos.includes("t")) el.style.top = `${m.y}px`;
  else el.style.bottom = `${stage.H - F.capTop + 24}px`;
  return {
    el,
    render(t) {
      const a = clamp01((t - start) / 0.25) * clamp01((end - t) / 0.25);
      setStyle(el, "opacity", a.toFixed(3));
    },
  };
}

/**
 * Cursor in screen space. keys: [[t, wx, wy]] in world coordinates (critically damped, never overshoots);
 * presses: [[t0, t1]]; visible: [t0, t1]. Arrive at a target at least 0.5 s before pressing it.
 */
export function cursor(stage, { keys, presses = [], visible = [[0, Infinity]] }) {
  stage.css("at-overlays", CSS);
  const el = h("div", { class: "at-cursor" });
  el.innerHTML = `<svg width="34" height="40" viewBox="0 0 17 20"><path d="M1 1 L1 16 L5 12.4 L7.9 18.6 L10.6 17.4 L7.8 11.3 L13 11.3 Z"
    fill="var(--ink)" stroke="var(--bg)" stroke-width="1.3" stroke-linejoin="round"/></svg>`;
  const ripple = h("div", { class: "at-ripple" });
  stage.screen.append(ripple);
  const xs = keys.map(([t, x]) => [t, x]);
  const ys = keys.map(([t, , y]) => [t, y]);
  const pressKeys = [[0, 1]];
  for (const [a, b] of presses) pressKeys.push([a, 0.86], [b, 1]);
  return {
    el,
    at(t) {
      return { x: track(t, xs, CURSOR), y: track(t, ys, CURSOR) };
    },
    render(t) {
      const vis = Math.max(0, ...visible.map(([a, b]) => clamp01((t - a) / 0.2) * clamp01((b - t) / 0.2)));
      if (vis <= 0) return setStyle(el, "opacity", "0"), setStyle(ripple, "opacity", "0");
      const w = this.at(t);
      const p = stage.toScreen(w.x, w.y);
      const sc = track(t, pressKeys, PRESS);
      setStyle(el, "opacity", vis.toFixed(3));
      setStyle(el, "transform", `translate(${p.x.toFixed(1)}px, ${p.y.toFixed(1)}px) scale(${sc.toFixed(3)})`);
      const last = presses.filter(([a]) => t >= a).pop();
      if (last) {
        const k = step(t - last[0], { w: 2 * Math.PI * 1.6, z: 1 });
        const r = 14 + k * 42;
        Object.assign(ripple.style, {
          left: `${p.x - r}px`, top: `${p.y - r}px`, width: `${2 * r}px`, height: `${2 * r}px`,
          opacity: ((1 - k) * 0.55 * vis).toFixed(3),
        });
      } else setStyle(ripple, "opacity", "0");
    },
  };
}

const CSS2 = `
.at-chap{position:absolute;display:flex;align-items:baseline;gap:14px;white-space:nowrap}
.at-chap .n{font:600 24px/1 var(--mono);color:var(--ink3);letter-spacing:.06em}
.at-chap .t{font:600 26px/1 var(--sans);color:var(--ink2);letter-spacing:.04em}
.at-term{position:absolute;padding:20px 28px 22px;border-radius:20px;background:var(--surface);border:2px solid var(--line);box-shadow:var(--shadow);white-space:nowrap}
.at-term .k{display:flex;align-items:center;gap:12px;font:700 40px/1.1 var(--sans);color:var(--ink)}
.at-term .k i{width:14px;height:14px;border-radius:50%;display:inline-block}
.at-term .p{font:500 26px/1.4 var(--sans);color:var(--ink2);margin-top:8px}
.at-dim{position:absolute;inset:0;background:var(--bg)}
`;

/** 章节角标:左上角「02  它是什么」;chapters: [{start, end, n, title}] */
export function chapterLabel(stage, chapters) {
  stage.css("at-overlays2", CSS2);
  const el = h("div", { class: "at-chap" });
  const n = h("span", { class: "n" });
  const t = h("span", { class: "t" });
  el.append(n, t);
  el.style.left = `${stage.frame.safeX}px`;
  el.style.top = `${stage.frame.safeTop}px`;
  return {
    el,
    render(time) {
      const c = chapters.find((q) => time >= q.start - 0.1 && time < q.end);
      if (!c) return setStyle(el, "opacity", "0");
      setText(n, String(c.n).padStart(2, "0"));
      setText(t, c.title);
      const a = clamp01((time - c.start + 0.1) / 0.3) * clamp01((c.end - time) / 0.25);
      setStyle(el, "opacity", a.toFixed(3));
    },
  };
}

/** 术语卡:「名」这一拍,在字幕上方给出术语和一句大白话 */
export function termCard(stage, { term, plain, start, end, role = "model" }) {
  stage.css("at-overlays2", CSS2);
  const dot = h("i");
  dot.style.background = `var(--${role})`;
  const el = h("div", { class: "at-term" }, h("div", { class: "k" }, dot, term), h("div", { class: "p", text: plain }));
  el.style.left = `${stage.frame.safeX}px`;
  el.style.bottom = `${stage.H - stage.frame.capTop + 40}px`;
  return {
    el,
    render(time) {
      const a = clamp01((time - start) / 0.3) * clamp01((end - time) / 0.25);
      setStyle(el, "opacity", a.toFixed(3));
      setStyle(el, "transform", `translateY(${((1 - clamp01((time - start) / 0.3)) * 14).toFixed(1)}px)`);
    },
  };
}

/** 压暗世界层,给屏幕层的卡片垫底;windows: [[t0, t1, opacity]] */
export function backdrop(stage, windows) {
  stage.css("at-overlays2", CSS2);
  const el = h("div", { class: "at-dim" });
  return {
    el,
    render(time) {
      let a = 0;
      for (const [t0, t1, o = 0.78] of windows) a = Math.max(a, o * clamp01((time - t0) / 0.35) * clamp01((t1 - time) / 0.35));
      setStyle(el, "opacity", a.toFixed(3));
    },
  };
}

/**
 * 转场:两层马卡龙色圆从一角铺满画面,再往对角收走;场景在铺满的那一刻切换,所以不需要镜头移动。
 * times: 切换时刻数组;colors: 两层的色位(前、后);每次转场的方向按序轮换。
 */
export function wipe(stage, { times, colors = ["m6", "m1"], palette = null, dIn = 0.36, dOut = 0.44, lag = 0.07 }) {
  const { W, H } = stage;
  const R = Math.hypot(W, H) * 1.02;
  const corners = [[0, H], [W, 0], [W, H], [0, 0]];
  const mk = (c) => h("div", { style: { position: "absolute", inset: "0", background: `var(--${c})`, clipPath: "circle(0px at 0px 0px)", visibility: "hidden" } });
  const back = mk(colors[1]);
  const front = mk(colors[0]);
  const el = h("div", { class: "at-wipe", style: { position: "absolute", inset: "0", pointerEvents: "none" } });
  el.append(back, front);
  const ease = (p) => (p < 0.5 ? 4 * p * p * p : 1 - Math.pow(-2 * p + 2, 3) / 2);
  const layer = (node, t, T, i, delay) => {
    const [ax, ay] = corners[i % 4];
    const [bx, by] = [W - ax, H - ay];
    const a = (t - (T - dIn - delay)) / dIn;
    const b = (t - (T + delay * 0.6)) / dOut;
    if (a <= 0 || b >= 1) return setStyle(node, "visibility", "hidden");
    setStyle(node, "visibility", "visible");
    if (b <= 0) setStyle(node, "clipPath", `circle(${(R * ease(clamp01(a))).toFixed(1)}px at ${ax}px ${ay}px)`);
    else setStyle(node, "clipPath", `circle(${(R * (1 - ease(clamp01(b)))).toFixed(1)}px at ${bx}px ${by}px)`);
  };
  return {
    el,
    render(t) {
      const i = times.findIndex((T) => t >= T - dIn - lag - 0.02 && t <= T + dOut + lag + 0.02);
      if (i < 0) {
        setStyle(back, "visibility", "hidden");
        setStyle(front, "visibility", "hidden");
        return;
      }
      // palette: [[前, 后], ...] 按转场次序轮换颜色
      const pair = palette ? palette[i % palette.length] : colors;
      setStyle(front, "background", `var(--${pair[0]})`);
      setStyle(back, "background", `var(--${pair[1]})`);
      layer(back, t, times[i], i, lag);
      layer(front, t, times[i], i, 0);
    },
  };
}

/**
 * 年份标尺:屏幕顶部一条细轴,标出几个关键年份,当前讲到的年份放大、点亮,指针弹簧移动过去。
 * years: [1950, 1956, ...];keys: [[t, 年份下标]](-1 表示藏起来);讲历史时给观众一个「现在在哪儿」的锚点。
 */
export function yearBar(stage, { years, keys, y = 58, w = 1180 }) {
  const el = h("div", { class: "at-yb", style: { position: "absolute", left: `${(stage.W - w) / 2}px`, top: `${y}px`, width: `${w}px`, height: "56px", pointerEvents: "none" } });
  const line = h("div", { style: { position: "absolute", left: "0", right: "0", top: "27px", height: "4px", borderRadius: "2px", background: "var(--line)" } });
  const fill = h("div", { style: { position: "absolute", left: "0", top: "27px", height: "4px", borderRadius: "2px", background: "var(--m6)", transformOrigin: "0 50%", width: `${w}px` } });
  const knob = h("div", { style: { position: "absolute", top: "18px", width: "22px", height: "22px", marginLeft: "-11px", borderRadius: "50%", background: "var(--m6)", border: "4px solid var(--surface)", boxShadow: "var(--shadow)" } });
  el.append(line, fill);
  const X = (i) => (w * i) / (years.length - 1);
  const labs = years.map((yr, i) => {
    const d = h("div", { text: String(yr), style: { position: "absolute", left: `${X(i)}px`, top: "-4px", transform: "translateX(-50%)", font: "600 20px/1 var(--sans)", color: "var(--ink3)", whiteSpace: "nowrap", transformOrigin: "50% 100%" } });
    const tick = h("div", { style: { position: "absolute", left: `${X(i) - 4}px`, top: "25px", width: "8px", height: "8px", borderRadius: "50%", background: "var(--line)" } });
    el.append(tick, d);
    return { d, tick };
  });
  el.append(knob);
  const K = keys.map(([t, i]) => [t, Math.max(0, i)]);
  const V = keys.map(([t, i]) => [t, i < 0 ? 0 : 1]);
  const SLIDE = { w: 2 * Math.PI * 1.6, z: 0.8 };
  return {
    el,
    render(t) {
      const vis = track(t, V, { w: 2 * Math.PI * 2.2, z: 1 });
      setStyle(el, "opacity", clamp01(vis).toFixed(3));
      setStyle(el, "transform", `translateY(${((1 - clamp01(vis)) * -16).toFixed(2)}px)`);
      if (vis < 0.01) return;
      const pos = track(t, K, SLIDE);
      setStyle(knob, "left", `${X(pos).toFixed(1)}px`);
      setStyle(fill, "transform", `scaleX(${(X(pos) / w).toFixed(4)})`);
      labs.forEach((q, i) => {
        const near = clamp01(1 - Math.abs(pos - i) * 1.4);
        setStyle(q.d, "color", near > 0.5 ? "var(--m6-d)" : i <= pos ? "var(--ink2)" : "var(--ink3)");
        setStyle(q.d, "transform", `translateX(-50%) scale(${(1 + 0.45 * near).toFixed(3)})`);
        setStyle(q.d, "fontWeight", near > 0.5 ? "800" : "600");
        setStyle(q.tick, "background", i <= pos + 0.01 ? "var(--m6)" : "var(--line)");
      });
    },
  };
}
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall