apple-design
Skill này làm gì
Skill này chia sẻ các nguyên tắc từ các bài nói về thiết kế của Apple và áp dụng vào giao diện web. Dành cho lập trình viên và nhà thiết kế muốn các tương tác kéo, vuốt và sheet có cảm giác vật lý và đáp ứng.
Khi nào nên dùng
- ✓Khi bạn xây hoặc rà soát một giao diện điều khiển bằng cử chỉ như kéo, vuốt hoặc sheet.
- ✓Khi bạn muốn hiệu ứng lò xo có thể bị ngắt và đổi hướng.
- ✓Khi bạn cần hỗ trợ chế độ giảm chuyển động hoặc tinh chỉnh kiểu chữ và chất liệu.
Liên kết skill
https://github.com/spree/spree/blob/main/.agents/skills/apple-design/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
“Làm cho bottom sheet này bám theo ngón tay tôi, giữ đà chuyển động và cảm giác tự nhiên khi tôi thả tay.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent áp dụng một bộ nguyên tắc: chuyển động bắt đầu từ giá trị hiện tại trên màn hình, giữ vận tốc của người dùng, và có thể bị giữ lại và đảo chiều bất cứ lúc nào. Nó dùng lò xo và sự kiện đầu vào của web để đạt được điều này.
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.
Apple Design
How Apple builds interfaces that stop feeling like a computer and start feeling like an extension of you. This knowledge comes from Apple's WWDC design talks — chiefly Designing Fluid Interfaces (WWDC 2018) — distilled and translated into the web platform (CSS, Pointer Events, requestAnimationFrame, spring libraries like Motion/Framer Motion).
The through-line: an interface feels alive when motion starts from the current on-screen value, inherits the user's velocity, projects momentum forward, and can be grabbed and reversed at any instant. Springs are the tool that makes all of this natural, because they are inherently interruptible and velocity-aware.
The Core Idea
"When we align the interface to the way we think and move, something magical happens — it stops feeling like a computer and starts feeling like a seamless extension of us."
An interface is fluid when it behaves like the physical world: things respond instantly, move continuously, carry momentum, resist at boundaries, and can be redirected mid-motion. Everything below is a way to get closer to that.
Apple frames design as serving four human needs: safety/predictability, understanding, achievement, and joy. Every rule here serves one of them.
1. Response — kill latency
The moment lag appears, the feeling of directness "falls off a cliff." Response is the foundation everything else is built on.
- Respond on pointer-down, not on release. Highlight a button the instant it's pressed. Waiting for
click/touch-up to show feedback feels dead. - Be vigilant about every latency. Audit debounces, artificial timers, transition waits, and the ~300ms tap delay. Anything on the input path that isn't essential is a regression.
- Feedback must be continuous during the interaction, not just at the end. For a drag, slider, or drawer, update the UI 1:1 with the pointer the whole way through — never animate only when the gesture completes.
/* Feedback lives on the press, and it's instant */
.button:active {
transform: scale(0.97);
transition: transform 100ms ease-out;
}
2. Direct manipulation — 1:1 tracking
"Touch and content should move together."
When the user drags something, it must stay glued to the finger — and respect the offset from where they grabbed it. Snapping to the element's center on grab breaks the illusion immediately.
- Use Pointer Events with
setPointerCaptureso tracking continues even when the pointer leaves the element's bounds. - Track a short velocity/position history (last few
pointermoveevents), not just the current point — you'll need velocity at release.
el.addEventListener('pointerdown', (e) => {
el.setPointerCapture(e.pointerId);
const grabOffset = e.clientY - el.getBoundingClientRect().top; // respect where they grabbed
// ...track position + timestamp history for velocity
});
3. Interruptibility — the single most important principle
"The thought and the gesture happen in parallel."
Every animation must be interruptible and redirectable at any moment. A user must be able to grab a moving element mid-flight and reverse it without waiting for the animation to finish. A closing modal the user grabs again should follow the finger — not finish closing first, then reopen.
- Never lock out input during a transition.
- Always animate from the presentation (current) value, never the target value. On interrupt, read the element's live on-screen transform and start the new animation from there. Starting from the logical/target value causes a visible jump.
- Avoid CSS transitions and
@keyframesfor anything gesture-driven — they can't be smoothly grabbed and reversed mid-flight. Springs animate from the current value by default, which is exactly what interruption needs. - When a gesture reverses, blend velocity — don't hard-cut it. Replacing one animation with another at a reversal creates a velocity discontinuity, a "brick wall." Spring libraries that carry velocity through a re-target avoid it. (This is what iOS's additive animations do natively; on the web, choose a spring library that re-targets from the current velocity.)
- Decompose 2D motion into independent X and Y springs. A single spring on a 2D distance desyncs when X and Y have different velocities.
4. Behavior over animation — use springs
"Think of animation as a conversation between you and the object, not something prescribed by the interfac
Câu hỏi thường gặp
Chỉ dành cho thiết bị Apple à?
Không. Nó chuyển các nguyên tắc thiết kế của Apple sang công cụ web như CSS, Pointer Events và thư viện lò xo.
Có thể ngắt nghĩa là gì?
Một chuyển động có thể được giữ lại và đảo ngược giữa chừng, thay vì phải hoàn thành trước.
Có bao gồm chế độ giảm chuyển động không?
Có. Skill có hướng dẫn cho cài đặt giảm chuyển động.
Chi tiết
Mô tả gốc của tác giả
Apple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading), reduced-motion, or the design foundations (feedback, spatial consistency, restraint) behind Apple-style interfaces.
repo: spree/spree
Độ phổ biến
- Sao GitHub
- 16k
- Vị trí xếp hạng
- #10874
- Giấy phép
- BSD-3-Clause
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
animate
16kXây hiệu ứng chuyển động từ đầu: trước tiên quyết định có nên chuyển động không, rồi chọn mục đích, thời gian và đường cong trước khi viết code.
animation-vocabulary
16kChuyển một mô tả mơ hồ về hiệu ứng hoặc chuyển động thành tên kỹ thuật chính xác, để bạn biết nên hỏi gì.
find-animation-opportunities
16kTìm trong giao diện những chỗ có lợi khi có chuyển động và loại bỏ phần còn lại. Đưa ra danh sách ngắn các gợi ý hiệu ứng cụ thể mà không thay đổi code.
improve-animations
16kRà soát hiệu ứng chuyển động trong codebase và viết kế hoạch có thứ tự để agent khác thực hiện. Chỉ lập kế hoạch, không sửa mã nguồn.
Skill tương tự
canvas
394kCho phép agent của bạn hiện một widget trực quan được lưu trữ trên bảng Mac đã kết nối, rồi ẩn bảng hoặc chuyển nó sang trang khác.
control-ui
394kGiúp agent của bạn sắp xếp và khắc phục sự cố Control UI của OpenClaw, gồm các phiên, bảng điều khiển và Gateway đã kết nối.
diagram-maker
394kGiúp agent của bạn vẽ sơ đồ rõ ràng dạng SVG, HTML hoặc Excalidraw có thể sửa, cho quy trình, kiến trúc hệ thống và bản phác bảng trắng.