scroll-progress-timeline
Skill này làm gì
Skill này xây một đường tiến trình nối các bước có thứ tự và làm nổi bật từng bước khi người đọc cuộn. Phù hợp với nhà thiết kế và lập trình viên trình bày quy trình onboarding, lộ trình, nghiên cứu điển hình hoặc quy trình.
Khi nào nên dùng
- ✓Khi bạn có một quy trình có thứ tự, như onboarding hoặc luồng thanh toán, cần hiển thị tiến độ khi cuộn.
- ✓Khi một trang lộ trình hoặc lịch sử cần một đường tự đầy khi người đọc đi qua.
- ✓Khi các bước vẫn phải dễ đọc trên điện thoại và khi không có chuyển động.
Liên kết skill
https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/scroll-progress-timeline/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tôi muốn hiển thị năm bước onboarding của mình thành một dòng thời gian, nơi một đường dần đầy khi người ta cuộn xuống.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent xây một danh sách có thứ tự thật, vẽ một đường nền và một đường tiến trình phía trên, rồi tính tiến độ từ bước đầu và bước cuối. Các bước đang hoạt động được làm nổi bật khi đường tiến trình chạm đến chúng.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Scroll Progress Timeline
Use one progress line to connect ordered information. The sequence must remain complete, readable, and navigable before animation is added.
Model the steps
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.
Build the line
- Render a quiet base line behind every point.
- Place one progress line on top with
transform-origin: topfor vertical orleftfor horizontal. - Measure the first and last point centers, not arbitrary section edges.
- Normalize scroll position between those centers.
- Apply
scaleY(progress)orscaleX(progress)so updates stay on the compositor. - Mark a step active when the progress head crosses its center.
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.
Choose the layout
- Use a centered alternating timeline only when both sides have enough width and similar content weight.
- Use a left rail for long copy, compact steps, or mixed card heights.
- Use a horizontal line for short sequences with concise labels and explicit keyboard-safe overflow.
- Use pinned full-screen chapters only when each step carries a distinct visual state. Keep the pin finite and release before the next section.
- Collapse to a simple left rail on small screens. Do not preserve alternation at the expense of reading order.
Animate step state
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.
Handle navigation
- Make step links real anchors when users can jump within the process.
- Add
scroll-marginfor sticky headers. - Preserve focus and do not move it during passive scrolling.
- Keep URLs and browser history stable unless the user explicitly selects a step.
- If steps are interactive, use buttons or links with visible focus; never make a decorative dot the only control.
Reduce motion
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.
Verify
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.
Câu hỏi thường gặp
Hoạt ảnh có che nội dung không?
Không. Skill nói chuỗi phải đầy đủ và dễ đọc trước khi thêm hoạt ảnh.
Có hoạt động trên điện thoại không?
Skill bao gồm việc thu gọn theo kích thước, nên bố cục có thể đổi cho màn hình hẹp.
Có hỗ trợ chế độ giảm chuyển động không?
Có. Skill có hành vi giảm chuyển động.
Chi tiết
Mô tả gốc của tác giả
Turn any ordered process into a data-driven vertical or horizontal scroll story with a base line, progress fill, active step states, responsive collapse, semantic fallback, and reduced-motion behavior. Use for onboarding, checkout, roadmaps, recipes, case studies, service processes, histories, or narratives where progress through the sequence should become visible while scrolling.
repo: MengTo/Skills
Độ phổ biến
- Sao GitHub
- 7.2k
- Vị trí xếp hạng
- #13462
- Giấy phép
- MIT
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
3d-cloth-material
7.2kGiúp agent của bạn tạo vải dệt 3D trông thật trong Three.js, với sợi dệt, ánh bóng nhẹ, nếp gấp tự nhiên, viền gấu và đường may.
3d-falling-leaves
7.2kGiúp agent của bạn thêm lá rơi chân thực vào cảnh 3D, với lá xoay tròn, trôi theo gió và được tái sử dụng khi máy quay di chuyển.
3d-four-seasons
7.2kGiúp agent của bạn thêm diện mạo xuân, hạ, thu, đông vào cảnh 3D, thay đổi cây cối, ánh sáng, bầu trời và tuyết mà không cần dựng lại cảnh.
3d-high-poly-models
7.2kGiúp agent của bạn dựng mô hình 3D chi tiết với hình dạng mượt và cạnh trông thật, rồi tạo các phiên bản nhẹ hơn chạy tốt trên web.
Skill tương tự
blender-motion-state-inspection
280kCho phép kiểm tra chi tiết trong hoạt ảnh 3D. Hữu ích để kiểm tra tư thế, chuyển động và độ thẳng hàng của nhân vật trong hoạt ảnh.
manim-video
280kGiúp agent tạo video giải thích hoạt hình. Dùng Manim để tạo biểu đồ và sơ đồ rõ ràng cho các khái niệm kỹ thuật.
remotion-video-creation
280kHướng dẫn agent tạo video bằng React với thư viện Remotion. Bao gồm các thực hành tốt nhất về hoạt ảnh, âm thanh, phụ đề và các yếu tố hình ảnh khác.