Skip to content

anbeime/skill / skills/anything2explainer/anything2explainer

anything2explainer

Unverified

给一个主题,产出一条黑底 MG 风格(幕底可选星点或点阵波)、有配音字幕章节进度条的科普讲解视频(中文或英文;Remotion 代码动画;时长由用户定,常用 3–5 分钟)。内含可编译模板、图元库、配音/分镜/渲染工具、风格与动效规范、多 agent 分工协议与 QC 判据,以及一条完整样片(《RAG 与知识库》)作为质量标尺。Turn any topic into a narrated motion-graphics explainer video in Chinese or English, on a black canvas with a star-field or dot-field backdrop, TTS voiceover, subtitles and a chapter progress bar, every frame drawn in code with Remotion. Use when the user asks for an explainer, educational or science-communication video about a topic, or wants an article or document turned into a video.

FileKindSize
.gitignoreother397 B
CITATION.cffother1.1 KB
LICENSEother4.9 KB
README.mdmarkdown17.2 KB
README_ZH.mdmarkdown16.0 KB
SKILL.mdskill md20.9 KB
examples/contrast/01_hero_size_bad_f0128.jpgbinary44.2 KB
examples/contrast/01_hero_size_good_f0138.jpgbinary50.0 KB
examples/contrast/02_hero_reveal_bad_f1729.jpgbinary49.3 KB
examples/contrast/02_hero_reveal_good_f1105.jpgbinary43.6 KB
examples/contrast/03_big_number_good_f7258.jpgbinary47.2 KB
examples/contrast/03_sparse_axis_bad_f1900.jpgbinary35.3 KB
examples/contrast/04_formula_bad_f3033.jpgbinary55.3 KB
examples/contrast/04_result_number_good_f2613.jpgbinary82.2 KB
examples/contrast/05_clean_bg_good_f1237.jpgbinary61.3 KB
examples/contrast/05_clutter_bg_bad_f1651.jpgbinary36.5 KB
examples/contrast/06_ending_bad_f7540.jpgbinary48.0 KB
examples/contrast/06_ending_good_f8100.jpgbinary57.2 KB
examples/contrast/README.mdmarkdown1.4 KB
examples/contrast/contrast_sheet.jpgbinary398.9 KB
examples/rag/AGENT_RAG_BUILD_RULES.mdmarkdown9.4 KB
examples/rag/AGENT_RAG_QC_RULES.mdmarkdown2.9 KB
examples/rag/README.mdmarkdown1.0 KB
examples/rag/frames/overview_1.jpgbinary282.3 KB
examples/rag/frames/overview_2.jpgbinary331.9 KB
examples/rag/frames/overview_3.jpgbinary326.7 KB
examples/rag/frames/overview_4.jpgbinary374.1 KB
examples/rag/frames/overview_5.jpgbinary319.4 KB
examples/rag/frames/overview_6.jpgbinary285.3 KB
examples/rag/frames/ref_agentic_loop_f6900.jpgbinary71.6 KB
examples/rag/frames/ref_chapter_card_f1490.jpgbinary35.8 KB
examples/rag/frames/ref_chunk_size_f2200.jpgbinary86.5 KB
examples/rag/frames/ref_graphrag_f6600.jpgbinary71.6 KB
examples/rag/frames/ref_hnsw_f3260.jpgbinary85.3 KB
examples/rag/frames/ref_hybrid_rrf_f4640.jpgbinary95.8 KB
examples/rag/frames/ref_long_context_f7480.jpgbinary63.0 KB
examples/rag/frames/ref_lost_in_middle_f5250.jpgbinary89.0 KB
examples/rag/frames/ref_moat_f8100.jpgbinary71.4 KB
examples/rag/frames/ref_paper_f1300.jpgbinary88.4 KB
examples/rag/frames/ref_parse_f1760.jpgbinary74.0 KB
examples/rag/frames/ref_rag_reveal_f1090.jpgbinary45.1 KB
examples/rag/frames/ref_ragas_f6150.jpgbinary129.7 KB
examples/rag/frames/ref_rerank_funnel_f4900.jpgbinary80.1 KB
examples/rag/frames/ref_shortcomings_f0600.jpgbinary83.6 KB
examples/rag/frames/ref_title_f0058.jpgbinary48.9 KB
examples/rag/frames/ref_vector_space_f2990.jpgbinary93.2 KB
examples/rag/narration.txtmarkdown4.4 KB
examples/rag/qc/qc_v1_C1.mdmarkdown14.4 KB
examples/rag/qc/qc_v1_C2.mdmarkdown22.5 KB
examples/rag/qc/qc_v1_C3.mdmarkdown16.7 KB
examples/rag/qc/qc_v1_C4.mdmarkdown23.0 KB
examples/rag/qc/qc_v3_final.mdmarkdown12.7 KB
examples/rag/research.mdmarkdown47.7 KB
examples/rag/shots_src/G0/Overlay.tsxother10.5 KB
examples/rag/shots_src/G0/Preview.tsxother224 B
examples/rag/shots_src/G0/index.tsscript1.4 KB
examples/rag/shots_src/G0/util.tsscript167 B
examples/rag/shots_src/G1/BUILD_NOTES.mdmarkdown12.1 KB
examples/rag/shots_src/G1/Preview.tsxother344 B
examples/rag/shots_src/G1/SC01.tsxother448 B
examples/rag/shots_src/G1/SC02.tsxother4.6 KB
examples/rag/shots_src/G1/SC03.tsxother4.7 KB
examples/rag/shots_src/G1/SC04.tsxother4.9 KB
examples/rag/shots_src/G1/SC05.tsxother7.0 KB
examples/rag/shots_src/G1/index.tsscript664 B
examples/rag/shots_src/G1/layout.tsxother6.8 KB
examples/rag/shots_src/G2/BUILD_NOTES.mdmarkdown15.3 KB
examples/rag/shots_src/G2/Preview.tsxother344 B
examples/rag/shots_src/G2/SC06.tsxother4.0 KB
examples/rag/shots_src/G2/SC07.tsxother5.1 KB
examples/rag/shots_src/G2/SC08.tsxother6.1 KB
examples/rag/shots_src/G2/SC09.tsxother7.1 KB
examples/rag/shots_src/G2/SC10.tsxother5.6 KB
examples/rag/shots_src/G2/index.tsscript657 B
examples/rag/shots_src/G2/parts.tsxother10.7 KB
examples/rag/shots_src/G3/BUILD_NOTES.mdmarkdown13.2 KB
examples/rag/shots_src/G3/Preview.tsxother344 B
examples/rag/shots_src/G3/SC11.tsxother3.9 KB
examples/rag/shots_src/G3/SC12.tsxother3.0 KB
examples/rag/shots_src/G3/SC13.tsxother2.3 KB
examples/rag/shots_src/G3/SC14.tsxother5.1 KB
examples/rag/shots_src/G3/SC15.tsxother7.3 KB
examples/rag/shots_src/G3/g3ui.tsxother12.1 KB
examples/rag/shots_src/G3/index.tsscript660 B
examples/rag/shots_src/G4/BUILD_NOTES.mdmarkdown13.1 KB
examples/rag/shots_src/G4/Preview.tsxother344 B
examples/rag/shots_src/G4/SC16.tsxother5.1 KB
examples/rag/shots_src/G4/SC17.tsxother5.9 KB
examples/rag/shots_src/G4/SC18.tsxother9.8 KB
examples/rag/shots_src/G4/SC19.tsxother6.9 KB
examples/rag/shots_src/G4/SC20.tsxother8.3 KB
examples/rag/shots_src/G4/index.tsscript660 B
examples/rag/shots_src/G4/vspace.tsscript3.2 KB
examples/rag/shots_src/G5/BUILD_NOTES.mdmarkdown12.9 KB
examples/rag/shots_src/G5/Preview.tsxother344 B
examples/rag/shots_src/G5/SC21.tsxother5.3 KB
examples/rag/shots_src/G5/SC22.tsxother5.0 KB
examples/rag/shots_src/G5/SC23.tsxother5.3 KB
examples/rag/shots_src/G5/SC24.tsxother5.7 KB
examples/rag/shots_src/G5/SC25.tsxother8.5 KB
examples/rag/shots_src/G5/g5util.tsxother3.4 KB
examples/rag/shots_src/G5/index.tsscript660 B
examples/rag/shots_src/G5/vspace.tsxother3.7 KB
examples/rag/shots_src/G6/BUILD_NOTES.mdmarkdown12.8 KB
examples/rag/shots_src/G6/Preview.tsxother344 B
examples/rag/shots_src/G6/SC26.tsxother7.9 KB
examples/rag/shots_src/G6/SC27.tsxother3.8 KB
examples/rag/shots_src/G6/SC28.tsxother7.9 KB
examples/rag/shots_src/G6/SC29.tsxother5.8 KB
examples/rag/shots_src/G6/SC30.tsxother3.0 KB
examples/rag/shots_src/G6/index.tsscript881 B
examples/rag/shots_src/G6/ui.tsxother12.4 KB
examples/rag/shots_src/G7/BUILD_NOTES.mdmarkdown12.9 KB
examples/rag/shots_src/G7/Preview.tsxother344 B
examples/rag/shots_src/G7/SC31.tsxother1.2 KB
examples/rag/shots_src/G7/SC32.tsxother3.3 KB
examples/rag/shots_src/G7/SC33.tsxother5.4 KB
examples/rag/shots_src/G7/SC34.tsxother5.8 KB
examples/rag/shots_src/G7/SC35.tsxother2.7 KB
examples/rag/shots_src/G7/SC36.tsxother7.8 KB
examples/rag/shots_src/G7/SC37.tsxother10.4 KB
examples/rag/shots_src/G7/g7ui.tsxother9.5 KB
examples/rag/shots_src/G7/index.tsscript818 B
examples/rag/shots_src/G8/BUILD_NOTES.mdmarkdown14.1 KB
examples/rag/shots_src/G8/Preview.tsxother375 B
examples/rag/shots_src/G8/SC38.tsxother3.9 KB
examples/rag/shots_src/G8/SC39.tsxother2.7 KB
examples/rag/shots_src/G8/SC40.tsxother899 B
examples/rag/shots_src/G8/SC41.tsxother4.8 KB
examples/rag/shots_src/G8/SC42.tsxother3.1 KB
examples/rag/shots_src/G8/SC43.tsxother2.7 KB
examples/rag/shots_src/G8/SC44.tsxother4.5 KB
examples/rag/shots_src/G8/index.tsscript818 B
examples/rag/shots_src/G8/shared.tsxother21.0 KB
examples/rag/storyboard_src.mdmarkdown34.8 KB
examples/rag/timeline.mdmarkdown6.2 KB
examples/rag/ui_rag.tsxother19.2 KB
examples/rag/交付说明.mdmarkdown4.6 KB
examples/rag/分镜表.mdmarkdown32.7 KB
reference/agent-build-rules.mdmarkdown13.0 KB
reference/agent-qc-rules.mdmarkdown6.2 KB
reference/composition-and-light.mdmarkdown11.5 KB
reference/lessons.mdmarkdown32.1 KB
reference/motion-vocabulary.mdmarkdown10.1 KB
reference/narration-guidance.mdmarkdown7.0 KB
reference/narration-storyboard.mdmarkdown21.4 KB
reference/prompts.mdmarkdown8.2 KB
reference/research-brief.mdmarkdown3.4 KB
reference/style-guide.mdmarkdown10.5 KB
template/.gitignoreother90 B
template/package.jsonmanifest457 B
template/public/fonts/Audiowide-Regular.ttfbinary68.3 KB
template/public/fonts/Exo2-Italic.ttfbinary295.5 KB
template/public/fonts/LICENSE.mdmarkdown5.4 KB
template/public/fonts/NotoSansSC.ttfbinary16.9 MB
template/public/fonts/Orbitron[wght].ttfbinary37.7 KB
template/remotion.config.tsscript1.1 KB
template/script/narration.txtmarkdown591 B
template/scripts/frame_metrics.pyscript9.4 KB
template/scripts/motion_check.pyscript7.9 KB
template/scripts/new_project.shscript1.4 KB
template/scripts/preview.shscript1.1 KB
template/scripts/render.shscript989 B
template/scripts/render_storyboard.pyscript1.3 KB
template/scripts/selfcheck.pyscript6.2 KB
template/scripts/sheet.pyscript1.6 KB
template/scripts/still.shscript1.1 KB
template/scripts/test_render.shscript732 B
template/scripts/tts_build.pyscript28.5 KB
template/src/Main.tsxother2.5 KB
template/src/Root.tsxother1.8 KB
template/src/common/DotFieldBg.tsxother3.7 KB
template/src/common/Fog.tsxother1.5 KB
template/src/common/Footage.tsxother2.8 KB
template/src/common/Glitch.tsxother5.3 KB
template/src/common/ProgressBar.tsxother4.0 KB
template/src/common/StarField.tsxother5.6 KB
template/src/common/Subtitle.tsxother3.1 KB
template/src/common/easing.tsscript5.4 KB
template/src/common/index.tsscript462 B
template/src/common/lib.tsxother4.5 KB
template/src/common/subs.tsscript175 B
template/src/common/textfit.tsscript3.3 KB
template/src/common/timeline.tsscript355 B
template/src/common/types.tsscript870 B
template/src/config.tsscript4.0 KB
template/src/fx.tsxother16.8 KB
template/src/index.tsscript89 B
template/src/overlay/Overlay.tsxother13.7 KB
template/src/overlay/Preview.tsxother250 B
template/src/overlay/index.tsscript1.6 KB
template/src/shots/G1/Preview.tsxother356 B
template/src/shots/G1/index.tsscript478 B
template/src/shots/G2/Preview.tsxother356 B
template/src/shots/G2/index.tsscript478 B
template/src/shots/G3/Preview.tsxother356 B
template/src/shots/G3/index.tsscript478 B
template/src/shots/G4/Preview.tsxother356 B
template/src/shots/G4/index.tsscript478 B
template/src/shots/G5/Preview.tsxother356 B

