Gesture Responses

dylantarre/animation-principles/skills/05-by-animation-type/gesture-responses

作者 dylantarre83597134ba8f無授權條款99 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫9 個月前更新

Use when responding to touch or click interactions - button presses, drag feedback, swipe responses, tap ripples, or any direct manipulation animation.

僅含說明Design & Creative
AI 產生的概覽

運用迪士尼十二項動畫原則,指導觸控與點擊手勢回饋的動畫設計。

功能
這項技能為直接操作回饋的動畫提供指引,例如按鈕按下、拖曳回饋、滑動回應、點擊漣漪與釋放動畫。它把迪士尼十二項動畫原則對應到互動狀態,並提供時間建議,以及按下、釋放、漣漪與拖曳回彈的 CSS 與 JavaScript 實作模式。這項技能只有說明內容,不會產生檔案或指令碼。
適用情境
在實作或調整觸控、點擊互動回饋時使用,例如按下狀態、拖曳回饋、滑動回應或點擊漣漪。適合需要讓手勢回應顯得即時且具備物理質感的介面工作。
執行需求
不需要任何工具、套件或憑證;這項技能僅為說明文件,未附帶指令碼。套用其中的 CSS 與 JavaScript 模式需要網頁前端環境,指引也建議在實際觸控裝置上測試。

Gesture Response Animations

Apply Disney's 12 principles to direct user interactions.

Principle Application

Squash & Stretch: Elements compress on press (scale 0.95-0.97), spring back on release.

Anticipation: The press IS the anticipation. Response should be immediate - no delay.

Staging: Response originates from interaction point. Ripples expand from tap location.

Straight Ahead vs Pose-to-Pose: Define rest, pressed, and released poses. Transitions flow between them.

Follow Through & Overlapping: Release animation overshoots rest position. Scale to 1.02, settle to 1.0.

Slow In/Slow Out: Press: instant. Release: ease-out with overshoot cubic-bezier(0.34, 1.56, 0.64, 1).

Arcs: Drag elements follow finger with slight lag on curves. Snapping follows arc to destination.

Secondary Action: Press triggers ripple + scale + shadow change simultaneously.

Timing:

  • Press response: 0-50ms (must feel instant)
  • Release recovery: 150-300ms (can be playful)
  • Ripple expansion: 400-600ms (decorative, can be slower)

Exaggeration: Subtle for press (0.97), playful for release (overshoot 1.03).

Solid Drawing: Pressed state should feel "pushed in" - smaller scale, reduced shadow, shifted color.

Appeal: Gestures should feel physically satisfying. Like pressing a real button.

Timing Recommendations

GesturePress DurationRelease DurationEasing
Tap/Click50ms200msease-out + overshoot
Long Press50ms300msease-out
Drag Start100ms-ease-out
Drag Release-300msspring
Swipe-200-400msease-out
Pinchreal-time300msspring

Implementation Patterns

css
/* Button press */.button {  transition: transform 50ms ease-out;}
.button:active {  transform: scale(0.97);}
/* Release with overshoot */.button:not(:active) {  transition: transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1);}
/* Material ripple */.ripple {  animation: ripple 600ms ease-out forwards;}
@keyframes ripple {  from {    transform: scale(0);    opacity: 0.5;  }  to {    transform: scale(4);    opacity: 0;  }}

Drag Feedback Pattern

javascript
// Smooth drag with slight lagelement.style.transform = `translate(${x}px, ${y}px)`;element.style.transition = 'transform 50ms ease-out';
// Snap back with springelement.style.transition = 'transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1)';element.style.transform = 'translate(0, 0)';

Critical Rule

Gesture responses must be under 100ms to feel connected to the action. Anything slower breaks the direct manipulation illusion. Test on actual touch devices.

來源與署名

來源:dylantarre/animation-principles位於skills/05-by-animation-type/gesture-responses提交8359713

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架