Antigravity-awesome-skills makepad-animation
install
source · Clone the upstream repo
git clone https://github.com/sickn33/antigravity-awesome-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/sickn33/antigravity-awesome-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/plugins/antigravity-awesome-skills/skills/makepad-animation" ~/.claude/skills/sickn33-antigravity-awesome-skills-makepad-animation-f6f111 && rm -rf "$T"
manifest:
plugins/antigravity-awesome-skills/skills/makepad-animation/SKILL.mdsource content
Makepad Animation Skill
Version: makepad-widgets (dev branch) | Last Updated: 2026-01-19
Check for updates: https://crates.io/crates/makepad-widgets
You are an expert at Makepad animations. Help users by:
- Writing code: Generate animation code following the patterns below
- Answering questions: Explain states, transitions, timelines
When to Use
- You need to build or debug animations, transitions, hover states, or animator timelines in Makepad.
- The task involves
, state changes, easing, keyframes, or visual interaction feedback.animator - You want Makepad-specific animation patterns instead of generic Rust UI guidance.
Documentation
Refer to the local files for detailed documentation:
- Complete animation reference./references/animation-system.md
Advanced Patterns
For production-ready animation patterns, see the
_base/ directory:
| Pattern | Description |
|---|---|
| 06-animator-basics | Animator fundamentals |
| 07-easing-functions | Easing and timing |
| 08-keyframe-animation | Complex keyframes |
IMPORTANT: Documentation Completeness Check
Before answering questions, Claude MUST:
- Read the relevant reference file(s) listed above
- If file read fails or file is empty:
- Inform user: "本地文档不完整,建议运行
更新文档"/sync-crate-skills makepad --force - Still answer based on SKILL.md patterns + built-in knowledge
- Inform user: "本地文档不完整,建议运行
- If reference file exists, incorporate its content into the answer
Key Patterns
1. Basic Hover Animation
<Button> { text: "Hover Me" animator: { hover = { default: off off = { from: { all: Forward { duration: 0.15 } } apply: { draw_bg: { color: #333333 } } } on = { from: { all: Forward { duration: 0.15 } } apply: { draw_bg: { color: #555555 } } } } } }
2. Multi-State Animation
<View> { animator: { hover = { default: off off = { from: { all: Forward { duration: 0.2 } } apply: { draw_bg: { color: #222222 } } } on = { from: { all: Forward { duration: 0.2 } } apply: { draw_bg: { color: #444444 } } } } pressed = { default: off off = { from: { all: Forward { duration: 0.1 } } apply: { draw_bg: { scale: 1.0 } } } on = { from: { all: Forward { duration: 0.1 } } apply: { draw_bg: { scale: 0.95 } } } } } }
3. Focus State Animation
<TextInput> { animator: { focus = { default: off off = { from: { all: Forward { duration: 0.2 } } apply: { draw_bg: { border_color: #444444 border_size: 1.0 } } } on = { from: { all: Forward { duration: 0.2 } } apply: { draw_bg: { border_color: #0066CC border_size: 2.0 } } } } } }
4. Disabled State
<Button> { animator: { disabled = { default: off off = { from: { all: Snap } apply: { draw_bg: { color: #0066CC } draw_text: { color: #FFFFFF } } } on = { from: { all: Snap } apply: { draw_bg: { color: #333333 } draw_text: { color: #666666 } } } } } }
Animator Structure
| Property | Description |
|---|---|
| Root animation container |
| State definition (hover, pressed, focus, disabled) |
| Initial state value |
| State value definition (on, off, custom) |
| Transition timeline |
| Properties to animate |
Timeline Types (Play Enum)
| Type | Description |
|---|---|
| Linear forward animation |
| Instant change, no transition |
| Reverse animation |
| Looping animation |
| Bounce loop animation |
Easing Functions (Ease Enum)
// Basic Linear // Quadratic InQuad, OutQuad, InOutQuad // Cubic InCubic, OutCubic, InOutCubic // Quartic InQuart, OutQuart, InOutQuart // Quintic InQuint, OutQuint, InOutQuint // Sinusoidal InSine, OutSine, InOutSine // Exponential InExp, OutExp, InOutExp // Circular InCirc, OutCirc, InOutCirc // Elastic InElastic, OutElastic, InOutElastic // Back InBack, OutBack, InOutBack // Bounce InBounce, OutBounce, InOutBounce // Custom ExpDecay { d1: f64, d2: f64 } Bezier { cp0: f64, cp1: f64, cp2: f64, cp3: f64 } Pow { begin: f64, end: f64 }
Using Easing
from: { all: Ease { duration: 0.3, ease: InOutQuad } }
Common States
| State | Values | Trigger |
|---|---|---|
| on, off | Mouse enter/leave |
/ | on, off | Mouse press/release |
| on, off | Focus gain/lose |
| on, off | Widget enabled/disabled |
| on, off | Selection change |
Animatable Properties
Most
draw_* shader uniforms can be animated:
- Colors:
,color
,border_colorshadow_color - Sizes:
,border_size
,border_radiusshadow_radius - Transforms:
,scale
,rotationoffset - Opacity:
opacity
When Writing Code
- Always set
for initial statedefault: - Use
for smooth transitionsForward - Use
for instant state changes (like disabled)Snap - Keep durations short (0.1-0.3s) for responsive feel
- Animate shader uniforms in
,draw_bg
, etc.draw_text
Rust API (AnimatorImpl Trait)
pub trait AnimatorImpl { // Animate to state fn animator_play(&mut self, cx: &mut Cx, state: &[LiveId; 2]); // Cut to state (no animation) fn animator_cut(&mut self, cx: &mut Cx, state: &[LiveId; 2]); // Check current state fn animator_in_state(&self, cx: &Cx, state: &[LiveId; 2]) -> bool; } // Usage example fn handle_event(&mut self, cx: &mut Cx, event: &Event, scope: &mut Scope) { match event.hits(cx, self.area()) { Hit::FingerHoverIn(_) => { self.animator_play(cx, id!(hover.on)); } Hit::FingerHoverOut(_) => { self.animator_play(cx, id!(hover.off)); } Hit::FingerDown(_) => { self.animator_play(cx, id!(pressed.on)); } Hit::FingerUp(_) => { self.animator_play(cx, id!(pressed.off)); } _ => {} } }
When Answering Questions
- States are independent - multiple can be active simultaneously
- Animation applies properties when state reaches that value
defines HOW to animate,from
defines WHAT to animateapply- Makepad tweens between old and new values automatically
- Use
macro to reference animation states in Rustid!(state.value)
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.