examples/rag/shots_src/G6/ui.tsx

View on GitHub
import React from 'react';
import {FONT_HEAVY, FONT_TECH, FONT_ORB, rnd, clamp01} from '../../common';
import {PURPLE, PURPLE_LIGHT, WHITE, GREY_LIGHT, GREY_LINE, GLOW_PURPLE_S, Box, CText, abs} from '../../ui';

/**
 * G6 组(第 3 章下半:重排 / 组装 / 生成 / 引用)专用图元。
 * 全部纯函数、绝对定位;动画量由镜头按 N 算好后传入。
 */

// ---------- 颜色工具 ----------
const parseColor = (c: string): number[] => {
  if (c.startsWith('#')) {
    const s = c.slice(1);
    return [parseInt(s.slice(0, 2), 16), parseInt(s.slice(2, 4), 16), parseInt(s.slice(4, 6), 16)];
  }
  const m = c.match(/-?\d+(\.\d+)?/g);
  return m ? m.slice(0, 3).map((v) => parseFloat(v)) : [0, 0, 0];
};
/** 两个颜色(#rrggbb 或 rgb(...))线性混合(k=0 → a,k=1 → b),可嵌套 */
export const mixHex = (a: string, b: string, k: number) => {
  const A = parseColor(a), B = parseColor(b), t = clamp01(k);
  return `rgb(${A.map((v, i) => Math.round(v + (B[i] - v) * t)).join(',')})`;
};

