Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)75k · #3077

view-transitions

Skill này làm gì

Skill này thêm hoạt ảnh mượt giữa các trạng thái và màn hình trang bằng API View Transitions của trình duyệt. Nó dành cho lập trình viên xây dựng website một trang hoặc nhiều trang.

Khi nào nên dùng

  • ✓Khi việc chuyển trang gây khựng và người dùng mất dấu họ đang ở đâu.
  • ✓Khi một hình ảnh nên mở rộng mượt mà thành màn hình chi tiết.
  • ✓Khi rà soát xem website có đang dùng thư viện animation mà trình duyệt giờ có thể xử lý sẵn hay không.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/view-transitions/SKILL.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/view-transitions/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Chuyển trang trong ứng dụng của tôi trông rất giật. Bạn có thể thêm hiệu ứng chuyển mượt mà mà không thêm một thư viện animation lớn không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent bọc các thay đổi trang trong lệnh chuyển đổi của trình duyệt và đặt tên cho các phần tử nên có hoạt ảnh riêng. Trình duyệt chụp ảnh trước và sau, rồi tạo hoạt ảnh chuyển giữa hai ảnh đó.

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.

Use the View Transitions API for smooth page and component transitions

Jarring instant page changes are one of the most noticeable perceived- performance problems in web applications. Smooth transitions help users maintain context during navigation — they understand where they came from and where they are going. Previously, achieving this required complex JavaScript animation libraries; the View Transitions API delivers it natively at a fraction of the code cost.

Quick Reference

  • Wrap DOM mutations in document.startViewTransition() for same-page transitions
  • Add view-transition-name to elements that should animate individually (not the whole page)
  • Use @starting-style and ::view-transition-* pseudo-elements to customise animations
  • Enable cross-document transitions in CSS with @view-transition { navigation: auto }

Check

Check whether the site uses the View Transitions API or a JavaScript animation library for page and component transitions.

Fix

Implement view transitions using document.startViewTransition() for SPA route changes or @view-transition for MPA cross-document navigation.

Explain

Explain how the View Transitions API captures before/after snapshots and animates between them, and how view-transition-name enables shared-element transitions.

Code Review

Review transition implementation for missing prefers-reduced-motion guards, duplicate view-transition-name values (must be unique per snapshot), and transitions that may cause layout thrash in the old/new state.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/css/view-transitions

Câu hỏi thường gặp

Có cần thư viện JavaScript không?

Skill cho biết API View Transitions được tích hợp sẵn trong trình duyệt, nên tránh được nhiều code mà thư viện animation cần.

Hiệu ứng chuyển có nên tôn trọng cài đặt giảm chuyển động không?

Có. Skill đánh dấu việc thiếu bảo vệ prefers-reduced-motion là một vấn đề cần sửa.

view-transition-name dùng để làm gì?

Nó cho phép một phần tử có hoạt ảnh riêng, như một hình ảnh được chia sẻ giữa hai trang.

Chi tiết

Mô tả gốc của tác giả

Use when adding page transition animations, image expand/contract effects, shared-element transitions, or improving navigation UX in a single-page or multi-page application.

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#3077
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự