Turn any ordered process into a data-driven vertical or horizontal scroll story with a base line, progress fill, active step states, responsive collapse, semant
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-scroll-progress-timeline-2c89be1a1270 ,按照其中的说明把「scroll-progress-timeline」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Use one progress line to connect ordered information. The sequence must remain complete, readable, and navigable before animation is added.
Keep the content data-driven:
const steps = [
{ id: "brief", number: "01", title: "Set the direction", body: "..." },
{ id: "build", number: "02", title: "Make the system", body: "..." },
{ id: "ship", number: "03", title: "Release and learn", body: "..." }
];
Render it as an ordered list with real headings. The line, dots, media, and active state enhance that structure; they do not replace it.
transform-origin: top for vertical or left for horizontal.scaleY(progress) or scaleX(progress) so updates stay on the compositor.const progress = Math.min(1, Math.max(0,
(viewportAnchor - lineStart) / (lineEnd - lineStart)
));
line.style.transform = `scaleY(${progress})`;
Schedule DOM writes in one animation frame. Recalculate geometry after font and image loading, resize, orientation changes, and content mutation.
Use small opacity, translate, scale, blur, color, or media transitions. Keep every step readable while inactive. Expose active index with aria-current="step" only when that state is meaningful and current; do not announce every scroll update with a live region.
Use IntersectionObserver for simple active-state entry. Use a normalized scroll measurement or GSAP ScrollTrigger when the line must fill continuously or coordinate pinned media.
scroll-margin for sticky headers.Under prefers-reduced-motion: reduce, show the complete line or discrete reached states without scrubbed interpolation, blur, pinning, or large transforms. Keep ordinary document flow and all step content.
Test variable step counts, uneven card heights, missing media, long translations, 390/768/1024/1440 widths, 200% zoom, fast forward and reverse scrolling, direct anchor navigation, keyboard order, reduced motion, late font/image layout, route cleanup, and console errors. The active step and line head must agree at every boundary.
Use demo/index.html as the working reference and demo/PROMPT.md to recreate or remix it. Keep REFERENCES.md as the links-only implementation source list.