// ---------- 漏斗层(复制 R2 Trap:显式 id、children 可混排字体)----------
/** 非对称水平渐变 stops(R2 SC014 实测):[t, grey, purple] */
const STOPS: Array<[number, number, number[]]> = [
  [0, 224, [230, 220, 255]], [0.09, 212.3, [206, 190, 253]], [0.18, 200.6, [171, 139, 250]], [0.26, 190.2, [138, 102, 250]], [0.35, 178.5, [122, 72, 247]], [0.43, 168.1, [117, 55, 240]],
  [0.5, 160, [101, 46, 249]], [0.6, 162.5, [102, 45, 248]], [0.69, 171, [111, 59, 247]], [0.77, 184, [131, 87, 246]], [0.86, 197, [163, 133, 245]], [0.93, 210, [200, 185, 252]], [1, 224, [230, 220, 255]],
];
const rgb = (c: number[]) => `rgb(${c.map((v) => Math.round(v)).join(',')})`;
/** k=0 灰、k=1 紫 */
export const mixStops = (k: number): Array<[number, string]> => STOPS.map(([t, g, p]) => [t, rgb(p.map((v) => g + (v - g) * k))] as [number, string]);
export const GREY_STOPS = mixStops(0);
export const PURP_STOPS = mixStops(1);

