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

makepad-2-0-animation

Skill này làm gì

Công cụ này giúp tạo hoạt ảnh cho giao diện bằng thư viện Makepad. Các phần tử có thể đổi diện mạo theo thời gian, tạo hiệu ứng như trạng thái khi rê chuột, chuyển cảnh hoặc hoạt ảnh liên tục.

Khi nào nên dùng

  • ✓Khi bạn muốn một nút đổi màu khi được nhấn.
  • ✓Khi bạn muốn một phần tử mờ dần xuất hiện một cách mượt mà.
  • ✓Khi bạn muốn tạo hiệu ứng tải có hoạt ảnh.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/makepad-2-0-animation/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/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/makepad-2-0-animation/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

“Làm sao để một nút đổi màu khi con trỏ chuột di chuyển lên trên?”

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

Cách hoạt động

Bạn định nghĩa một 'animator' cho một phần tử. Animator này điều khiển cách các thuộc tính hình ảnh (như màu hoặc kích thước) thay đổi giữa các 'trạng thái' (như 'bình thường' và 'rê chuột') theo thời gian và hiệu ứng đã đị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.

When to Use

  • Use when this upstream workflow matches the user's stated goal.
  • Use when the task requires the procedures documented in this skill.

Makepad 2.0 Animation Skill

Version: makepad-widgets (dev branch) | Last Updated: 2026-03-03

Overview

The Animator system drives instance() shader variables over time, enabling hover effects, transitions, and looping animations. It uses independent animation tracks called "groups" that run simultaneously.

Documentation

Refer to the local files for detailed documentation:

  • ./references/animator-reference.md - Complete Animator API, play types, ease functions, examples

IMPORTANT: Documentation Completeness Check

Before answering questions, Claude MUST:

  1. Read the relevant reference file(s) listed above
  2. If file read fails or file is empty:
    • Inform user: "Reference docs incomplete. Still answering based on SKILL.md patterns."
    • Still answer based on SKILL.md patterns + built-in knowledge
  3. If reference file exists, incorporate its content into the answer

Critical: Widget Animator Support

NOT all widgets support animator! Adding animator: Animator{...} to an unsupported widget is silently ignored - no error, no animation, nothing happens.

Widgets that SUPPORT Animator

View, SolidView, RoundedView, ScrollXView, ScrollYView, ScrollXYView, Button, ButtonFlat, ButtonFlatter, CheckBox, Toggle, RadioButton, LinkLabel, TextInput

Widgets that DO NOT Support Animator

Label, H1-H4, P, TextBox, Image, Icon, Markdown, Html, Slider, DropDown, Splitter, Hr, Filler

To animate a Label: Wrap it in a View with the animator:

View{
    width: Fit height: Fit
    animator: Animator{
        hover: {
            default: @off
            off: AnimatorState{ from: {all: Forward {duration: 0.15}} apply: {draw_bg: {hover: 0.0}} }
            on: AnimatorState{ from: {all: Forward {duration: 0.15}} apply: {draw_bg: {hover: 1.0}} }
        }
    }
    label := Label{text: "Animated via parent"}
}

Animator Structure

animator: Animator{
    <group_name>: {
        default: @<state_name>
        <state_name>: AnimatorState{
            from: { ... }
            ease: <EaseFunction>
            redraw: true
            apply: { ... }
        }
        <state_name>: AnimatorState{ ... }
    }
    <group_name>: { ... }
}

Groups

Each group is an independent animation track. Common groups:

Group Purpose Typical States
hover Mouse hover in/out off, on
focus Keyboard focus off, on
active Toggled/checked state off, on
disabled Disabled state off, on
time Continuous looping off, on

Multiple groups animate simultaneously without interfering.


The from Block

Controls transition timing. Keys are states being transitioned FROM, or all as catch-all.

// From any state, animate over 0.2 seconds
from: {all: Forward {duration: 0.2}}

// Instant from any state
from: {all: Snap}

// Different timing depending on origin
from: {
    all: Forward {duration: 0.1}
    down: Forward {duration: 0.01}
}

Play Types

Type Description Example
Forward {duration: 0.2} One-shot forward Hover transitions
Snap Instant jump, no animation Default state initialization
Loop {duration: 1.0} Looping animation Loading spinners
ReverseLoop {duration: 1.0} Ping-pong loop Pulsing effects
BounceLoop {duration: 1.0} Bounce back and forth Bouncing animations

Ease Functions

Function Description
Linear Constant speed
InQuad / OutQuad / InOutQuad Quadratic easing
InCubic / OutCubic / InOutCubic Cubic easing
InQuart / OutQuart / InOutQuart Quartic easing
InQuint / OutQuint / InOutQuint Quintic easing
InSine / OutSine / InOutSine Sine easing
InExp / OutExp / InOutExp Exponential easing
InCirc / OutCirc / InOutCirc Circular easing
InElastic / OutElastic / InOutElastic Elastic spring
InBack / OutBack / InOutBack Overshoot
InBounce / OutBounce / InOutBounce Bounce

Usage: ease: OutCubic in the AnimatorState (optional, defaults to Linear).


The apply Block

…

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

Tất cả phần tử đều tạo được hoạt ảnh không?

Không. Một số phần tử như 'View' và 'Button' hỗ trợ hoạt ảnh, còn 'Label' và 'Image' thì không trực tiếp. Để tạo hoạt ảnh cho 'Label', bạn cần đặt nó trong một 'View' có thể tạo hoạt ảnh.

“Group” trong hoạt ảnh là gì?

Group là các làn hoạt ảnh độc lập, có thể chạy cùng lúc. Ví dụ phổ biến gồm 'hover' (khi rê chuột), 'focus' (khi phần tử được chọn) và 'time' (hoạt ảnh liên tục).

Làm sao để hoạt ảnh nhanh hơn hoặc chậm hơn?

Bạn có thể chỉnh 'duration' của chuyển đổi, tính bằng giây. Bạn cũng có thể chọn 'ease functions' để kiểm soát tốc độ tại các thời điểm khác nhau, như bắt đầu chậm rồi nhanh dần, hoặc ngược lại.

Chi tiết

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

Makepad 2.0 guidance for animation; use when building or debugging Makepad UI code.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5139
Giấy phép
MIT
Cập nhật
15/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ự