Logo Motion And Haptics

Motion And Haptics

Cộng đồng
zakariaf
motion-and-haptics

Áp dụng phản hồi tương tác được thiết kế thay vì dùng mặc định của framework — mọi thao tác xác nhận đều được phản hồi ngay trong cùng khung hình; chuyển động chỉ tô điểm cho trạng thái chứ không phải chính trạng thái (trạng thái cuối vẫn giống hệt khi tắt hoạt ảnh); danh mục các khoảnh khắc tương tác được đặt tên, mỗi mục xác định sẵn thời điểm kích hoạt, vai trò thời lượng, vị trí phản hồi xúc giác và phương án thay thế khi giảm chuyển động; phản hồi xúc giác là ánh xạ sự kiện sang cường độ trong HapticTheme, chỉ kích hoạt đúng một lần ở khung hình xác nhận (không kích hoạt theo từng khung hình hoạt ảnh, không kích hoạt theo từng đầu vào được gộp, không dùng heavyImpact khi báo lỗi) và được quản lý bằng một nút bật/tắt trung tâm; mọi hoạt ảnh đều có thể ngắt để thao tác chạm đưa chúng về trạng thái cuối; hiệu ứng ăn mừng có giới hạn, chỉ chạy một lần, không lặp và không chặn đầu vào; mọi hoạt ảnh lặp đều có điều kiện dừng rõ ràng (rời màn hình, ứng dụng chạy nền, giảm chuyển động); và phản hồi được truyền qua nhiều kênh để xúc giác và âm thanh vẫn hoạt động khi giảm chuyển động. Hãy dùng khi thêm hoặc tinh chỉnh hoạt ảnh, trạng thái thành công hoặc lỗi, phản hồi xúc giác, hiệu ứng ăn mừng hoặc chuyển cảnh.

Add to TypingMind

Tổng quan

Nhà phát hànhzakariaf
Kho mãFlutter-Skills
Tên kỹ năngmotion-and-haptics
Sao
64
Bản fork
15
Tệp đi kèm
1
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 1 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được zakariaf công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Motion And Haptics trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/zakariaf/Flutter-Skills/tree/main/skills/motion-and-haptics
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/zakariaf/Flutter-Skills.git /tmp/Flutter-Skills
mkdir -p .claude/skills
cp -r /tmp/Flutter-Skills/skills/motion-and-haptics .claude/skills/motion-and-haptics
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Motion And Haptics trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Motion And Haptics ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Motion And Haptics với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Motion and haptics

What fires, when, exactly once, and how it degrades. Feedback is the layer users feel rather than read — an app whose taps land, whose errors are felt, and whose success is acknowledged reads as finished; the same app with default Material feedback reads as a prototype.

Scope boundary. Motion tokens — duration roles, curve slots, the no-raw-values gate, and resolveMotion collapsing to Duration.zero under reduced motion — are owned by design-system-structure. Painter/ticker mechanics are owned by custom-canvas-and-gestures. Which surface a message uses — loading, empty, error, snackbar, banner, dialog, Undo, and screen-reader announcements — is owned by ui-states-and-feedback. This skill owns the sensory layer those decisions ride on: which moments exist, what each one commits to, how haptics are mapped and fired, and what survives when the animation does not.