export const TrapRag: React.FC<{id: string; cx: number; y: number; wTop: number; wBot: number; h: number; stops?: Array<[number, string]>; stroke?: number; opacity?: number; textShadow?: string; children?: React.ReactNode; style?: React.CSSProperties}> = ({id, cx, y, wTop, wBot, h, stops = PURP_STOPS, stroke = 2, opacity = 1, textShadow = '0 2px 12px rgba(0,0,0,.45)', children, style}) => {
  const W = wTop + 8, x0 = cx - W / 2;
  const pts = `4,1 ${4 + wTop},1 ${4 + (wTop + wBot) / 2},${1 + h} ${4 + (wTop - wBot) / 2},${1 + h}`;
  return (
    <div style={{...abs(x0, y, W, h + 4), opacity, ...style}}>
      <svg width={W} height={h + 4} style={{position: 'absolute', left: 0, top: 0, overflow: 'visible'}}>
        <defs>
          <linearGradient id={id} x1="0" y1="0" x2="1" y2="0">
            {stops.map(([o, c], i) => <stop key={i} offset={o} stopColor={c} />)}
          </linearGradient>
        </defs>
        <polygon points={pts} fill={`url(#${id})`} stroke="#FFF" strokeWidth={stroke} strokeLinejoin="miter" />
      </svg>
      <div style={{position: 'absolute', left: 0, top: 0, width: W, height: h + 2, display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 12, color: WHITE, textShadow, whiteSpace: 'nowrap'}}>{children}</div>
    </div>
  );
};
/** 漏斗层内文字(Noto 700) */
export const TrapText: React.FC<{size?: number; children: React.ReactNode; dy?: number}> = ({size = 34, children, dy = -3}) => (
  <span style={{fontFamily: FONT_HEAVY, fontWeight: 700, fontSize: size, lineHeight: 1, transform: `translateY(${dy}px)`, display: 'inline-block'}}>{children}</span>
);
/** 漏斗层内英文技术词(Exo 2 斜体白,压窄) */
export const TrapTech: React.FC<{size?: number; children: React.ReactNode; scaleX?: number}> = ({size = 34, children, scaleX = 0.86}) => (
  <span style={{fontFamily: FONT_TECH, fontStyle: 'italic', fontWeight: 700, fontSize: size, lineHeight: 1, letterSpacing: 1, transform: `scaleX(${scaleX})`, display: 'inline-block'}}>{children}</span>
);

// ---------- 迷你文本块卡(召回候选) ----------
/** 小卡:黑底白边 + 3 条灰线。grey ∈[0,1] 灰化程度;active ∈[0,1] 紫化程度(互斥使用) */
export const MiniCard: React.FC<{x: number; y: number; w: number; h: number; seed: number; grey?: number; active?: number; opacity?: number; r?: number; lines?: number}> = ({x, y, w, h, seed, grey = 0, active = 0, opacity = 1, r = 4, lines = 3}) => {
  const border = mixHex(mixHex(WHITE, '#6A6A6A', grey), WHITE, active);
  const fill = mixHex(mixHex('#000000', '#0C0C0C', grey), PURPLE, active);
  const line = mixHex(mixHex(GREY_LIGHT, '#555555', grey), WHITE, active);
  const pad = Math.max(4, w * 0.14);
  const lineH = Math.max(2, Math.round(h * 0.055));
  return (
    <div style={{...abs(x, y, w, h), boxSizing: 'border-box', background: fill, border: `1.5px solid ${border}`, borderRadius: r, opacity, boxShadow: active > 0.5 ? GLOW_PURPLE_S : undefined}}>
      {Array.from({length: lines}, (_, i) => {
        const lw = (0.55 + 0.4 * rnd(seed, i, 3)) * (w - 2 * pad) * (i === lines - 1 ? 0.7 : 1);
        const top = pad + 2 + i * ((h - 2 * pad - 4) / Math.max(1, lines - 0.4));
        return <div key={i} style={{position: 'absolute', left: pad, top, width: lw, height: lineH, background: line, opacity: 0.9, borderRadius: 1}} />;
      })}
    </div>
  );
};

// ---------- 证据卡(带 [n] 标签) ----------
export const EvidenceCard: React.FC<{x: number; y: number; w?: number; h?: number; label: string; seed?: number; opacity?: number; style?: React.CSSProperties}> = ({x, y, w = 96, h = 62, label, seed = 1, opacity = 1, style}) => (
  <div style={{...abs(x, y, w, h), opacity, ...style}}>
    <Box x={0} y={0} w={w} h={h} r={6} sw={2} />
    <CText cx={22} cy={16} size={22} weight={700} color={PURPLE_LIGHT} dy={-1}>{label}</CText>
    {[0, 1].map((i) => <div key={i} style={{position: 'absolute', left: 12, top: 32 + i * 12, width: (0.55 + 0.35 * rnd(seed, i, 7)) * (w - 24), height: 3, background: GREY_LIGHT, opacity: 0.85}} />)}
  </div>
);