Non-negotiable rules

  1. Every committing interaction is acknowledged in the same frame it happens. Finger-down shows a press state immediately; the commit's own feedback follows on commit. WHY: a control that waits for an async result before showing anything is indistinguishable from a control that did not register the tap, and the user taps again.

  2. Motion decorates state; it is never the state. The end state must be identical, correct, and reachable with all animations disabled. A selection that only exists while its animation runs, or a value that is only legible mid-transition, is a bug that reduced-motion users hit every time.

  3. Name your moments and design each one deliberately. Every app has a small catalog — press acknowledgment, rejected input, the commit payoff, success, progress or streak increment, and the signature screen transition. Each moment declares five things: its trigger, what changes, which duration role and curve it spends, its haptic slot, and its reduced-motion fallback. A moment left unspecified is not "minimal" — it is the framework default, chosen by nobody. See references/moment-catalog.md.

  4. Every animation declares its reduced-motion behaviour at design time. "It is small, nobody will mind" is not a fallback. The mechanism (resolveMotion → Duration.zero) belongs to design-system-structure; the decision — cross-fade to the end state, appear already-complete, omit the flourish entirely — is made per moment, here, and written down. Feature code never re-reads the platform flag per animation.

  5. Haptics are a map, not scattered calls. A HapticTheme extension maps each event to at most one HapticFeedback verb: selection ≤ selectionClick, commit ≤ lightImpact/mediumImpact, rejection ≤ lightImpact, success ≤ mediumImpact, and heavyImpact reserved for a genuine milestone. A null slot is a declared silence, not an omission. WHY: haptics added ad hoc at call sites always drift upward in intensity until the app buzzes.

  6. Fire one haptic per committed event, on the commit frame. Never inside an animation callback, never per frame, never once per input in a coalesced gesture — a drag emits at most an engage and a commit. WHY: a haptic per frame is a vibration, and a haptic per coalesced input turns a fast gesture into a rattle.

  7. heavyImpact is never the error sound. Escalating intensity for failure punishes the user for a mistake the UI could have prevented. Rejection is acknowledged, not amplified.

  8. One in-app toggle gates every haptic, celebrations included. Platforms have their own coarse system-haptics setting; an app that fires haptics needs its own switch too, and it must be a single central gate rather than a flag each call site remembers to check.

  9. Every animation is interruptible. A tap during a transition or celebration resolves it to its end state immediately. Never block input for the duration of a flourish, and never make the user wait out a success. WHY: the second time a user sees a celebration they want to be past it.

  10. Celebrations have a budget. Bounded element count, bounded time to the next interactive state, originating from the point of action rather than the screen edges, played once, never looped. Failure states get acknowledgment with no shaming motion. WHY: an unbounded celebration is a load screen the user did not ask for.

  11. Every repeating or ambient animation declares a stop condition. It stops when its route is not current, when the app is backgrounded, and under reduced motion. A repeat() with no stop condition is a battery bug that no test will catch and no reviewer will see.

  12. Feedback is redundant across channels. Haptics and sound survive reduced motion precisely because they are the remaining channels — so a state change may never be carried by motion alone. (Color-alone is owned by accessibility-as-code; this is the motion-alone half of the same rule.)

  13. Sound, if any, is the third channel and never the first. Respect the platform's silent behaviour, keep it short, never require it to understand what happened, and gate it behind the same kind of central toggle as haptics.

  14. Transitions follow reading direction; a fixed content surface does not re-mirror. A horizontal push flips under RTL because navigation is directional; a canvas, board, chart, or media surface whose own layout is direction-neutral stays as it is. Direction geometry is owned by i18n-rtl-l10n.

The moment declaration

Write each moment down before implementing it. The table is the specification — an implementation that cannot fill a column has not finished designing that moment.

MomentTriggerWhat changesDuration roleHapticReduced-motion fallback
Presspointer downpress transformshortestselectionClickinstant state, no transform
Rejectinvalid inputbounded shake + messageshort, interruptiblelightImpactmessage only, no shake
Commitstate committedthe transformation itselfmediumlightImpactend state appears instantly
Successtask completeacknowledgment + resultlong, skippablemediumImpactresult appears already complete
Incrementcounter advancesone emphasis pulseshortselectionClick or silencenew value, no pulse
Transitionroute changethe signature transitionmediumnonecross-fade or none

Durations here are roles, not numbers — the numbers are tokens owned by design-system-structure.

Firing a haptic exactly once

dart
// The event map lives in the theme; call sites name an event, never an intensity.
@immutable
class HapticTheme extends ThemeExtension<HapticTheme> {
  const HapticTheme({this.select, this.commit, this.reject, this.success});

  /// A null slot is a DECLARED silence — the design said no haptic here.
  final Future<void> Function()? select;
  final Future<void> Function()? commit;
  final Future<void> Function()? reject;
  final Future<void> Function()? success;
  // copyWith / lerp omitted — see design-system-structure for the ThemeExtension contract.
}

// One central gate; no call site remembers to check the setting.
void fire(WidgetRef ref, Future<void> Function()? slot) {
  if (!ref.read(hapticsEnabledProvider)) return;
  slot?.call();
}