// ---------- 来源卡(员工手册 p.12 / 差旅补充规定 2025) ----------
export const SourceCard: React.FC<{x: number; y: number; w?: number; h?: number; title: string; active?: number; opacity?: number; scale?: number; seed?: number}> = ({x, y, w = 280, h = 70, title, active = 0, opacity = 1, scale = 1, seed = 2}) => (
  <div style={{...abs(x, y, w, h), opacity, transform: scale === 1 ? undefined : `scale(${scale.toFixed(3)})`, transformOrigin: '50% 50%'}}>
    <Box x={0} y={0} w={w} h={h} r={8} sw={2} stroke={mixHex(WHITE, PURPLE_LIGHT, active)} glow={active > 0.01 ? `0 0 ${Math.round(24 * active)}px ${Math.round(8 * active)}px rgba(102,45,248,${(0.6 * active).toFixed(2)})` : undefined} />
    <div style={{position: 'absolute', left: 16, top: 12, fontFamily: FONT_HEAVY, fontWeight: 700, fontSize: 22, lineHeight: 1, color: WHITE, whiteSpace: 'nowrap'}}>{title}</div>
    {[0, 1].map((i) => <div key={i} style={{position: 'absolute', left: 16, top: 44 + i * 10, width: (0.5 + 0.4 * rnd(seed, i, 5)) * (w - 32), height: 3, background: GREY_LIGHT, opacity: 0.8}} />)}
  </div>
);

// ---------- 答复卡(SC29 → SC30 共用,保证组界无缝) ----------
export const ANS_W = 420, ANS_H = 180;
const L1 = '差旅住宿上限为每天 600 元';
const L2 = '一线城市 800 元';
export const ANS_TOTAL = L1.length + 1 + L2.length + 1; // 打字机总字符数
/** 引用角标中心(相对答复卡左上角):按 Noto 26px 估算(CJK 26 / 数字 14.9 / 空格 6.8),still 校正后可微调 */
export const CITE_ANCHOR: Array<[number, number]> = [[20 + 318 + 14, 60], [20 + 188 + 14, 108]];
const Cite: React.FC<{n: number; op: number}> = ({n, op}) => (
  <span style={{display: 'inline-block', position: 'relative', top: -9, fontFamily: FONT_ORB, fontWeight: 700, fontSize: 20, color: PURPLE_LIGHT, marginLeft: 2, marginRight: 2, opacity: op, textShadow: '0 0 8px rgba(161,117,241,.6)'}}>[{n}]</span>
);
/**
 * 答复卡:黑底白边 420×180 + 「回答」紫小标签 + 两行 26px 正文;typed = 已打出的字符数(≥ANS_TOTAL 全显);
 * citeShow = 是否渲染角标(占位,false 时文字不预留位置);citeOp = 角标不透明度(入场期间只变透明度、不回流)。
 */
export const AnswerCard: React.FC<{x: number; y: number; typed?: number; citeShow?: boolean; citeOp?: number; opacity?: number; cursor?: boolean}> = ({x, y, typed = ANS_TOTAL, citeShow = true, citeOp = 1, opacity = 1, cursor = false}) => {
  const t = Math.max(0, Math.min(ANS_TOTAL, Math.floor(typed)));
  const a = L1.slice(0, Math.min(t, L1.length));
  const comma = t > L1.length ? ',' : '';
  const b = t > L1.length + 1 ? L2.slice(0, t - L1.length - 1) : '';
  const period = t >= ANS_TOTAL ? '。' : '';
  const line1Done = t >= L1.length;
  const showCite = citeShow;
  const cites = citeOp;
  const cur = cursor && t < ANS_TOTAL ? <span style={{display: 'inline-block', width: 3, height: 26, background: WHITE, marginLeft: 2, verticalAlign: -3}} /> : null;
  const lineStyle: React.CSSProperties = {position: 'absolute', left: 20, fontFamily: FONT_HEAVY, fontWeight: 500, fontSize: 26, lineHeight: '36px', color: WHITE, whiteSpace: 'nowrap'};
  return (
    <div style={{...abs(x, y, ANS_W, ANS_H), opacity}}>
      <Box x={0} y={0} w={ANS_W} h={ANS_H} r={12} sw={2} />
      <Box x={16} y={-16} w={72} h={32} r={16} fill={PURPLE} sw={2}>
        <div style={{position: 'absolute', inset: 0, display: 'flex', alignItems: 'center', justifyContent: 'center', fontFamily: FONT_HEAVY, fontWeight: 700, fontSize: 22, color: WHITE, lineHeight: 1, transform: 'translateY(-1px)'}}>回答</div>
      </Box>
      <div style={{...lineStyle, top: 42}}>
        {a}
        {line1Done && showCite ? <Cite n={1} op={cites} /> : null}
        {comma}
        {!line1Done || t === L1.length ? cur : null}
      </div>
      <div style={{...lineStyle, top: 90}}>
        {b}
        {t >= ANS_TOTAL - 1 && showCite ? <Cite n={2} op={cites} /> : null}
        {period}
        {line1Done && t > L1.length ? cur : null}
      </div>
    </div>
  );
};

// ---------- draw-on 折线(SVG 内使用) ----------
export const DrawPath: React.FC<{pts: Array<[number, number]>; p?: number; color?: string; sw?: number; opacity?: number; dashed?: boolean}> = ({pts, p = 1, color = PURPLE_LIGHT, sw = 2.5, opacity = 1, dashed = false}) => {
  if (p <= 0 || pts.length < 2) return null;
  let total = 0;
  for (let i = 1; i < pts.length; i++) total += Math.hypot(pts[i][0] - pts[i - 1][0], pts[i][1] - pts[i - 1][1]);
  const dash = dashed ? `6 6` : `${total}`;
  return <polyline points={pts.map((q) => q.join(',')).join(' ')} fill="none" stroke={color} strokeWidth={sw} strokeLinecap="round" strokeLinejoin="round" strokeDasharray={dashed ? dash : total} strokeDashoffset={dashed ? undefined : total * (1 - clamp01(p))} opacity={opacity} />;
};

// ---------- 打字机 ----------
/** 自 f0 起每 per 帧出 1 字,返回可见字符数 */
export const typedCount = (N: number, f0: number, len: number, per = 2) => (N < f0 ? 0 : Math.min(len, Math.floor((N - f0) / per) + 1));
/** 打字机文本行(Noto 24),末尾方块光标随打字闪烁 */
export const TypeLine: React.FC<{x: number; y: number; text: string; N: number; f0: number; per?: number; size?: number; color?: string; opacity?: number; weight?: number}> = ({x, y, text, N, f0, per = 2, size = 24, color = WHITE, opacity = 1, weight = 500}) => {
  if (N < f0) return null;
  const n = typedCount(N, f0, text.length, per);
  const typing = n < text.length;
  const blink = typing || Math.floor((N - f0) / 8) % 2 === 0 && N - f0 < text.length * per + 40;
  return (
    <div style={{position: 'absolute', left: x, top: y, fontFamily: FONT_HEAVY, fontWeight: weight, fontSize: size, lineHeight: 1.3, color, whiteSpace: 'nowrap', opacity}}>
      {text.slice(0, n)}
      {blink ? <span style={{display: 'inline-block', width: 3, height: size, background: color, marginLeft: 3, verticalAlign: -3}} /> : null}
    </div>
  );
};

/** 分割线(灰细线) */
export const HLine: React.FC<{x: number; y: number; w: number; color?: string; opacity?: number}> = ({x, y, w, color = GREY_LINE, opacity = 1}) => <div style={{...abs(x, y, w, 1.5), background: color, opacity}} />;

/** 角标入场不透明度:8 帧 easeOut 淡入(与 ui.tsx SoftIn 同曲线)。闪烁整改:原 12 帧 glitchOpacity,SC29 不在白名单 */
export const citeOp = (N: number, f0: number, len = 8) => {
  const n = N - f0;
  if (n < 0) return 0;
  return 1 - Math.pow(1 - clamp01(n / len), 2.5);
};
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 469kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 321kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 321kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 321kUpdated Claude CodeCodexVerifiedInstall