// At the commit — once, on the frame the state actually changed (rules 6, 8).
void onCommit(BuildContext context, WidgetRef ref, EditIntent intent) {
  ref.read(itemsProvider.notifier).apply(intent);          // state first
  fire(ref, Theme.of(context).extension<HapticTheme>()!.commit);
}

Never call HapticFeedback.* from an AnimationController listener, an onEnd callback, or a per-item loop — those are the three places a single event becomes a burst.

Anti-patterns

  • A control with no press state — every "did that register?" double-tap starts here.
  • State that only exists while an animation runs — turn animations off and the app must still be correct and legible.
  • An animation with no designed reduced-motion behaviour, or feature code re-reading the platform flag per animation.
  • HapticFeedback.mediumImpact() sprinkled at call sites — map events to slots once; ad-hoc haptics only ever escalate.
  • A haptic in an animation listener, an onEnd, or per item in a coalesced gesture — one per committed event, on the commit frame.
  • heavyImpact for an error — acknowledge failure, do not punish it.
  • An un-skippable celebration, or blocked input during a flourish — a tap resolves it instantly.
  • A looping celebration, edge-spawned particles, or an unbounded element count — budget it.
  • A "sad" failure animation — the user already knows.
  • repeat() with no stop condition — it must stop off-route, backgrounded, and under reduced motion.
  • Sound as the only signal, or sound that ignores the platform's silent behaviour.
  • A mirrored content surface under RTL — navigation direction flips, a direction-neutral canvas does not.

Definition of done

  • Every committing interaction acknowledges within the same frame.
  • Every moment touched has a filled-in declaration row: trigger, change, duration role, haptic slot, reduced-motion fallback.
  • The end state is identical and reachable with animations disabled; nothing is motion-only.
  • Haptics come from the HapticTheme map, are at or below the intensity ceiling for their event, fire once per committed event on the commit frame, and are gated by one central toggle.
  • null haptic slots are deliberate silences, recorded as such.
  • Every animation is interruptible; a tap resolves it to its end state; input is never blocked.
  • Celebrations are bounded, originate from the point of action, play once, and never loop.
  • Every repeating animation has an explicit stop condition for off-route, backgrounded, and reduced motion.
  • Sound (if any) is redundant, short, silent-mode-aware, and centrally gated.
  • Transitions respect reading direction; direction-neutral content surfaces are not re-mirrored.

Related skills

  • See design-system-structure for the motion tokens, curve slots, and the resolveMotion helper this skill spends — including the three animations Material mounts by default.
  • See custom-canvas-and-gestures for driving canvas animation from an AnimationController as repaint: and for RepaintBoundary placement.
  • See ui-states-and-feedback for the state a moment is feedback about — loading/empty/error rendering, the snackbar/banner/dialog ladder, Undo, and SemanticsService.announce.
  • See accessibility-as-code for the color-alone rule this skill's motion-alone rule mirrors, and for reading platform accessibility flags.
  • See flutter-performance for disposal, boundary budgeting, and profile-mode measurement of anything that feels heavy.
  • See i18n-rtl-l10n for directional geometry under RTL.
  • See design-review-workflow for the end-of-build pass where every declared moment is verified on video with reduced motion on and off.

References

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

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

Kỹ năng AI Motion And Haptics làm được gì?

Áp dụng phản hồi tương tác được thiết kế thay vì dùng mặc định của framework — mọi thao tác xác nhận đều được phản hồi ngay trong cùng khung hình; chuyển động chỉ tô điểm cho trạng thái chứ không phải chính trạng thái (trạng thái cuối vẫn giống hệt khi tắt hoạt ảnh); danh mục các khoảnh khắc tương tác được đặt tên, mỗi mục xác định sẵn thời điểm kích hoạt, vai trò thời lượng, vị trí phản hồi xúc giác và phương án thay thế khi giảm chuyển động; phản hồi xúc giác là ánh xạ sự kiện sang cường độ trong HapticTheme, chỉ kích hoạt đúng một lần ở khung hình xác nhận (không kích hoạt theo từng khun...

Vì sao nên dùng Motion And Haptics trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Motion And Haptics là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Motion And Haptics trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/zakariaf/Flutter-Skills/tree/main/skills/motion-and-haptics. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Motion And Haptics?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Motion And Haptics với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Motion And Haptics với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Motion And Haptics có miễn phí không?

Có. Kỹ năng này được zakariaf phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